Make WordPress Core

Ticket #33625: template_action.diff

File template_action.diff, 979 bytes (added by sgrant, 10 years ago)

Action instead of filter

  • src/wp-admin/includes/meta-boxes.php

     
    789789        if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) && get_option( 'page_for_posts' ) != $post->ID ) {
    790790                $template = !empty($post->page_template) ? $post->page_template : false;
    791791                ?>
    792 <p><strong><?php _e('Template') ?></strong></p>
     792<p><strong><?php _e('Template') ?></strong><?php
     793                /**
     794                 * Perform actions immediately after displaying the post editor Template metabox label.
     795                 *
     796                 * @since 4.4.0
     797                 *
     798                 * @param string $template The template used for the current post.
     799                 */
     800                do_action( 'meta_box_template_action', $template );
     801?></p>
    793802<label class="screen-reader-text" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
    794803<?php
    795804/**