Make WordPress Core

Ticket #14083: alternatively - adding context to load-$pagenow hook.diff

File alternatively - adding context to load-$pagenow hook.diff, 859 bytes (added by simonwheatley, 14 years ago)

An alternative, as per JohnBillion's sugestions, which passes the type & taxonomy context as params rather than in the hook names

  • Users/simon/Projects/WordPress/site/wp-admin/admin.php

     
    199199
    200200        exit();
    201201} else {
    202         do_action("load-$pagenow");
     202        do_action("load-$pagenow", $typenow, $taxnow);
     203        // Backwards compatability with old load-page-new.php, load-page.php, 
     204        // and load-edit-categories.php actions.
     205        if ( $typenow == 'page' ) {
     206                if ( $pagenow == 'post-new.php' )
     207                do_action( 'load-page-new.php' );
     208                elseif ( $pagenow == 'post.php' )
     209                        do_action( 'load-page.php' );
     210        }
     211        if ( $taxnow == 'category' && $pagenow == 'edit-tags.php' )
     212                do_action( 'load-categories.php' );
    203213}
    204214
    205215if ( !empty($_REQUEST['action']) )