3

Here's one way: You can look at has_shortcode() and find the parsing there: preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER ); using the get_shortcode_regex() function for the regex pattern. For non empty matches, you can then loop through them and collect the full shortcode matches with: $...


2

To change the functionality of a shortcode you must first remove_shortcode( 'shortcode_name' ); where shortcode name is the name of the shortcode. Add the shortcode back with your NEW function. A simple example to follow what you might be needing: remove_shortcode( 'mybutton' ); add_shortcode( 'mybutton', 'my_shortcode_function' ); ...


2

If you only need the Shortcodes without the attributes, you can use this function: function get_used_shortcodes( $content) { global $shortcode_tags; if ( false === strpos( $content, '[' ) ) { return array(); } if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) { return array(); } // Find all registered ...


1

The above solution doesn't work if you're using Advanced Custom Fields. When using ACF, the following code does work: remove_filter( 'the_content', 'wpautop' ); remove_filter( 'acf_the_content', 'wpautop' ); add_filter( 'the_content', 'wpautop' , 99); add_filter( 'acf_the_content', 'wpautop' , 100); add_filter( 'the_content', 'shortcode_unautop',110 ); ...


1

If you don't want to include posts in child categories, use the category__in parameter: $args = array( 'category__in' => [ get_cat_ID( $category_name ) ], // use category__in //'category_name' => $category_name, // and not this. 'post_type' => 'menu', 'numberposts' => -1, 'post_status' => 'publish' ); And although ...


1

In order to change the shortcode value by leveraging ajax, you need to modify the PHP code and jQuery as mentioned below: function table_generator() { // Set product providers $providers = array( 'Provider 1', 'Provider 2', 'Provider 3', ); // Build provider selection form $output .= '<form id="submitProvider" ...


1

Shortcode callbacks must return a string or nothing at all. They must not print anything directly, because that will create an immediate output as you have seen in your example. We have a few topics about that already. I took the liberty to reopen your question, because you said the other answers didn't really help you. :) Almost every function that prints ...


1

Try : add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { if(is_user_logged_in()){ unset($fields['billing']['billing_email']); } return $fields; } Source : https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/


Only top voted, non community-wiki answers of a minimum length are eligible