~ubuntu-branches/debian/jessie/wordpress/jessie

« back to all changes in this revision

Viewing changes to wp-admin/includes/meta-boxes.php

  • Committer: Package Import Robot
  • Author(s): Craig Small
  • Date: 2014-04-17 20:56:19 UTC
  • mfrom: (1.2.35)
  • Revision ID: package-import@ubuntu.com-20140417205619-nurbet6eho4yvwfv
Tags: 3.9+dfsg-1
* New upstream release
* 3.9 seems to handle different locations for plugins so the
  plugin directory handling patches have been cut back.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
        $preview_button = __( 'Preview Changes' );
43
43
} else {
44
44
        $preview_link = set_url_scheme( get_permalink( $post->ID ) );
 
45
        /**
 
46
         * Filter the URI of a post preview in the post submit box.
 
47
         *
 
48
         * @since 2.0.5
 
49
         *
 
50
         * @param string $preview_link URI the user will be directed to for a post preview.
 
51
         */
45
52
        $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) );
46
53
        $preview_button = __( 'Preview' );
47
54
}
48
55
?>
49
 
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview"><?php echo $preview_button; ?></a>
 
56
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a>
50
57
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
51
58
</div>
52
59
<?php endif; // public post type ?>
79
86
?>
80
87
</span>
81
88
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
82
 
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js"><?php _e('Edit') ?></a>
 
89
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
83
90
 
84
91
<div id="post-status-select" class="hide-if-js">
85
92
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" />
125
132
 
126
133
echo esc_html( $visibility_trans ); ?></span>
127
134
<?php if ( $can_publish ) { ?>
128
 
<a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
 
135
<a href="#visibility" class="edit-visibility hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
129
136
 
130
137
<div id="post-visibility-select" class="hide-if-js">
131
138
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr($post->post_password); ?>" />
151
158
</div><!-- .misc-pub-section -->
152
159
 
153
160
<?php
154
 
// translators: Publish box date format, see http://php.net/date
 
161
/* translators: Publish box date format, see http://php.net/date */
155
162
$datef = __( 'M j, Y @ G:i' );
156
163
if ( 0 != $post->ID ) {
157
164
        if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
185
192
                printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
186
193
        }
187
194
?>
188
 
        <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><?php _ex( 'Browse', 'revisions' ); ?></a>
 
195
        <a class="hide-if-no-js" href="<?php echo esc_url( get_edit_post_link( $args['args']['revision_id'] ) ); ?>"><span aria-hidden="true"><?php _ex( 'Browse', 'revisions' ); ?></span> <span class="screen-reader-text"><?php _e( 'Browse revisions' ); ?></span></a>
189
196
</div>
190
197
<?php endif;
191
198
 
193
200
<div class="misc-pub-section curtime misc-pub-curtime">
194
201
        <span id="timestamp">
195
202
        <?php printf($stamp, $date); ?></span>
196
 
        <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Edit') ?></a>
 
203
        <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
197
204
        <div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'), 1); ?></div>
198
205
</div><?php // /misc-pub-section ?>
199
206
<?php endif; ?>
200
207
 
201
 
<?php do_action('post_submitbox_misc_actions'); ?>
 
208
<?php
 
209
/**
 
210
 * Fires after the post time/date setting in the Publish meta box.
 
211
 *
 
212
 * @since 2.9.0
 
213
 */
 
214
do_action( 'post_submitbox_misc_actions' );
 
215
?>
202
216
</div>
203
217
<div class="clear"></div>
204
218
</div>
205
219
 
206
220
<div id="major-publishing-actions">
207
 
<?php do_action('post_submitbox_start'); ?>
 
221
<?php
 
222
/**
 
223
 * Fires at the beginning of the publishing actions section of the Publish meta box.
 
224
 *
 
225
 * @since 2.7.0
 
226
 */
 
227
do_action( 'post_submitbox_start' );
 
228
?>
208
229
<div id="delete-action">
209
230
<?php
210
231
if ( current_user_can( "delete_post", $post->ID ) ) {
273
294
 
274
295
<div id="misc-publishing-actions">
275
296
        <?php
276
 
        // translators: Publish box date format, see http://php.net/date
 
297
        /* translators: Publish box date format, see http://php.net/date */
277
298
        $datef = __( 'M j, Y @ G:i' );
278
299
        $stamp = __('Uploaded on: <b>%1$s</b>');
279
300
        $date = date_i18n( $datef, strtotime( $post->post_date ) );
282
303
                <span id="timestamp"><?php printf($stamp, $date); ?></span>
283
304
        </div><!-- .misc-pub-section -->
284
305
 
285
 
        <?php do_action('attachment_submitbox_misc_actions'); ?>
 
306
        <?php
 
307
        /**
 
308
         * Fires after the 'Uploaded on' section of the Save meta box
 
309
         * in the attachment editing screen.
 
310
         *
 
311
         * @since 3.5.0
 
312
         */
 
313
        do_action( 'attachment_submitbox_misc_actions' );
 
314
        ?>
286
315
</div><!-- #misc-publishing-actions -->
287
316
<div class="clear"></div>
288
317
</div><!-- #minor-publishing -->
525
554
<p class="meta-options">
526
555
        <label for="comment_status" class="selectit"><input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> <?php _e( 'Allow comments.' ) ?></label><br />
527
556
        <label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php printf( __( 'Allow <a href="%s" target="_blank">trackbacks and pingbacks</a> on this page.' ), __( 'http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' ) ); ?></label>
528
 
        <?php do_action('post_comment_status_meta_box-options', $post); ?>
 
557
        <?php
 
558
        /**
 
559
         * Fires at the end of the Discussion meta box on the post editing screen.
 
560
         *
 
561
         * @since 3.1.0
 
562
         *
 
563
         * @param WP_Post $post WP_Post object of the current post.
 
564
         */
 
565
        do_action( 'post_comment_status_meta_box-options', $post );
 
566
        ?>
529
567
</p>
530
568
<?php
531
569
}
555
593
 
556
594
        wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
557
595
        ?>
558
 
        <p class="hide-if-no-js" id="add-new-comment"><a class="button" href="#commentstatusdiv" onclick="commentReply.addcomment(<?php echo $post->ID; ?>);return false;"><?php _e('Add comment'); ?></a></p>
 
596
        <p class="hide-if-no-js" id="add-new-comment"><a class="button" href="#commentstatusdiv" onclick="window.commentReply && commentReply.addcomment(<?php echo $post->ID; ?>);return false;"><?php _e('Add comment'); ?></a></p>
559
597
        <?php
560
598
 
561
599
        $total = get_comments( array( 'post_id' => $post->ID, 'number' => 1, 'count' => true ) );
588
626
 * @param object $post
589
627
 */
590
628
function post_slug_meta_box($post) {
 
629
/** This filter is documented in wp-admin/edit-tag-form.php */
591
630
?>
592
 
<label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( apply_filters('editable_slug', $post->post_name) ); ?>" />
 
631
<label class="screen-reader-text" for="post_name"><?php _e('Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo esc_attr( apply_filters( 'editable_slug', $post->post_name ) ); ?>" />
593
632
<?php
594
633
}
595
634
 
646
685
                        'echo'             => 0,
647
686
                );
648
687
 
 
688
                /**
 
689
                 * Filter the arguments used to generate a Pages drop-down element.
 
690
                 *
 
691
                 * @since 3.3.0
 
692
                 *
 
693
                 * @see wp_dropdown_pages()
 
694
                 *
 
695
                 * @param array   $dropdown_args Array of arguments used to generate the pages drop-down.
 
696
                 * @param WP_Post $post          The current WP_Post object.
 
697
                 */
649
698
                $dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
650
699
                $pages = wp_dropdown_pages( $dropdown_args );
651
700
                if ( ! empty($pages) ) {
656
705
<?php
657
706
                } // end empty pages check
658
707
        } // end hierarchical check.
659
 
        if ( 'page' == $post->post_type && 0 != count( get_page_templates() ) ) {
 
708
        if ( 'page' == $post->post_type && 0 != count( get_page_templates( $post ) ) ) {
660
709
                $template = !empty($post->page_template) ? $post->page_template : false;
661
710
                ?>
662
711
<p><strong><?php _e('Template') ?></strong></p>
710
759
</div>
711
760
 
712
761
<div id="major-publishing-actions">
713
 
<?php do_action('post_submitbox_start'); ?>
 
762
<?php
 
763
/** This action is documented in wp-admin/includes/meta-boxes.php */
 
764
do_action( 'post_submitbox_start' );
 
765
?>
714
766
<div id="delete-action">
715
767
<?php
716
768
if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
727
779
</div>
728
780
<div class="clear"></div>
729
781
</div>
730
 
<?php do_action('submitlink_box'); ?>
 
782
<?php
 
783
/**
 
784
 * Fires at the end of the Publish box in the Link editing screen.
 
785
 *
 
786
 * @since 2.5.0
 
787
 */
 
788
do_action( 'submitlink_box' );
 
789
?>
731
790
<div class="clear"></div>
732
791
</div>
733
792
<?php
841
900
 */
842
901
function link_xfn_meta_box($link) {
843
902
?>
844
 
<table class="links-table" cellspacing="0">
 
903
<table class="links-table">
845
904
        <tr>
846
905
                <th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('rel:') ?></label></th>
847
906
                <td><input type="text" name="link_rel" id="link_rel" value="<?php echo ( isset( $link->link_rel ) ? esc_attr($link->link_rel) : ''); ?>" /></td>
998
1057
        $thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true );
999
1058
        echo _wp_post_thumbnail_html( $thumbnail_id, $post->ID );
1000
1059
}
 
1060
 
 
1061
/**
 
1062
 * Display fields for ID3 data
 
1063
 *
 
1064
 * @since 3.9.0
 
1065
 *
 
1066
 * @param WP_Post $post
 
1067
 */
 
1068
function attachment_id3_data_meta_box( $post ) {
 
1069
        $meta = array();
 
1070
        if ( ! empty( $post->ID ) ) {
 
1071
                $meta = wp_get_attachment_metadata( $post->ID );
 
1072
        }
 
1073
 
 
1074
        foreach ( wp_get_attachment_id3_keys( $post, 'edit' ) as $key => $label ) : ?>
 
1075
        <p>
 
1076
                <label for="title"><?php echo $label ?></label><br />
 
1077
                <input type="text" name="id3_<?php echo esc_attr( $key ) ?>" id="id3_<?php echo esc_attr( $key ) ?>" class="large-text" value="<?php
 
1078
                        if ( ! empty( $meta[ $key ] ) ) {
 
1079
                                echo esc_attr( $meta[ $key ] );
 
1080
                        }
 
1081
                ?>" />
 
1082
        </p>
 
1083
        <?php
 
1084
        endforeach;
 
1085
}