Enable Shortcode Execution in WPCode HTML Snippets
add_filter( ‘wpcode_snippet_output_html’, ‘do_shortcode’ );Continue reading
Join 2,000,000+ Professionals who use WPCode to Future-Proof Their Websites!
add_filter( ‘wpcode_snippet_output_html’, ‘do_shortcode’ );Continue reading
add_action( ‘woocommerce_cart_calculate_fees’,’dvsl_discounts’, 20, 1 ); function dvsl_discounts( $cart_object ) { if ( is_admin() && ! defined( ‘DOING_AJAX’ ) ) return; // Email Discount $emails = array(‘[email protected]’, ‘[email protected]’); //Specify the email addresses here if ( in_array( wp_get_current_user()->user_email, $emails ) ) {…Continue reading
add_filter( ‘aioseo_breadcrumbs_trail’, ‘homeshop_breadcrumbs_trail’ ); function homeshop_breadcrumbs_trail( $crumbs ) { foreach ( $crumbs as &$crumb ) { if ( ‘homePage’ === $crumb[‘type’] ) { $siteLink = wp_parse_url( $crumb[‘link’] ); $crumb[‘link’] = $siteLink[‘scheme’] . ‘://’ . $siteLink[‘host’] . ‘/shop-displays/’; } } return…Continue reading
.parallax { background-image: url(“http://example.com/wp-content/uploads/2017/08/my-background-image.jpg”); height: 100%; background-attachment: fixed; background-position: center; background-repeat: no-repeat; background-size: cover; margin-left:-410px; margin-right:-410px; } .parallax-content { width:50%; margin:0 auto; color:#FFF; padding-top:50px; }Continue reading
function adms_remove_wp_block_library_css(){ wp_dequeue_style( ‘wp-block-library’ ); wp_dequeue_style( ‘wp-block-library-theme’ ); wp_dequeue_style( ‘wc-blocks-style’ ); // Remove WooCommerce block CSS } add_action( ‘wp_print_styles’, ‘adms_remove_wp_block_library_css’, 100 );Continue reading
add_filter( ‘upload_mimes’, function( $mimes ) { $mimes[‘woff’] = ‘application/x-font-woff’; $mimes[‘woff2’] = ‘application/x-font-woff2’; $mimes[‘ttf’] = ‘application/x-font-ttf’; $mimes[‘svg’] = ‘image/svg+xml’; $mimes[‘eot’] = ‘application/vnd.ms-fontobject’; return $mimes; } );Continue reading
add_filter( ‘block_editor_settings_all’, function( $editor_settings ) { $css = wp_get_custom_css_post()->post_content; $editor_settings[‘styles’][] = array( ‘css’ => $css ); return $editor_settings; } );Continue reading
function register_review_list() { register_rest_route(‘review/v1’, ‘reviewList’, [ ‘methods’ => WP_REST_SERVER::READABLE, ‘callback’ => ‘review_list_results’ ]); } function review_list_results($data) { $results = []; // basic error handling if (false === isset($data[‘term’]) ) { return [ ‘error’ => ‘No soup for you…’ ]; }…Continue reading
class Post_Created_Sample_Trigger extends \Uncanny_Automator\Recipe\Trigger { protected function setup_trigger() { // Define the Trigger’s info $this->set_integration( ‘SAMPLE_INTEGRATION’ ); $this->set_trigger_code( ‘POST_CREATED_SAMPLE’ ); $this->set_trigger_meta( ‘POST_TYPE’ ); // Trigger sentence $this->set_sentence( sprintf( esc_attr__( ‘{{A post type:%1$s}} is created sample trigger’, ‘automator-sample’ ), ‘POST_TYPE’ )…Continue reading
/** * Allow SVG uploads for administrator users. * * @param array $upload_mimes Allowed mime types. * * @return mixed */ add_filter( ‘upload_mimes’, function ( $upload_mimes ) { // By default, only administrator users are allowed to add SVGs. //…Continue reading