Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • in reply to: Custom Form Processing #4190
    intersynergy
    Member

    This is my code.
    Submenu URL for piklist admin page is /wp-admin/my-settings

    add_action( 'admin_menu', __NAMESPACE__.'\\register_my_custom_menu_page', 10 );
    
    function register_my_custom_menu_page() {
    
    	add_menu_page( 'This is only a title of page', 'Title group', 'read', 'my-top-level-slug', __NAMESPACE__.'\\test', null, 6 );
        add_submenu_page( 'my-top-level-slug', 'This is only a title of submenu', 'Submenu', 'read', 'my-slug', __NAMESPACE__.'\\test2' );
    }
    
    function test() {
        echo '<h1>Header </h1>';
    }
    
    function test2() {
        echo '<h1>Podmenu</h1>';
    }
    
    add_filter('piklist_admin_pages', 'piklist_theme_setting_pages', 99);
    function piklist_theme_setting_pages($pages)
    {
        $pages[] = array(
          'page_title' => __('Piklist Settings', 'piklist')
          ,'menu_title' => __('Settings', 'piklist')
          ,'capability' => 'read' // allow users with the capability of read to VIEW this page.
          ,'sub_menu' => 'my-top-level-slug'
          ,'menu_slug' => 'my-settings'
          ,'setting' => 'custom_settings'
          ,'menu_icon' => plugins_url('piklist/parts/img/piklist-icon.png')
          ,'page_icon' => plugins_url('piklist/parts/img/piklist-page-icon-32.png')
          ,'default_tab' => 'General'
          ,'single_line' => false
          ,'save_text' => 'Save these settings'
        );
    
      return $pages;
    }
    in reply to: Custom Form Processing #4189
    intersynergy
    Member

    I have the same problem like @obisean.
    I think it could be a bug in piklist side.

Viewing 2 posts - 1 through 2 (of 2 total)