Make WordPress Core

Ticket #14083: typenow-taxnow-actions.diff

File typenow-taxnow-actions.diff, 1.0 KB (added by simonwheatley, 14 years ago)

Amended paths within diff as per Scribu's recommendations (thanks)

  • wp-admin/admin.php

     
    200200        exit();
    201201} else {
    202202        do_action("load-$pagenow");
     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' );
     213        // Dynamically constructed hooks for specific custom post types and custom taxonomies
     214        if ( $typenow )
     215                do_action("load-$pagenow-type-$typenow");
     216        if ( $taxnow )
     217                do_action("load-$pagenow-tax-$taxnow");
     218        if ( $typenow && $taxnow )
     219                do_action("load-$pagenow-type-$typenow-tax-$taxnow");
     220       
    203221}
    204222
    205223if ( !empty($_REQUEST['action']) )
    206224        do_action('admin_action_' . $_REQUEST['action']);
    207 
     225               
    208226?>