Forums

How to add a submenu to a previusly created menu page? (1 post)

  1. jullymac
    Member
    Posted 4 months ago #

    I'm building a plugin that creates a new menu page. This plugin has an extension that I'd like to add new submenu to the menu created in the first plugin.

    Menu Page (fist plugin):

    add_action('admin_menu', 'dadosimob_menu');
    function dadosimob_menu(){
        add_menu_page('Dados Gerais', 'Imobiliaria', 10, 'dados-imobiliaria', 'dadosimob_admin');
    }

    Trying to add the submenu (extension plugin):

    add_action('admin_menu', 'bl_menu');
    function bl_menu(){
        add_submenu_page('dados-imobiliaria', 'Busca Livre', 'Busca Livre', 10, 'busca-livre', 'bl_admin');
    }

    This is definitely not working, can someone help me with that?
    Thanks

Reply

You must log in to post.

About this Topic