Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Remco

    (@rembem)

    I am not so sure anymore about above statement.

    I investigated a bit more and think a lot of issues I was having had to do with the fact that the Tabify options screen did not know about other places (functions.php and other plugins) where metaboxes are removed and added.

    Because of how the transients are set used for the settings on the options page and post edit pages, things were continually buggy/shifting, depending on what was saved before (a post, or the options, or another posttype with the same taxonomy). Because my taxonomies are used by multiple posttypes, the behaviour was even more unpredictable. And worsened (maybe, seemingly sometimes) by Opcache, and maybe the set expiration time for these transients in the detection script.

    Then I found out there is the (more or less undocumented) action ‘tabify_add_meta_boxes’ with which you can let the Tabify Options screen know about added/removed metaboxes by plugins/own functions. I saw it used in features/plugin-support.php for support for other plugins.

    As soon as I implemented that in my functions.php for my functions that remove or add metaboxes, the behaviour of Tabify now seems mostly reliable and consistent on the Options screen as well as the post edit screens.

    add_action( 'tabify_add_meta_boxes', 'remove_or_add_metaboxes_function' );

    Same solution could be used for other plugins.

    So also: please don’t remove this action in coming updates.

    Thread Starter Remco

    (@rembem)

    One last remark, maybe useful for somebody else reading along.

    The above mentioned action ‘tabify_add_meta_boxes’ may not be necessary if you have functions that use the action ‘add_meta_boxes’ to add/remove metaboxes. Tabify Edit Screen already detects those.

    The only prerequisite for this to work is that the action needs a $post_type argument passed along, without it, is does not work for Tabify.
    Some functions running on ‘add_meta_boxes’ may easily be adapted to have/pass $post_type as argument, so that they will work with with Tabify.

    It might be an idea to mention this somewhere in the documentation.

    • This reply was modified 3 years, 7 months ago by Remco.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Still buggy transients with Custom Post Types and custom metaboxes’ is closed to new replies.