Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author jayarjo

    (@jayarjo)

    And how do you create those custom taxonomies, via a plugin of some kind or by hand? Post more details as this might matter.

    Thread Starter Vitzkrieg

    (@vitzkrieg)

    I am creating them by hand.

    Plugin Author jayarjo

    (@jayarjo)

    It is strange. I can’t repeat it here. Can I look at your installation where the problem occurs?

    It happened to me too. I have solved it by registering custom taxonomies earlier:

    previously I used:
    add_action( ‘init’, ‘create_taxonomy_short_course_type’ );

    now I use:
    add_action( ‘after_setup_theme’, ‘create_taxonomy_short_course_type’ );

    Hopefully, it helps.

    Thread Starter Vitzkrieg

    (@vitzkrieg)

    Plugin Author jayarjo

    (@jayarjo)

    Hm… I see now how this problem might occur. Vitzkrieg, at what hook do you register your custom taxonomies?

    Plugin Author jayarjo

    (@jayarjo)

    Should be fixed now in 1.2.2.

    Thread Starter Vitzkrieg

    (@vitzkrieg)

    I register my custom taxonomies with the ‘init’ hook. It’s what every piece of sample code that I have seen uses.

    Still not working. It looks like you changed the hook to ‘after_theme_setup’ which still fires too early.

    If this plugin is only for the admin side of the site, I would recommend changing the hook to ‘admin_init’ because it happens later in the sequence of hooks and is generally recommended for admin plugins.

    Vitzkrieg, it is just the opposite – you need to register the taxonomy as early as possible so that the plugin could take it into account when its hooks are applied.

    Maybe, jayarjo changed hooks in 1.2.2 – I have not tried that.

    But for the version 1.2, you can easily work around the problem by registering your taxonomy in ‘after_setup_theme’ hook (as I proposed above), which is the earliest possible in a theme. It works and does not break anything. So no reason to stick to the ‘init’ hook.

    Plugin Author jayarjo

    (@jayarjo)

    Hm… crap.

    after_setup_theme used to fire after init, no? But then in fact I do not get what was your problem in first place, since the stuff happened on init in previous version.

    jayarjo, I had the same problem as Vitzkrieg (in ‘init’). But I solved it with moving taxonomy registration to ‘after_setup_theme’. And I proposed this solution also to Vitzkrieg (my first post). Unfortunately, he did not get it.

    Btw. I have just tried order of hooks in debugger and no, after_setup_theme comes before init. At least in WordPress 3.6.1

    Thread Starter Vitzkrieg

    (@vitzkrieg)

    My custom taxonomies are part of a plugin, not a theme. The editor wasn’t showing on my custom taxonomies, only the default WP posts and pages.

    My thought would be since this plugin relies on taxonomies to be registered before it runs, it should run as far down the hook order as reasonably possible to ensure all taxonomies are registered, which I think was probably intended.

    The hook order can be found here:
    https://codex.www.ads-software.com/Plugin_API/Action_Reference

    Plugin Author jayarjo

    (@jayarjo)

    wp_loaded seems like a decent candidate.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Not Showing in WP 3.5.2 Custom Taxonomies’ is closed to new replies.