-
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
Changes from 2 commits
fa5d3e1
51b9bb1
d290048
ce80fac
5cbae57
1e2c626
7231e55
3e394ff
e91f06b
32a6f38
2c93cde
960d7dd
883ef0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
} | ||
|
||
/** | ||
* @internal Nobody should be able to overrule the real version number as this can cause serious issues | ||
* @note Nobody should be able to overrule the real version number as this can cause serious issues | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @internal is a PHPDoc tag, @note is not. @internal is used to indicate the info is for developers only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately, PHPStorm strikes through the used constant or function if an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds like a bug in PHPStorm and should be fixed there, not in our code. @maartenba might be able to clarify. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, @internal means nobody outside the project or module should call this function. You can disable this inspection which was added in 8.0 (https://youtrack.jetbrains.com/issue/WI-22284) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maartenba Thanks for your feedback.
Not just that according to the docs:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, added it to the issue. Feel free to +1 there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maartenba Done ;-) |
||
* with the options, so no if ( ! defined() ) | ||
*/ | ||
define( 'WPSEO_VERSION', '1.7.1' ); | ||
|
@@ -375,12 +375,11 @@ function wpseo_admin_init() { | |
} | ||
} | ||
|
||
if ( in_array( $pagenow, array( 'edit-tags.php' ) ) ) { | ||
if ( $pagenow === 'edit-tags.php' ) { | ||
$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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Ah right. ^%$^$. |
||
$GLOBALS['wpseo_admin_pages'] = new WPSEO_Admin_Pages; | ||
|
||
$GLOBALS['WPSEO_i18n'] = register_i18n_promo_class(); | ||
|
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 ?