// This code snippets replaced the ‘Add Title’ placeholder text with ‘Add new vendor’ // This is only applied to posts within the ‘vendor’ custom post type. function wpb_change_title_text( $title ){ $screen = get_current_screen(); if ( ‘vendor’ == $screen->post_type )…Continue reading
// Return a 404 page for author pages if accessed directly. add_action( ‘template_redirect’, function () { if ( is_author() ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } ); // Remove the author links. add_filter( ‘author_link’, ‘__return_empty_string’, 1000…Continue reading
add_action( ‘after_setup_theme’, function() { remove_theme_support( ‘core-block-patterns’ ); });Continue reading
add_filter( ‘allowed_block_types_all’, function ( $allowed_block_types, $block_editor_context ) { // List here the blocks you want to disallow. https://developer.wordpress.org/block-editor/reference-guides/core-blocks/ $disallowed_blocks = array( ‘core/navigation’, ‘core/query’, ); if ( ! is_array( $allowed_block_types ) || empty( $allowed_block_types ) ) { $registered_blocks = WP_Block_Type_Registry::get_instance()->get_all_registered(); $allowed_block_types…Continue reading
// You can also use this snippet as a shortcode for more control. global $post; if ( ! is_home() ) { echo ‘ ‘; echo ‘Home / ‘; if ( is_category() || is_single() ) { the_category( ‘ / ‘ );…Continue reading
add_filter( ‘user_has_cap’, function ( $allcaps, $caps, $args, $user ) { if ( in_array( ‘contributor’, $user->roles ) && empty( $caps[‘upload_files’] ) ) { $allcaps[‘upload_files’] = true; } return $allcaps; }, 10, 4 );Continue reading
// This code snippet is intended to populate the vendor credits from the ACF ‘Vendor Management’ // field group and display the values in a list format on the frontend. // // Applies to Post Categories below: // – Real…Continue reading
/** * Ensures that a Statement Descriptor is not sent to the Stripe PaymentIntent creation process. * * This is a HOTFIX and is not intended for long-term use. We recommend updating to Easy Digital Downloads 3.2.8+ * * This…Continue reading
add_filter( ‘render_block_tasty-roundups/item’, function ( $block ) { $initial_block = $block; $block = preg_replace( ‘~Continue reading
/** * Add a custom product data tab */ add_filter( ‘woocommerce_product_tabs’, ‘woo_new_product_tab’ ); function woo_new_product_tab( $tabs ) { // Adds the new tab $tabs[‘test_tab’] = array( ‘title’ => __( ‘Shipping Info’, ‘woocommerce’ ), ‘priority’ => 50, ‘callback’ => ‘woo_new_product_tab_content’ );…Continue reading