Support » Plugin: Redirect » Meta box doesn't display in custom post type editor

  • Resolved tailorvj



    I’ve been using simple redirect for page redirects in a site and would like to use it for custom post types as well. Redirect meta box doesn’t display in the custom post type post editor though. I went through your code and it seems like it should support custom post types as well as built-in post types, but it doesn’t seem to work with custom post types.

    I’m testing all kinds of options to realise why this doesn’t work.
    So far I suspect
    $this->postTypes = get_post_types();
    may return only built-in post types for some reason, could be because of lack of a specific entry in the post type itself, or
    function add_meta_boxes()
    in simple redirect may have some bug in it.

    I would appreciate it if you could please check this out.

    Kind regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • It’s $this->postTypes = get_post_types(); problem …
    It’s just firing to early (just as plugin is included).
    This should be hooked to some action (maybe ‘init’ or even later if posible – some plugins register post types later than init hook)

    Plugin Author willshouse


    hi @tailorvj,

    @barat is correct, it was attempting to get the post types way too soon. the plugin has now been updated and runs get_post_types() just before it is needed, after all custom post types have loaded. it should now work for you.

    thank you to both of you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Meta box doesn't display in custom post type editor’ is closed to new replies.