• Resolved Olivier

    (@eterneige)


    Hi, it’s me again πŸ™‚

    I’m looking for a ay to not display the settings postbox div on the edit form when the custom post type has no additional field…

    Can’t figure out where it is displayed… Found a template (post-meta.php)in Ultimate Fields, but it’s displayed within a higher level div container.

    Not sure whether it’s in UPT or in UF… :/

    https://wordpress.org/plugins/ultimate-post-types/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Radoslav Georgiev

    (@radogeorgiev)

    Hi again πŸ™‚

    It’s quite deeper than you most probably think, but basically the whole process starts in https://plugins.trac.wordpress.org/browser/ultimate-post-types/trunk/classes/UPT_Custom_Post_Type.php at line 206.

    The $meta array includes as sub-array of fields, which should be checked to see if it’s empty and is pretty a bug. Right now I don’t have the opportunity to fix it, but tomorrow I will add it either to the dev version or 0.4.

    Thread Starter Olivier

    (@eterneige)

    Well, I found the file where it happens :
    ultimate-post-types/classes/UPT_Custom_Post_Type.php

    I’ve added

    if ('fields' == $m->meta_key and 'a:0:{}' == $m->meta_value) {
        return;
    }

    between lines 213 and 214 (in the foreach loop).

    It does the job, even if I’m not sure it’s a good practice πŸ™‚

    Could you please include such a modification in the plugin ? My code or another way to handle this…

    Thanks !

    Thread Starter Olivier

    (@eterneige)

    Oh, you answered while I was writing…

    No matter when, it’s not a real problem : I just find it’s useless to display an empty box ^^

    Plugin Author Radoslav Georgiev

    (@radogeorgiev)

    I’m sorry I delayed things for a week, but I was packing for a full week of vacation πŸ™‚

    I fixed this and uploaded it to the trunk/development version. You can get it at https://wordpress.org/plugins/ultimate-post-types/developers/ , but it will be included in the next version too.

    Best Regards,
    Rado

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Hide settings box in Post Edit Form when no fields’ is closed to new replies.