skip to Main Content

WordPress – When using a hook, records are duplicated

I use a hook edit_post_(post_type). After updating a record, I get two new records at once when I only need one. What am I doing wrong? add_action('edit_post_applications', 'add_new_university'); function add_new_university($id) { $post_field = get_fields($id); return wp_insert_post(array( 'post_type' => 'institution', 'post_title'…

VIEW QUESTION

WordPress – Add shortcode below short description only for WooCommerce products having a specific tag

I found a code that can add a shortcode below the short description of a WooCommerce product: add_filter('woocommerce_short_description','ts_add_text_short_descr'); function ts_add_text_short_descr($description){ $text = do_shortcode('[my-shortcode]'); return $description . $text; } Then I tried to add that shortcode to the short description, only…

VIEW QUESTION
Back To Top
Search