// 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
// Show featured image in post list /* * * Add Featured Image Column to Admin Area and Quick Edit menu * Source: https://rudrastyh.com/wordpress/quick-edit-featured-image.html * */ /* * This action hook allows to add a new empty column */ add_filter(‘manage_resource_posts_columns’,…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
ini_set(‘display_errors’,’Off’); ini_set(‘error_reporting’, E_ALL ); define(‘WP_DEBUG’, false); define(‘WP_DEBUG_DISPLAY’, false);Continue reading
// get associated buddyboss group_id from with a product_id function get_ox_subs_group_id($product_id) { if ($product_id) != null { $group_id=get_post_meta($product_id,’_social_group_id’,true); /* $group_url=get_post_meta($product_id,’_social_group_url’,true); */ return($group_id); } return(); }Continue reading
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
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
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
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