Forbidden Error in ajax call with wordpress

Not sure why this error occur! you may follow this article Or you can review your code in following steps: Use wp_enqueue_scripts and wp_ajax_{action_name} wp_ajax_nopriv_{action_name} in your plugin file. Suppose my plugin name is test-plugin and my main plugin file name is test-plugin.php <?php /* Plugin Name: Test Plugin Plugin URI: http://wordpress.org Description: This just … Read more

Hook to execute after deleting a Custom Taxonomy

Changes argument numbers 2 to 4 as below add_action( ‘delete_product_category’, array ( $this , ‘term_delete_success’ ), 10, 4); Here is the reference function. You may find detail on wordpress codex More info do_action( “delete_{$taxonomy}”, int $term, int $tt_id, mixed $deleted_term, array $object_ids )

Determine if term is Category or Tag

Solution below 🙂 I when through how WordPress determines if the term is category or tag. I found that there is an attribute called ‘hierarchical’ – it went down the hill from there. I found a nice little function called is_taxonomy_hierarchical() and I fixed the issue with two if statements. if(is_taxonomy_hierarchical($taxonomy)) { if(isset($term[0]->name)) { if($term[0]->parent … Read more