-
Notifications
You must be signed in to change notification settings - Fork 903
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
Dramatically simplify the check whether we need to load scripts etc. #1871
Conversation
As a result, also load the admin class more exclusively.
* @param bool $form Whether or not the form start tag should be included. | ||
* @param string $option The long name of the option to use for the current page. | ||
* @param string $optionshort The short name of the option to use for the current page. | ||
* @param bool $contains_files Whether the form should allow for file uploads. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's up with the spacing ? Doc alignment check missing ?
…and understandable.
$GLOBALS['wpseo_taxonomy'] = new WPSEO_Taxonomy; | ||
} | ||
|
||
if ( in_array( $pagenow, array( 'admin.php' ) ) ) { | ||
// @todo [JRF => whomever] Can we load this more selectively ? like only when $_GET['page'] is one of ours ? | ||
if ( 'admin.php' === $pagenow && strpos( (string) filter_input( INPUT_GET, 'page' ), 'wpseo' ) === 0 ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately we've already run into the fact that the filter extension is not always enabled, so this code cannot be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. ^%$^$.
|
||
private function load_tour() { | ||
if ( isset( $_GET['wpseo_restart_tour'] ) ) { | ||
$options['ignore_tour'] = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->options[...]
Make `pagenow` a class var Remove a lot of GLOBALS usage as it's unneeded Make sure `wpseo_restart_tour` has a value as otherwise `filter_input` won't work on it.
…ectively Conflicts: admin/class-admin.php admin/class-config.php wp-seo-main.php
move filter_input function to wpseo_utils use validation emulation functions from that same class to truly mimic validate behaviour
Dramatically simplify the check whether we need to load scripts etc.
As a result, also load the admin class more exclusively.
@omarreiss please review.