Remove wrap from images in ACF editor

// 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

Blog ACF Blocks

// 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 Blog Image Sizes

// 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

Add image to rss feed

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

Remove users from WP-JSON

add_filter(‘rest_endpoints’, function( $endpoints ) { if ( isset( $endpoints[‘/wp/v2/users’] ) ) { unset( $endpoints[‘/wp/v2/users’] ); } if ( isset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ) ) { unset( $endpoints[‘/wp/v2/users/(?P[\d]+)’] ); } return $endpoints; });Continue reading

“New” Badge for Recent Posts (copy)

add_filter( ‘the_title’, function ( $title, $id ) { if ( ! is_admin() && is_single( $id ) ) { $number_of_days = 7; $post_date = get_the_date( ‘U’, $id ); $current_date = current_time( ‘timestamp’ ); $date_diff = $current_date – $post_date; if ( $date_diff…Continue reading

WP Simple Pay: Add Email Address to Payment Confirmation URL

add_action( ‘template_redirect’, function() { if ( ! function_exists( ‘\SimplePay\Core\Payments\Payment_Confirmation\get_confirmation_data’ ) ) { return; } $data = \SimplePay\Core\Payments\Payment_Confirmation\get_confirmation_data(); if ( empty( $data ) ) { return; } $customer = $data[‘customer’]; $email = $customer->email; if ( isset( $_GET[’email’] ) ) { return;…Continue reading

No Index Search Results

function noindex_search_results() { if ( is_search() ) { ob_start(‘add_noindex_to_search’); } } add_action( ‘template_redirect’, ‘noindex_search_results’ ); function add_noindex_to_search($buffer) { if ( preg_match(‘/Continue reading