This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clean_svg( string $_svg_xml ) : string { | |
// common attributes, these mainly apply to shape based elements | |
$_common = array( | |
'id' => true, | |
'class' => true, | |
'style' => true, | |
'tabindex' => true, | |
'clip-path' => true, | |
'color' => true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_featured_images ( $howmany = 1 ) { | |
global $imgs; | |
$imgs = $howmany; | |
// add the meta boxes | |
add_action( 'add_meta_boxes', function( ) { | |
global $imgs; | |
// what post types do we want to allow this on? | |
$post_types = array( 'post', 'page' ); | |
foreach( $post_types as $pt ){ | |
add_meta_box( 'custom_postimage_meta_box', __( ucfirst( $pt ) . ' Images' ), function( $post ) { |