Woocommerce: hide “Price display suffix” when the VAT is zero
Woocommerce: hide “Price display suffix” when the VAT is zero
Woocommerce: hide “Price display suffix” when the VAT is zero
Thanks for MVE, @helgatheviking! It was beneficial. When wp.data caches the resolvers, it also considers arguments. Here’s what happens when following the reproduction steps for the bug: Selecting the first product resolves data, creates a cache for getProduct(1), and sets a value for the product state. Selecting second does the same (cache: getProduct(2)) and sets … Read more
The issue with your code appears to be related to the hook wp_after_insert_post being nested within the publish_service action. This setup can lead to the wp_after_insert_post action being added multiple times, which may cause the repeated creation of products. Here are a few steps to resolve this issue: Separate the Actions: Instead of nesting wp_after_insert_post … Read more
After the advice from every awesome person who helped, I finally got it to work. I just had to define $the_content instead of trying to use the hook get_the_content() alone. Now it’s tagging everything perfectly. Here is the final code for anyone who wants to use it in the future. Or you can just download … Read more
You don’t need to use add_submenu_page() for custom post types and taxonomies, WordPress adds them to the menu automatically when you use the show_in_menu parameter.
get_meta_sql hook is not firing
try this: function add_taxonomy_to_upload_dir( $upload ) { if ( isset( $_REQUEST[‘post’] ) ) { // wp-json/wp/v2/media $post = get_post( $_REQUEST[‘post’] ); } elseif ( isset( $_REQUEST[‘post_id’] ) ) { // wp-admin/async-upload.php $post = get_post( $_REQUEST[‘post_id’] ); } else { return $upload; } if ( ! $post || empty( $post->ID ) ) { return $upload; } … Read more
As we know WooCommerce product reviews are essentially WordPress comments with a specific comment_type. Firstly we hook into the Comment Submission and then we will check If the Comment is a WooCommerce Product Review and then we trigger our Custom Action. Could you please try to add this to your theme’s functions.php or in your … Read more
In what way is the Tag Cloud block different? That block is a dynamic block, which uses a live rendering using ServerSideRender, and the documentation stated that “If you pass attributes to ServerSideRender, the block must also be registered and have its attributes defined in PHP“, therefore, custom attributes for the block must be defined … Read more
It looks like the issue is coming because of the conflict of the hooks (manage_media_columns and manage_{$screen->id}_columns) because when we manage_{$screen->id}_columns used for media it becomes manage_media_columns and started conflicting. The same details are mentioned in the documentation link of the hook. Link: https://developer.wordpress.org/reference/hooks/manage_screen-id_columns/#more-information