Make WordPress Core

Changeset 25819


Ignore:
Timestamp:
10/16/2013 10:58:21 PM (11 years ago)
Author:
DrewAPicture
Message:

Inline documentation for hooks in wp-admin/edit-form-advanced.php.

Props ericlewis.
Fixes #25434.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r25719 r25819  
    3333add_action( 'admin_footer', '_local_storage_notice' );
    3434
     35/*
     36 * @todo Document the $messages array(s).
     37 */
    3538$messages = array();
    3639$messages['post'] = array(
     
    6568$messages['attachment'] = array_fill( 1, 10, __( 'Media attachment updated.' ) ); // Hack, for now.
    6669
     70/**
     71 * Filter the post updated messages.
     72 *
     73 * @since 3.0.0
     74 *
     75 * @param array $messages Post updated messages. For defaults @see $messages declarations above.
     76 */
    6777$messages = apply_filters( 'post_updated_messages', $messages );
    6878
     
    173183    add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', null, 'normal', 'core');
    174184
    175 do_action('dbx_post_advanced', $post);
     185/**
     186 * Fires in the middle of built-in meta box registration.
     187 *
     188 * @since 2.1.0
     189 * @deprecated 3.7.0 Use 'add_meta_boxes' instead.
     190 *
     191 * @param WP_Post $post Post object.
     192 */
     193do_action( 'dbx_post_advanced', $post );
     194
    176195if ( post_type_supports($post_type, 'comments') )
    177196    add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', null, 'normal', 'core');
     
    188207}
    189208
    190 do_action('add_meta_boxes', $post_type, $post);
    191 do_action('add_meta_boxes_' . $post_type, $post);
    192 
    193 do_action('do_meta_boxes', $post_type, 'normal', $post);
    194 do_action('do_meta_boxes', $post_type, 'advanced', $post);
    195 do_action('do_meta_boxes', $post_type, 'side', $post);
     209/**
     210 * Fires after all built-in meta boxes have been added.
     211 *
     212 * @since 3.0.0
     213 *
     214 * @param string  $post_type Post type.
     215 * @param WP_Post $post      Post object.
     216 */
     217do_action( 'add_meta_boxes', $post_type, $post );
     218
     219/**
     220 * Fires after all built-in meta boxes have been added, contextually for the given post type.
     221 *
     222 * The dynamic portion of the hook, $post_type, refers to the post type of the post.
     223 *
     224 * @since 3.0.0
     225 *
     226 * @param WP_Post $post Post object.
     227 */
     228do_action( 'add_meta_boxes_' . $post_type, $post );
     229
     230/**
     231 * Fires after meta boxes have been added.
     232 *
     233 * Fires once for each of the default meta box contexts: normal, advanced, and side.
     234 *
     235 * @since 3.0.0
     236 *
     237 * @param string  $post_type Post type of the post.
     238 * @param string  $context   string  Meta box context.
     239 * @param WP_Post $post      Post object.
     240 */
     241do_action( 'do_meta_boxes', $post_type, 'normal', $post );
     242//duplicate_hook
     243do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
     244//duplicate_hook
     245do_action( 'do_meta_boxes', $post_type, 'side', $post );
    196246
    197247add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
     
    327377    </p>
    328378</div>
    329 
    330 <form name="post" action="post.php" method="post" id="post"<?php do_action('post_edit_form_tag', $post); ?>>
     379<?php
     380/**
     381 * Fires inside the post editor <form> tag.
     382 *
     383 * @since 3.0.0
     384 *
     385 * @param WP_Post $post Post object.
     386 */
     387?>
     388<form name="post" action="post.php" method="post" id="post"<?php do_action( 'post_edit_form_tag', $post ); ?>>
    331389<?php wp_nonce_field($nonce_action); ?>
    332390<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
     
    351409?>
    352410
    353 <?php do_action( 'edit_form_top', $post ); ?>
     411<?php
     412/**
     413 * Fires at the beginning of the edit form.
     414 *
     415 * At this point, the required hidden fields and nonces have already been output.
     416 *
     417 * @since 3.7.0
     418 *
     419 * @param WP_Post $post Post object.
     420 */
     421do_action( 'edit_form_top', $post ); ?>
    354422
    355423<div id="poststuff">
     
    360428<div id="titlediv">
    361429<div id="titlewrap">
     430    <?php
     431    /**
     432     * Filter the title field placeholder text.
     433     *
     434     * @since 3.1.0
     435     *
     436     * @param string  $text Placeholder text. Default 'Enter title here'.
     437     * @param WP_Post $post Post object.
     438     */
     439    ?>
    362440    <label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo apply_filters( 'enter_title_here', __( 'Enter title here' ), $post ); ?></label>
    363441    <input type="text" name="post_title" size="30" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
     
    390468<?php
    391469}
    392 
     470/**
     471 * Fires after the title field.
     472 *
     473 * @since 3.5.0
     474 *
     475 * @param WP_Post $post Post object.
     476 */
    393477do_action( 'edit_form_after_title', $post );
    394478
     
    421505</div>
    422506<?php }
    423 
     507/**
     508 * Fires after the content editor.
     509 *
     510 * @since 3.5.0
     511 *
     512 * @param WP_Post $post Post object.
     513 */
    424514do_action( 'edit_form_after_editor', $post );
    425515?>
     
    429519<?php
    430520
    431 if ( 'page' == $post_type )
    432     do_action('submitpage_box', $post);
    433 else
    434     do_action('submitpost_box', $post);
     521if ( 'page' == $post_type ) {
     522    /**
     523     * Fires before meta boxes with 'side' context are output for the 'page' post type.
     524     *
     525     * The submitpage box is a meta box with 'side' context, so this hook fires just before it is output.
     526     *
     527     * @since 2.5.0
     528     *
     529     * @param WP_Post $post Post object.
     530     */
     531    do_action( 'submitpage_box', $post );
     532}
     533else {
     534    /**
     535     * Fires before meta boxes with 'side' context are output for all post types other than 'page'.
     536     *
     537     * The submitpost box is a meta box with 'side' context, so this hook fires just before it is output.
     538     *
     539     * @since 2.5.0
     540     *
     541     * @param WP_Post $post Post object.
     542     */
     543    do_action( 'submitpost_box', $post );
     544}
     545
    435546
    436547do_meta_boxes($post_type, 'side', $post);
     
    443554do_meta_boxes(null, 'normal', $post);
    444555
    445 if ( 'page' == $post_type )
    446     do_action('edit_page_form', $post);
    447 else
    448     do_action('edit_form_advanced', $post);
     556if ( 'page' == $post_type ) {
     557    /**
     558     * Fires after 'normal' context meta boxes have been output for the 'page' post type.
     559     *
     560     * @since 1.5.2
     561     *
     562     * @param WP_Post $post Post object.
     563     */
     564    do_action( 'edit_page_form', $post );
     565}
     566else {
     567    /**
     568     * Fires after 'normal' context meta boxes have been output for all post types other than 'page'.
     569     *
     570     * @since 1.5.2
     571     *
     572     * @param WP_Post $post Post object.
     573     */
     574    do_action( 'edit_form_advanced', $post );
     575}
     576
    449577
    450578do_meta_boxes(null, 'advanced', $post);
     
    453581</div>
    454582<?php
    455 
    456 do_action('dbx_post_sidebar', $post);
     583/**
     584 * Fires after all meta box sections have been output, before the closing #post-body div.
     585 *
     586 * @since 2.1.0
     587 *
     588 * @param WP_Post $post Post object.
     589 */
     590do_action( 'dbx_post_sidebar', $post );
    457591
    458592?>
Note: See TracChangeset for help on using the changeset viewer.