Stop WordPress from Automatically Emptying Trash
function g9_remove_schedule_delete() { remove_action(‘wp_scheduled_delete’, ‘wp_scheduled_delete’); } add_action(‘init’, ‘g9_remove_schedule_delete’);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
function g9_remove_schedule_delete() { remove_action(‘wp_scheduled_delete’, ‘wp_scheduled_delete’); } add_action(‘init’, ‘g9_remove_schedule_delete’);Continue reading
function g9_new_product_badge_shop_page() { global $product; $newness_days = 120; $created = strtotime($product->get_date_created()); if ((time() – (60 * 60 * 24 * $newness_days)) < $created) { echo '‘ . esc_html__(‘New!’, ‘woocommerce’) . ‘‘; } } add_action(‘woocommerce_before_shop_loop_item_title’, ‘g9_new_product_badge_shop_page’, 3);Continue reading
function g9_change_number_related_products($args) { $args[‘posts_per_page’] = 3; $args[‘columns’] = 3; return $args; } add_filter(‘woocommerce_output_related_products_args’, ‘g9_change_number_related_products’, 9999);Continue reading
function mepr_remove_accordion_class( $classes ) { //Course class body $cs_index = array_search( ‘mpcs-course-with-accordion’, $classes ); if ( isset( $cs_index ) ) { unset( $classes[$cs_index] ); } //Sidebar class body $sb_index = array_search( ‘mpcs-sidebar-with-accordion’, $classes ); if ( isset( $sb_index ) )…Continue reading
function g9_nav_menus_load($field) { $menus = wp_get_nav_menus(); if (!empty($menus)) { foreach ($menus as $menu) { $field[‘choices’][$menu->slug] = $menu->name; } } return $field; } add_filter(‘acf/load_field/name=name_of_field’, ‘g9_nav_menus_load’);Continue reading
add_filter(‘woocommerce_product_related_products_heading’, function () { return ”; });Continue reading
add_filter(‘woocommerce_product_description_heading’, ‘__return_null’);Continue reading
function g9_remove_tabs($tabs) { unset( $tabs[‘description’] ); unset($tabs[‘reviews’]); unset($tabs[‘additional_information’]); return $tabs; } add_filter(‘woocommerce_product_tabs’, ‘g9_remove_tabs’, 98);Continue reading
function g9_brand_single_product() { global $product; $term_ids = wp_get_post_terms($product->get_id(), ‘yith_product_brand’, array(‘fields’ => ‘ids’)); if (!empty($term_ids)) { echo get_the_term_list($product->get_id(), ‘yith_product_brand’, ‘ ‘, ‘, ‘, ‘ ‘); } } add_action(‘woocommerce_after_shop_loop_item_title’, ‘g9_brand_single_product’, 1);Continue reading
add_filter(‘yith_gift_cards_show_field’, ‘__return_false’);Continue reading