function mepr_exclude_protected_posts_from_archive( $query ) { if( !$query->is_admin && $query->is_archive() && $query->is_main_query() ) { $posts_to_exclude = array(); $posts = get_posts( array( ‘numberposts’ => -1 ) ); foreach( $posts as $post ) { if( MeprRule::is_locked( $post ) ) { $posts_to_exclude[] = $post->ID;…Continue reading
function mepr_exclude_protected_posts_from_search( $query ) { if( !$query->is_admin && $query->is_search && $query->is_main_query() ) { $posts_to_exclude = array(); $posts = get_posts( array( ‘post_type’ => get_post_types(), ‘numberposts’ => -1 )); foreach( $posts as $post ) { if( MeprRule::is_locked( $post ) ) { $posts_to_exclude[]…Continue reading
function auto_click_have_coupon_link() { ?>Continue reading
/* Remove Post Title from Yoast Breadcrumb */ add_filter(‘wpseo_breadcrumb_single_link’, ‘remove_breadcrumb_title’ ); function remove_breadcrumb_title( $link_output) { if(strpos( $link_output, ‘breadcrumb_last’ ) !== false ) { $link_output = ”; } return $link_output; }Continue reading
// Estimated reading time function readTime ( $content = ”, $words_per_minute = 250, $with_gutenberg = false ) { // In case if content is build with gutenberg parse blocks if ( $with_gutenberg ) { $blocks = parse_blocks( $content ); $contentHtml…Continue reading
// Remove default WordPress jquery wp_deregister_script( ‘jquery’ ); //Remove jquery migrate add_action( ‘wp_default_scripts’, ‘remove_jquery_migrate’ ); function remove_jquery_migrate( $scripts ) { if ( ! is_admin() && isset( $scripts->registered[‘jquery’] ) ) { $script = $scripts->registered[‘jquery’]; if ( $script->deps ) { $script->deps =…Continue reading
// Remove post title from yoast breadcrumbs add_filter(‘wpseo_breadcrumb_single_link’, function( $link_output) { if( strpos( $link_output, ‘breadcrumb_last’ ) !== false ) { $link_output = ”; } return $link_output; } );Continue reading
// Disable Auto Generated Images Sizes add_action(‘intermediate_image_sizes_advanced’, ‘disable_image_sizes’); function disable_image_sizes($sizes) { //unset($sizes[‘thumbnail’]); //unset($sizes[‘medium’]); //unset($sizes[‘large’]); unset($sizes[‘medium_large’]); unset($sizes[‘1536×1536’]); unset($sizes[‘2048×2048’]); return $sizes; } add_action(‘init’, ‘disable_other_image_sizes’); function disable_other_image_sizes() { remove_image_size(‘post-thumbnail’); remove_image_size(‘another-size’); } add_filter(‘big_image_size_threshold’, ‘__return_false’);Continue reading
add_filter( ‘wcv_product_ships_from’, ‘ships_from_address’ ); function ships_from_address( $field ){ global $post, $product; $shipping_disabled = wc_string_to_bool( get_option( ‘wcvendors_shipping_management_cap’, ‘no’ ) ); $post = get_post( $product->get_id() ); if ( $product->needs_shipping() && ! $shipping_disabled && WCV_Vendors::is_vendor( $post->post_author ) ) { $vendor_id = WCV_Vendors::get_vendor_from_product( $product->get_id()…Continue reading