1

While checking my theme with theme-check plugin, i found few errors which are listed below along with the line of codes where it displays those errors(REQUIRED:) to be fixed.

REQUIRED: plugin-activation.php. Themes should use add_theme_page() for adding admin pages. Line 335: add_submenu_page(

add_submenu_page(
    $this->parent_menu_slug,                // Parent menu slug
    $this->strings['page_title'],           // Page title
    $this->strings['menu_title'],           // Menu title
    'edit_theme_options',                   // Capability
    $this->menu,                            // Menu slug
    array( &$this, 'install_plugins_page' ) // Callback
);

REQUIRED: panel_functions.php. Themes should use add_theme_page() for adding admin pages. Line 143: add_menu_page(theme_name.' Settings', theme_name ,'install_themes', 'panel' updated the list.

$icon = get_template_directory_uri().'/innovative_panel/images/ipanel-settings.png';
    add_menu_page(theme_name.' Settings', theme_name ,'install_themes', 'panel' , 'panel_options', $icon  );
    $theme_page = add_submenu_page('panel','Settings', theme_name.' Settings','install_themes', 'panel' , 'panel_options');
    add_submenu_page('panel',theme_name.' Documentation', 'Documentation','install_themes', 'docs' , 'redirect_docs');
    add_submenu_page('panel','Support', 'Support','install_themes', 'support' , 'innovative_get_support');

Also tell me whether my theme will be accepted by the reviewer with these errors?

Thanks in advance!

  • 1
    What is your question here? If it's "required" level issue then it likely won't be accepted, although it's better inquired with theme review team. – Rarst Dec 27 '13 at 13:25
  • I want to resolve these required errors – Furqan Mahmood Dec 27 '13 at 13:48
  • 1
    Change problematic function to recommended function? It seems to be pretty straightforward recommendation from check, please elaborate if it's not working for you and what are the issues. – Rarst Dec 27 '13 at 13:51
  • I have changed the function which theme check want but the menu is not visible in the dashobaor right bar, ifnact its dispayling the theme option panels menu inside the apperance as a sub-menu, but i want to display my theme options panel's menu as a main menu in the dashboar menu list in left sidebar . – Furqan Mahmood Dec 30 '13 at 6:59
1

Themes are required to use add_theme_page() in the Wordpress Theme Directory. You need:

add_theme_page(
    $this->strings['page_title'],           // Page title
    $this->strings['menu_title'],           // Menu title
    'edit_theme_options',                   // Capability
    $this->menu,                            // Menu slug
    array( &$this, 'install_plugins_page' ) // Callback
);

s

add_theme_page(theme_name.' Settings', theme_name ,'install_themes', 'panel' , 'panel_options');
$theme_page = add_theme_page('Settings', theme_name.' Settings','install_themes', 'panel' , 'panel_options');
add_theme_page(theme_name.' Documentation', 'Documentation','install_themes', 'docs' , 'redirect_docs');
add_theme_page('Support', 'Support','install_themes', 'support' , 'innovative_get_support');
  • Thank you hornj, I have implemented this thing already but the thing is that when we use add_theme+page then, these menus can only be visible as sub-menu of Appearance(In main menus list), while i want to display these theme options as a main menu like, settings, appearance etc. Please helo :) – Furqan Mahmood Dec 30 '13 at 7:04
  • Yes, but that doesn't meet the standards of the Wordpress Theme Review. make.wordpress.org/themes/guidelines/guidelines-theme-check – hornj Dec 30 '13 at 16:45
  • Thank you, it means i have to use add_theme_pae every where instead of add_submenu_page, Got ya man! – Furqan Mahmood Jan 1 '14 at 7:02
  • Hornj could you please help me to solve further more errors, heres the link please do me a favour. wordpress.stackexchange.com/questions/127644/… – Furqan Mahmood Jan 1 '14 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.