This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Deregister block styles | |
function yl_deregister_gutenberg_block_styles() { | |
wp_dequeue_style('wp-block-library'); | |
wp_deregister_style('wp-block-library'); | |
} | |
add_filter('use_block_editor_for_post', '__return_false', 10); | |
add_filter('use_block_editor_for_post_type', '__return_false', 10); | |
add_action('wp_print_styles', 'yl_deregister_gutenberg_block_styles', 100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove HTML filter for 'pre_term_description' | |
foreach ( array( 'pre_term_description' ) as $filter ) { | |
remove_filter( $filter, 'wp_filter_kses' ); | |
} | |
// Remove HTML filter for 'term_description' | |
foreach ( array( 'term_description' ) as $filter ) { | |
remove_filter( $filter, 'wp_kses_data' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcode for 'Blog name': [yl_blog_name] | |
function yl_blog_name_shortcode() { | |
return get_bloginfo('name'); | |
} | |
add_shortcode('yl_blog_name','yl_blog_name_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcode for 'Product category name' by 'Product category id': [yl_product_category_name cat_id=''] | |
function yl_product_category_name_shortcode( $atts ) { | |
$atts = shortcode_atts( array( | |
'cat_id' => '', | |
), $atts ); | |
if ($term = get_term_by( 'id', $atts['cat_id'], 'product_cat' ) ){ | |
return $term->name; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcode for 'Blog email': [yl_blog_email] | |
function yl_blog_email_shortcode() { | |
return get_bloginfo('admin_email'); | |
} | |
add_shortcode('yl_blog_email','yl_blog_email_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcode for 'Blog url': [yl_blog_url] | |
function yl_blog_url_shortcode() { | |
return get_bloginfo('url'); | |
} | |
add_shortcode('yl_blog_url','yl_blog_url_shortcode'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcode for 'Shop street': [yl_shop_address_street] | |
function yl_shop_address_street_shortcode() { | |
$address_street = get_option( 'woocommerce_store_address', '' ); | |
return apply_filters( 'woocommerce_countries_base_address', $address_street ); | |
} | |
add_shortcode( 'yl_shop_address_street', 'yl_shop_address_street_shortcode' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcode for 'Shop postal code': [yl_shop_address_postal_code] | |
function yl_shop_address_postal_code_shortcode() { | |
$address_postal_code = get_option( 'woocommerce_store_postcode', '' ); | |
return apply_filters( 'woocommerce_countries_base_address', $address_postal_code ); | |
} | |
add_shortcode( yl_shop_address_postal_code', 'yl_shop_address_postal_code_shortcode' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shortcode for 'Shop city': [yl_shop_address_city] | |
function yl_shop_address_city_shortcode() { | |
$address_city = get_option( 'woocommerce_store_city', '' ); | |
return apply_filters( 'woocommerce_countries_base_address', $address_city ); | |
} | |
add_shortcode( 'yl_shop_address_city', 'yl_shop_address_city_shortcode' ); |
OlderNewer