Disable Notifications
function disable_all_notifications() { wp_deregister_script(‘wp-notification-script’); } add_action(‘wp_enqueue_scripts’, ‘disable_all_notifications’, 999);Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
function disable_all_notifications() { wp_deregister_script(‘wp-notification-script’); } add_action(‘wp_enqueue_scripts’, ‘disable_all_notifications’, 999);Continue reading
add_filter( ‘woocommerce_cart_ready_to_calc_shipping’, function( $show_shipping ) { if ( is_cart() ) { return false; } return $show_shipping; }, 99 );Continue reading
/** * Reusable Blocks accessible in backend * */ function be_reusable_blocks_admin_menu() { add_menu_page( ‘Reusable Blocks’, ‘Reusable Blocks’, ‘edit_posts’, ‘edit.php?post_type=wp_block’, ”, ‘dashicons-editor-table’, 22 ); } add_action( ‘admin_menu’, ‘be_reusable_blocks_admin_menu’ );Continue reading
function acf_load_post_types_populate_field( $field ) { // reset choices $field[‘choices’] = array(); // Get post types $args = array( ‘public’ => true, ); $post_types = get_post_types( $args, ‘objects’ ); unset( $post_types[‘attachment’] ); foreach ( $post_types as $post_type ) { $value =…Continue reading
$u_time = get_the_time( ‘U’ ); $u_modified_time = get_the_modified_time( ‘U’ ); // Only display modified date if 24hrs have passed since the post was published. if ( $u_modified_time >= $u_time + 86400 ) { $updated_date = get_the_modified_time( ‘F jS, Y’ );…Continue reading
remove_action(‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’);Continue reading
/** * Hide shipping rates when free shipping is available. * Updated to support WooCommerce 2.6 Shipping Zones. * * @param array $rates Array of rates found for the package. * @return array */ function my_hide_shipping_when_free_is_available( $rates ) { $free…Continue reading
function change_lost_your_password ($text) { if ($text == ‘Lost your password?’){ $text = ‘Reset/Forgot Password?’; } return $text; } add_filter( ‘gettext’, ‘change_lost_your_password’ );Continue reading
add_filter( ‘graphql_connection_max_query_amount’, function ( int $max_amount, $source, array $args, $context, $info ) { // Bail if the fieldName isn’t avail if ( empty( $info->fieldName ) ) { return $max_amount; } // Bail if we’re not dealing with our target fieldName…Continue reading