Custom Fields
Re-Envisioned
Support Meta Box Builder Settings page not showing in top level, only as submenu

  • Creator
    Topic
  • #24400
    Resolved David Kraljic
    Participant

    Hi, We created a settings page. It does show up when set to display as a sub menu in the admin. But when we set it to display as a top level admin item it doesn't show. Here is a screenshot
    https://share.getcloudapp.com/YEuXpBEj

Viewing 10 replies - 1 through 10 (of 12 total)
  • Author
    Replies
  • #24402
    David Kraljic
    Participant

    We created a settings page via code (not UI controls). The settings page does show in the admin UI as expected. However, it doesn't show in the Metabox settings page list. Is there a way to have it appear there as well?

    #24404
    Long Nguyen
    Moderator

    Hi David,

    Please select a Style option Boxes or No Boxes then re-save the settings page to make it works. I'm going to discuss with the developer team to cover this case in the next update.

    #24405
    David Kraljic
    Participant

    Thanks. I just tried and it didn't make the page appear. https://share.getcloudapp.com/kpu75lAR

    #24418
    Long Nguyen
    Moderator

    Hi,

    Can you please click on "Get PHP code" and share the code here? I will check the code on my end.

    #24433
    David Kraljic
    Participant
    <?php
    add_filter( 'mb_settings_pages', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $settings_pages ) {
        $settings_pages[] = [
            'menu_title'    => __( 'Pencil 2', 'your-text-domain' ),
            'id'            => 'pencil-2',
            'option_name'   => 'Pencil2',
            'position'      => 90,
            'submenu_title' => 'test',
            'parent'        => 'options-general.php',
            'columns'       => 1,
            'help_tabs'     => __( 'Here is help content - where does it show up?', 'your-text-domain' ),
            'customizer'    => true,
            'icon_url'      => 'editor-paste-text',
        ];
    
    return $settings_pages;
    
    }
    #24434
    David Kraljic
    Participant

    Here is a fresh screenshot of the issue
    https://share.getcloudapp.com/xQunnDYn

    #24436
    David Kraljic
    Participant

    We created several test settings pages

    Pencil5 - shows on wp admin - not on customizer
    Well it does but only for a second, then disappears. I see CSS is set to display none.
    I created it purely through code (not through admin UI).
    https://inspiration.homecarestaged.wpengine.com/wp-admin/admin.php?page=edit-snippet&id=9
    Now we have to figure out why it disappears.

    Pencil2 - appears in customizer but not wpadmin
    It was created through the UI
    https://inspiration.homecarestaged.wpengine.com/wp-admin/post.php?post=554&action=edit

    What I want is for one of them to show up on both customizer and wpadmin
    Hmmm... now that I write this I wonder if this is even possible. Maybe it is one or the other?

    #24437
    David Kraljic
    Participant

    On pencil2 I just unchecked the show in customizer box to see if that would make it show in the wpadmin - it did not. I even reset the style to noboxes, resaved and still pencil2 doesn't appear in wpadmin

    #24438
    David Kraljic
    Participant

    Ok I found that pencil2 is showing in wpadmin under "settings" even though we have it set to be top level under "SEO" item. So it seems the "menu type" setting on metabox is being ignored.

    #24439
    David Kraljic
    Participant

    So the questions I need answered are:

    1. Why is pencil2 not respecting the show as top level menu setting so that it can show in the wpadmin top level

    2. Why is pencil5 not respecting the show in customizer setting and being hidden with display none in css?

Viewing 10 replies - 1 through 10 (of 12 total)
  • You must be logged in to reply to this topic.