- do_action("load-$pagenow");
- // Backwards compatibility with old load-page-new.php, load-page.php,
- // and load-categories.php actions.
- if ( $typenow == 'page' ) {
- if ( $pagenow == 'post-new.php' )
- do_action( 'load-page-new.php' );
- elseif ( $pagenow == 'post.php' )
- do_action( 'load-page.php' );
- } elseif ( $taxnow == 'category' && $pagenow == 'edit-tags.php' ) {
- do_action( 'load-categories.php' );
+ /**
+ * Fires before a particular screen is loaded.
+ *
+ * The load-* hook fires in a number of contexts. This hook is for core screens.
+ *
+ * The dynamic portion of the hook name, `$pagenow`, is a global variable
+ * referring to the filename of the current page, such as 'admin.php',
+ * 'post-new.php' etc. A complete hook for the latter would be
+ * 'load-post-new.php'.
+ *
+ * @since 2.1.0
+ */
+ do_action( 'load-' . $pagenow );
+
+ /*
+ * The following hooks are fired to ensure backward compatibility.
+ * In all other cases, 'load-' . $pagenow should be used instead.
+ */
+ if ( $typenow == 'page' ) {
+ if ( $pagenow == 'post-new.php' )
+ do_action( 'load-page-new.php' );
+ elseif ( $pagenow == 'post.php' )
+ do_action( 'load-page.php' );
+ } elseif ( $pagenow == 'edit-tags.php' ) {
+ if ( $taxnow == 'category' )
+ do_action( 'load-categories.php' );
+ elseif ( $taxnow == 'link_category' )
+ do_action( 'load-edit-link-categories.php' );