[resolved] Meta box doesn't display in custom post type editor (3 posts)

  1. tailorvj
    Posted 2 years ago #


    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,


  2. barat
    Posted 2 years ago #

    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)

  3. willshouse
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Redirect
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic