/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading
add_action( ‘jet-form-builder/media-field/before-upload’, /** * @var Jet_Form_BuilderRequestFieldsMedia_Field_Parser $parser */ function ( $parser ) { $class_name = $parser->get_context()->get_class_name(); // We need to add ‘allow-insert-attachments’ to the Advanced -> CSS Class Name option if ( ! $class_name || false === strpos( $class_name, ‘allow-insert-attachments’…Continue reading
// Remove query string from static resources function _remove_script_version( $src ){ $parts = explode( ‘?ver’, $src ); return $parts[0]; } add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1 ); add_filter( ‘style_loader_src’, ‘_remove_script_version’, 15, 1 ); // Turn off full screen editor if (is_admin())…Continue reading
// Remove wrap from images in ACF editor function gc_remove_p_tags_around_images($content) { $contentWithFixedPTags = preg_replace_callback(‘/ ((?:.(?!p>))*?)(]*>)?\s*(]+>)()?(.*?)/is’, function($matches) { // image and (optional) link: $image = $matches[2] . $matches[3] . $matches[4]; // content before and after image. wrap in unless it’s empty…Continue reading
// Custom Blocks add_action( ‘init’, ‘register_acf_blocks’ ); function register_acf_blocks() { register_block_type( __DIR__ . ‘/blocks/callout-list’ ); register_block_type( __DIR__ . ‘/blocks/blog-cta’ ); }Continue reading
// Custom Image Sizes function abc($size_arr) { $size_arr = array( ‘related’ => __( ‘Related’, ‘uabb’ ), ‘blogpage’ => __( ‘Blog Page’, ‘uabb’ ), ); // Add your own size to this array. return $size_arr; } add_filter( ‘uabb_blog_posts_featured_image_sizes’, ‘abc’ ); add_filter(…Continue reading
function rss_post_thumbnail($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = ‘ ‘ . get_the_post_thumbnail($post->ID) . ‘ ‘ . get_the_content(); } return $content; } add_filter(‘the_excerpt_rss’, ‘rss_post_thumbnail’); add_filter(‘the_content_feed’, ‘rss_post_thumbnail’);Continue reading