How to add a custom tag in contact form 7 and change the output in email?

In the first step, the form to display, you can keep what you have coded. Then you can do that to generate the result in the e-mail : add_filter(“wpcf7_posted_data”, function ($posted_data) { $result = “”; foreach ($posted_data[“tag”] as $index => $question) { $answer = $posted_data[“ans”][$index]; $result .= “$question : $answer\n”; } $posted_data[“my_questions”] = $result; return … Read more

How do I change the initial quantity of a product in woocommerce?

You can use the woocommerce_quantity_input_args filter: function wpse_292293_quantity_input_default( $args, $product ) { $args[‘input_value’] = 2; return $args; } add_filter( ‘woocommerce_quantity_input_args’, ‘wpse_292293_quantity_input_default’, 10, 2 ); When the quantity input is output, it’s output with the woocommerce_quantity_input() function. This function accepts several arguments including the default value for the input. This filter lets you replace values in … Read more

Add notification bubble notice in navigation using transients

Thanks again for the help @jdm2112. Updated a few syntax errors and used the same structure you suggested, works great! // Add notification bubble to custom post type menu nav add_action( ‘admin_menu’, ‘add_cpt_menu_bubble’ ); function add_cpt_menu_bubble() { global $menu; $count_posts = tms_count_pending_posts(); if ( $count_posts > 3 ) { foreach ( $menu as $key => … Read more

Get Objects While Deleting term

Use the pre_delete_term hook, which fires before the actual deleting occurs, so the relationships will still be present. function wpse_296972_pre_delete_term( $term_id, $taxonomy_name ) { if ( $taxonomy_name === ‘organization’ ) { $objects = get_objects_in_term( $term_id, $taxonomy ); // Do something with $objects. } } add_action( ‘pre_delete_term’, ‘wpse_296972_pre_delete_term’ );

wp_transition_post_status does not change the status of the post

This function contains do_action() calls for post status transition action hooks. The order of the words in the function name might be confusing – it does not change the status of posts, it only calls actions that can be hooked into by plugin developers. https://codex.wordpress.org/Function_Reference/wp_transition_post_status What you want is wp_update_post, you’re also using WP_Query incorrectly: … Read more

How to get color name in PanelColorSettings in custom Gutenberg block?

I could solve it with the function getColorObjectByColorValue (take a look at the gutenberg files). If you have something like const backgroundColors = [ { name: ‘Light Green’, slug: ‘light-green’, color: ‘#E6F0F0’ }, { name: ‘Light Gray’, slug: ‘light-gray’, color: ‘#F7F7F7’ } ]; then you can get the color name by const test = getColorObjectByColorValue(backgroundColors, … Read more

What allows a template file from plugin to be copied in child theme and overridden?

My first question is, what is the function or loader that makes this happen? And secondly, is this a global WordPress feature, or do plugin developers have to build this functionality into the plugin? It’s not a WordPress feature. Not exactly. Each plugin that does this has created their own function for loading template files … Read more