Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQUIRED: Themes should use add_theme_page() for adding admin pages. #65

Closed
dovy opened this issue Jun 11, 2015 · 7 comments

Comments

@dovy
Copy link

commented Jun 11, 2015

If a class, namely Redux, possesses the ability to add_menu_page, but it is not used as a developer for .org, does it have to be flagged? I'd like this not to fail the forthcoming theme-check errors. ;)

@dovy

This comment has been minimized.

Copy link
Author

commented Jun 11, 2015

Makes me want to use #62, hah.

@Otto42

This comment has been minimized.

Copy link
Member

commented Jun 12, 2015

I don't understand. Using add_theme_page is allowed.

@dovy

This comment has been minimized.

Copy link
Author

commented Jun 12, 2015

I meant add_menu_page. ;)

@dovy

This comment has been minimized.

Copy link
Author

commented Jun 12, 2015

Namely, with Redux you can make your own menu items or place under an existing item. WP.org users are instructed not to use the add_menu_page function as it's not permitted. Theme Check still flags it. :(

@Otto42

This comment has been minimized.

Copy link
Member

commented Jun 12, 2015

That's a question for the theme review team. Theme-check cannot tell context or whether code is used or not. It doesn't run the code, it just reads it.

@justintadlock

This comment has been minimized.

Copy link

commented Jun 14, 2015

The reason for this check is that themes were adding menus all over the place in the admin. If you can imagine it, it was happening. This check makes sense because it fixes what was a widespread issue.

I imagine that you'd need to find an alternative solution to present to TRT that handles the primary issue but allows your code to go through.

Just thinking ahead: The response you get might be something along the lines of themes shouldn't include unused code. As I'm not really familiar with Redux, is it possible to separate this in some fashion for theme/plugin authors?

Off the top of my head, allow plugin devs to do something like:

function pluginname_config_settings_page() {

    add_menu_page(
        $page_title,
        $menu_title,
        $capability,
        $menu_slug,
        'redux_callback_for_settings_page'
    );
}

It might be a bit more complex than that; I don't know. Just throwing one idea out there.

@Otto42

This comment has been minimized.

Copy link
Member

commented Jul 4, 2015

At this time, the TRT disallows use of add_*_page other than add_theme_page, to keep theme admin pages in the Appearance menu. If this changes in the future, then we can reconsider altering this check.

@Otto42 Otto42 closed this Jul 4, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.