tinymce custom button
Changed get_stylesheet_directory_uri() to get_stylesheet_directory(), and it works.
Changed get_stylesheet_directory_uri() to get_stylesheet_directory(), and it works.
Ajax callback and shortcode functionality
Per Ashish’s answer that’s been posted, below is the update code for clarification with the correct answer by switching add_to_cart_url() to get_permalink(): global $product, $post; $hasCustomization = get_post_meta( $post -> ID, ‘_wcm_custom_design_checkbox’, true ); if ( $hasCustomization == ‘on’ ) { echo apply_filters( ‘woocommerce_loop_add_to_cart_link’, sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/237352/%s” rel=”nofollow” data-product_id=”https://wordpress.stackexchange.com/questions/237352/%s” data-product_sku=”https://wordpress.stackexchange.com/questions/237352/%s” class=”add_to_cart %s product_type_%s”>%s</a>’, esc_url( $product … Read more
Maybe you should read this. It explains how to achieve what you are looking for. Be aware of wp_is_mobile() function if you are using any cache system, it would result in some unexpected behavior.
The whole point of esc_attr is to encode special characters to avoid confusion later on. So if you have double quotes, yes they will be changed into ". If you don’t want that, don’t use esc_attr. If you insist on using esc_attr but don’t like what it does, you’ll have to undo it after you … Read more
Do embed shortcode on wordpress ajax request
Custom meta box in editor of custom post type not working
There are two workaround options I’ve found: Workaround 1: You can use an indiscriminate number of non-breaking spaces where you would like a line break. So to imitate this: [shortcode paraA1=’789′ paraB1=’987′ paraA2=’890′ paraB2=’098′ paraA3=’901′ paraB3=’109′ ] You can enter: [shortcode paraA1=’789′ paraB1=’987′ paraA2=’890′ paraB2=’098′ paraA3=’901′ paraB3=’109′ ] The WordPress text editor will wrap the … Read more
First create the meta box with a simple input value to insert the text you want. Here is a good example. Then you take the input from the meta box and create a function to store it as a shortcode. Check out the Shortcode API to enable the shortcode. Something like this should do the … Read more
you may just check source where this shortcode is being extracted and there you can write some custom code to get first of current month and use that instead of extracted variable of shortcode.