WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Simple Tags] Updating of tags count field on term_taxonomy table fails when update a page (8 posts)

  1. repley
    Member
    Posted 4 years ago #

    When update a page with some tags, for example tag1,tag2 and tag3 updating of count field on term_taxonomy table reset to 0 for tag1 tag2 and tag3.

    No call of _update_post_and_page_term_count() function.

    I have this problem on 3 web-sites based on wordpress 2.8.4

    http://wordpress.org/extend/plugins/simple-tags/

  2. repley
    Member
    Posted 4 years ago #

    fresh install of wordpress 2.8.4 and only simple-tags plugin and situation is the same. Can someone confirm this bug?

  3. repley
    Member
    Posted 4 years ago #

    fresh install of wordpress 2.7.1 and only simple-tags 1.6.6 plugin works good

  4. repley
    Member
    Posted 4 years ago #

    fresh install of wordpress 2.8 and only simple-tags 1.6.6 plugin and don't works :(

  5. repley
    Member
    Posted 4 years ago #

    wp2.8.4 with wp-includes/taxonomy.php file of wp2.7.1 + simpletags 1.6.6 works good

  6. repley
    Member
    Posted 4 years ago #

    commenting lines 17,21 and 22 of wp-includes/taxonomy.php solve the problem.

    original code (wp-includes/taxonomy.php):

    function create_initial_taxonomies() {
        register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
        register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'), 'query_var' => false, 'rewrite' => false) ) ;
        register_taxonomy( 'link_category', 'link', array('hierarchical' => false, 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
    }
    add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority

    modified code (wp-includes/taxonomy.php):

    //function create_initial_taxonomies() {
        register_taxonomy( 'category', 'post', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
        register_taxonomy( 'post_tag', 'post', array('hierarchical' => false, 'update_count_callback' => '_update_post_term_count', 'label' => __('Post Tags'), 'query_var' => false, 'rewrite' => false) ) ;
        register_taxonomy( 'link_category', 'link', array('hierarchical' => false, 'label' => __('Categories'), 'query_var' => false, 'rewrite' => false) ) ;
    //}
    //add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority
  7. repley
    Member
    Posted 4 years ago #

    ... or is better to change line 22 from:

    add_action( 'init', 'create_initial_taxonomies', 0 ); // highest priority

    to (like lines 534 of wp-settings.php):

    create_initial_taxonomies();

  8. repley
    Member
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic