• Hello everyone.

    I have a plugin called “Basic Google Maps Placemark” installed, and it uses a custom taxonomy called bgmp-category. What am I trying to do now, is whenever the user creates a new Posts category, a new bgmp-category taxonomy is automatically created.

    This has done the job:

    add_action( 'created_category',			array( $this, 'autoAddCategory' ) );
    
    public function autoAddCategory($term, $taxonomy, $args = array()) {
    	$addedTerm = get_term($term, 'category');
    	return wp_insert_term($addedTerm->name, self::TAXONOMY, array('description' => $addedTerm->description, 'slug'=> $addedTerm->slug));
    }

    Unfortunately, now whenever I create a Posts category, the newly-created category does not show up on the list until I hit refresh, which means the AJAX somehow got interrupted because of my action hook.

    What should I do?

Viewing 1 replies (of 1 total)
  • Did you check the response coming back from the server when you create a post category? Can you paste it here (you can get it from the web inspector tool in Chrome or Firefox and looking at the Network tab when you create a category).

Viewing 1 replies (of 1 total)
  • The topic ‘Adding category – AJAX interrupted’ is closed to new replies.