Coding Standards: Upgrade WPCS to 1.0.0

WPCS 1.0.0 includes a bunch of new auto-fixers, which drops the number of coding standards issues across WordPress significantly. Prior to running the auto-fixers, there were 15,312 issues detected. With this commit, we now drop to 4,769 issues.

This change includes three notable additions:
- Multiline function calls must now put each parameter on a new line.
- Auto-formatting files is now part of the `grunt precommit` script. 
- Auto-fixable coding standards issues will now cause Travis failures.

Fixes #44600.


Built from https://develop.svn.wordpress.org/trunk@43571


git-svn-id: http://core.svn.wordpress.org/trunk@43400 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2018-08-17 01:51:36 +00:00
parent 8142df82bc
commit 56c162fbc9
359 changed files with 5715 additions and 4599 deletions

View File

@ -74,7 +74,8 @@ if ( get_option( 'db_upgraded' ) ) {
if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int) ( $c / 50 ) ) == 1 ) ) {
require_once( ABSPATH . WPINC . '/http.php' );
$response = wp_remote_get(
admin_url( 'upgrade.php?step=1' ), array(
admin_url( 'upgrade.php?step=1' ),
array(
'timeout' => 120,
'httpversion' => '1.1',
)

View File

@ -63,7 +63,8 @@ if ( isset( $_REQUEST['attachment_id'] ) && ( $id = intval( $_REQUEST['attachmen
case 2:
add_filter( 'attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2 );
echo get_media_item(
$id, array(
$id,
array(
'send' => false,
'delete' => true,
)

View File

@ -115,8 +115,8 @@ switch ( $action ) {
<h1><?php echo esc_html( $title ); ?></h1>
<?php
switch ( $action ) {
<?php
switch ( $action ) {
case 'spam':
$caution_msg = __( 'You are about to mark the following comment as spam:' );
$button = _x( 'Mark as Spam', 'comment' );
@ -133,9 +133,9 @@ switch ( $action ) {
$caution_msg = __( 'You are about to approve the following comment:' );
$button = __( 'Approve Comment' );
break;
}
}
if ( $comment->comment_approved != '0' ) { // if not unapproved
if ( $comment->comment_approved != '0' ) { // if not unapproved
$message = '';
switch ( $comment->comment_approved ) {
case '1':
@ -151,8 +151,8 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
if ( $message ) {
echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';
}
}
?>
}
?>
<div id="message" class="notice notice-warning"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php echo $caution_msg; ?></p></div>
<table class="form-table comment-ays">
@ -160,13 +160,13 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
<th scope="row"><?php _e( 'Author' ); ?></th>
<td><?php comment_author( $comment ); ?></td>
</tr>
<?php if ( get_comment_author_email( $comment ) ) { ?>
<?php if ( get_comment_author_email( $comment ) ) { ?>
<tr>
<th scope="row"><?php _e( 'Email' ); ?></th>
<td><?php comment_author_email( $comment ); ?></td>
</tr>
<?php } ?>
<?php if ( get_comment_author_url( $comment ) ) { ?>
<?php if ( get_comment_author_url( $comment ) ) { ?>
<tr>
<th scope="row"><?php _e( 'URL' ); ?></th>
<td><a href="<?php comment_author_url( $comment ); ?>"><?php comment_author_url( $comment ); ?></a></td>
@ -290,7 +290,8 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
array(
'trashed' => '1',
'ids' => $comment_id,
), $redir
),
$redir
);
break;
case 'untrashcomment':
@ -303,7 +304,8 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
array(
'spammed' => '1',
'ids' => $comment_id,
), $redir
),
$redir
);
break;
case 'unspamcomment':

View File

@ -221,11 +221,11 @@ class Custom_Background {
* @since 3.0.0
*/
public function admin_page() {
?>
?>
<div class="wrap" id="custom-background">
<h1><?php _e( 'Custom Background' ); ?></h1>
<?php if ( current_user_can( 'customize' ) ) { ?>
<?php if ( current_user_can( 'customize' ) ) { ?>
<div class="notice notice-info hide-if-no-customize">
<p>
<?php
@ -236,13 +236,13 @@ class Custom_Background {
?>
</p>
</div>
<?php } ?>
<?php } ?>
<?php if ( ! empty( $this->updated ) ) { ?>
<?php if ( ! empty( $this->updated ) ) { ?>
<div id="message" class="updated">
<p><?php printf( __( 'Background updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
</div>
<?php } ?>
<?php } ?>
<h3><?php _e( 'Background Image' ); ?></h3>
@ -287,34 +287,34 @@ class Custom_Background {
</td>
</tr>
<?php if ( get_background_image() ) : ?>
<?php if ( get_background_image() ) : ?>
<tr>
<th scope="row"><?php _e( 'Remove Image' ); ?></th>
<td>
<form method="post">
<?php wp_nonce_field( 'custom-background-remove', '_wpnonce-custom-background-remove' ); ?>
<?php submit_button( __( 'Remove Background Image' ), '', 'remove-background', false ); ?><br/>
<?php _e( 'This will remove the background image. You will not be able to restore any customizations.' ); ?>
<?php wp_nonce_field( 'custom-background-remove', '_wpnonce-custom-background-remove' ); ?>
<?php submit_button( __( 'Remove Background Image' ), '', 'remove-background', false ); ?><br/>
<?php _e( 'This will remove the background image. You will not be able to restore any customizations.' ); ?>
</form>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?>
<?php if ( $default_image && get_background_image() != $default_image ) : ?>
<?php $default_image = get_theme_support( 'custom-background', 'default-image' ); ?>
<?php if ( $default_image && get_background_image() != $default_image ) : ?>
<tr>
<th scope="row"><?php _e( 'Restore Original Image' ); ?></th>
<td>
<form method="post">
<?php wp_nonce_field( 'custom-background-reset', '_wpnonce-custom-background-reset' ); ?>
<?php submit_button( __( 'Restore Original Image' ), '', 'reset-background', false ); ?><br/>
<?php _e( 'This will restore the original background image. You will not be able to restore any customizations.' ); ?>
<?php wp_nonce_field( 'custom-background-reset', '_wpnonce-custom-background-reset' ); ?>
<?php submit_button( __( 'Restore Original Image' ), '', 'reset-background', false ); ?><br/>
<?php _e( 'This will restore the original background image. You will not be able to restore any customizations.' ); ?>
</form>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php if ( current_user_can( 'upload_files' ) ) : ?>
<?php if ( current_user_can( 'upload_files' ) ) : ?>
<tr>
<th scope="row"><?php _e( 'Select Image' ); ?></th>
<td><form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post">
@ -334,7 +334,7 @@ class Custom_Background {
</form>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
</tbody>
</table>
@ -342,17 +342,17 @@ class Custom_Background {
<form method="post">
<table class="form-table">
<tbody>
<?php if ( get_background_image() ) : ?>
<?php if ( get_background_image() ) : ?>
<input name="background-preset" type="hidden" value="custom">
<?php
$background_position = sprintf(
<?php
$background_position = sprintf(
'%s %s',
get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ),
get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) )
);
);
$background_position_options = array(
$background_position_options = array(
array(
'left top' => array(
'label' => __( 'Top Left' ),
@ -395,13 +395,13 @@ $background_position_options = array(
'icon' => 'dashicons dashicons-arrow-right-alt',
),
),
);
?>
);
?>
<tr>
<th scope="row"><?php _e( 'Image Position' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Image Position' ); ?></span></legend>
<div class="background-position-control">
<?php foreach ( $background_position_options as $group ) : ?>
<?php foreach ( $background_position_options as $group ) : ?>
<div class="button-group">
<?php foreach ( $group as $value => $input ) : ?>
<label>
@ -446,24 +446,24 @@ $background_position_options = array(
<tr>
<th scope="row"><?php _e( 'Background Color' ); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
<?php
$default_color = '';
if ( current_theme_supports( 'custom-background', 'default-color' ) ) {
<?php
$default_color = '';
if ( current_theme_supports( 'custom-background', 'default-color' ) ) {
$default_color = ' data-default-color="#' . esc_attr( get_theme_support( 'custom-background', 'default-color' ) ) . '"';
}
?>
}
?>
<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr( get_background_color() ); ?>"<?php echo $default_color; ?>>
</fieldset></td>
</tr>
</tbody>
</table>
<?php wp_nonce_field( 'custom-background' ); ?>
<?php submit_button( null, 'primary', 'save-background-options' ); ?>
<?php wp_nonce_field( 'custom-background' ); ?>
<?php submit_button( null, 'primary', 'save-background-options' ); ?>
</form>
</div>
<?php
<?php
}
/**
@ -581,7 +581,8 @@ if ( current_theme_supports( 'custom-background', 'default-color' ) ) {
/** This filter is documented in wp-admin/includes/media.php */
$sizes = array_keys(
apply_filters(
'image_size_names_choose', array(
'image_size_names_choose',
array(
'thumbnail' => __( 'Thumbnail' ),
'medium' => __( 'Medium' ),
'large' => __( 'Large' ),

View File

@ -380,7 +380,7 @@ class Custom_Image_Header {
});
})(jQuery);
</script>
<?php
<?php
}
/**
@ -454,7 +454,7 @@ class Custom_Image_Header {
});
});
</script>
<?php
<?php
}
/**
@ -464,12 +464,12 @@ class Custom_Image_Header {
*/
public function step_1() {
$this->process_default_headers();
?>
?>
<div class="wrap">
<h1><?php _e( 'Custom Header' ); ?></h1>
<?php if ( current_user_can( 'customize' ) ) { ?>
<?php if ( current_user_can( 'customize' ) ) { ?>
<div class="notice notice-info hide-if-no-customize">
<p>
<?php
@ -480,20 +480,20 @@ class Custom_Image_Header {
?>
</p>
</div>
<?php } ?>
<?php } ?>
<?php if ( ! empty( $this->updated ) ) { ?>
<?php if ( ! empty( $this->updated ) ) { ?>
<div id="message" class="updated">
<p><?php printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), home_url( '/' ) ); ?></p>
</div>
<?php } ?>
<?php } ?>
<h3><?php _e( 'Header Image' ); ?></h3>
<table class="form-table">
<tbody>
<?php if ( get_custom_header() || display_header_text() ) : ?>
<?php if ( get_custom_header() || display_header_text() ) : ?>
<tr>
<th scope="row"><?php _e( 'Preview' ); ?></th>
<td>
@ -531,9 +531,9 @@ class Custom_Image_Header {
<?php } ?>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php if ( current_user_can( 'upload_files' ) && current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<?php if ( current_user_can( 'upload_files' ) && current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<tr>
<th scope="row"><?php _e( 'Select Image' ); ?></th>
<td>
@ -607,7 +607,8 @@ class Custom_Image_Header {
'page' => 'custom-header',
'step' => 2,
'_wpnonce-custom-header-upload' => wp_create_nonce( 'custom-header-upload' ),
), admin_url( 'themes.php' )
),
admin_url( 'themes.php' )
)
);
?>
@ -621,12 +622,12 @@ class Custom_Image_Header {
</form>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
</tbody>
</table>
<form method="post" action="<?php echo esc_url( add_query_arg( 'step', 1 ) ); ?>">
<?php submit_button( null, 'screen-reader-text', 'save-header-options', false ); ?>
<?php submit_button( null, 'screen-reader-text', 'save-header-options', false ); ?>
<table class="form-table">
<tbody>
<?php if ( get_uploaded_header_images() ) : ?>
@ -646,11 +647,11 @@ if ( ! empty( $this->default_headers ) ) :
<tr>
<th scope="row"><?php _e( 'Default Images' ); ?></th>
<td>
<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<?php if ( current_theme_supports( 'custom-header', 'uploads' ) ) : ?>
<p><?php _e( 'If you don&lsquo;t want to upload your own image, you can use one of these cool headers, or show a random one.' ); ?></p>
<?php else : ?>
<?php else : ?>
<p><?php _e( 'You can use one of these cool headers or show a random one on each page.' ); ?></p>
<?php endif; ?>
<?php endif; ?>
<?php
$this->show_header_selector( 'default' );
?>
@ -684,7 +685,7 @@ if ( $default_image && get_header_image() != $default_image ) :
</tbody>
</table>
<?php if ( current_theme_supports( 'custom-header', 'header-text' ) ) : ?>
<?php if ( current_theme_supports( 'custom-header', 'header-text' ) ) : ?>
<h3><?php _e( 'Header Text' ); ?></h3>
@ -729,24 +730,24 @@ if ( $default_image && get_header_image() != $default_image ) :
</tr>
</tbody>
</table>
<?php
<?php
endif;
/**
/**
* Fires just before the submit button in the custom header options form.
*
* @since 3.1.0
*/
do_action( 'custom_header_options' );
do_action( 'custom_header_options' );
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
?>
<?php submit_button( null, 'primary', 'save-header-options' ); ?>
<?php submit_button( null, 'primary', 'save-header-options' ); ?>
</form>
</div>
<?php
<?php
}
/**

View File

@ -394,7 +394,8 @@ do_action( 'do_meta_boxes', $post_type, 'advanced', $post );
do_action( 'do_meta_boxes', $post_type, 'side', $post );
add_screen_option(
'layout_columns', array(
'layout_columns',
array(
'max' => 2,
'default' => 2,
)
@ -586,7 +587,7 @@ $referer = wp_get_referer();
<input type="hidden" id="referredby" name="referredby" value="<?php echo $referer ? esc_url( $referer ) : ''; ?>" />
<?php if ( ! empty( $active_post_lock ) ) { ?>
<input type="hidden" id="active_post_lock" value="<?php echo esc_attr( implode( ':', $active_post_lock ) ); ?>" />
<?php
<?php
}
if ( 'draft' != get_post_status( $post ) ) {
wp_original_referer_field( true, 'previous' );
@ -632,19 +633,19 @@ do_action( 'edit_form_top', $post );
<label class="screen-reader-text" id="title-prompt-text" for="title"><?php echo $title_placeholder; ?></label>
<input type="text" name="post_title" size="30" value="<?php echo esc_attr( $post->post_title ); ?>" id="title" spellcheck="true" autocomplete="off" />
</div>
<?php
/**
<?php
/**
* Fires before the permalink field in the edit form.
*
* @since 4.1.0
*
* @param WP_Post $post Post object.
*/
do_action( 'edit_form_before_permalink', $post );
?>
do_action( 'edit_form_before_permalink', $post );
?>
<div class="inside">
<?php
if ( $viewable ) :
<?php
if ( $viewable ) :
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : '';
// As of 4.4, the Get Shortlink button is hidden by default.
@ -669,13 +670,13 @@ if ( $viewable ) :
<?php
}
endif;
?>
?>
</div>
<?php
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
?>
<?php
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
?>
</div><!-- /titlediv -->
<?php
<?php
}
/**
* Fires after the title field.
@ -691,12 +692,14 @@ if ( post_type_supports( $post_type, 'editor' ) ) {
if ( $_wp_editor_expand ) {
$_wp_editor_expand_class = ' wp-editor-expand';
}
?>
?>
<div id="postdivrich" class="postarea<?php echo $_wp_editor_expand_class; ?>">
<?php
wp_editor(
$post->post_content, 'content', array(
<?php
wp_editor(
$post->post_content,
'content',
array(
'_content_editor_dfw' => $_content_editor_dfw,
'drag_drop_upload' => true,
'tabfocus_elements' => 'content-html,save-post',
@ -708,14 +711,14 @@ wp_editor(
'wp_keep_scroll_position' => ! $is_IE,
),
)
);
?>
);
?>
<table id="post-status-info"><tbody><tr>
<td id="wp-word-count" class="hide-if-no-js"><?php printf( __( 'Word count: %s' ), '<span class="word-count">0</span>' ); ?></td>
<td class="autosave-info">
<span class="autosave-message">&nbsp;</span>
<?php
if ( 'auto-draft' != $post->post_status ) {
<?php
if ( 'auto-draft' != $post->post_status ) {
echo '<span id="last-edit">';
if ( $last_user = get_userdata( get_post_meta( $post_ID, '_edit_last', true ) ) ) {
/* translators: 1: Name of most recent post author, 2: Post edited date, 3: Post edited time */
@ -725,14 +728,14 @@ if ( 'auto-draft' != $post->post_status ) {
printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
}
echo '</span>';
}
}
?>
</td>
<td id="content-resize-handle" class="hide-if-no-js"><br /></td>
</tr></tbody></table>
</div>
<?php
<?php
}
/**
* Fires after the content editor.

View File

@ -26,7 +26,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<?php
if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_ID > 0 ) :
$comment_link = get_comment_link( $comment );
?>
?>
<div class="inside">
<div id="comment-link-box">
<strong><?php _ex( 'Permalink:', 'comment' ); ?></strong>
@ -72,7 +72,9 @@ if ( 'approved' === wp_get_comment_status( $comment ) && $comment->comment_post_
echo '<label for="content" class="screen-reader-text">' . __( 'Comment' ) . '</label>';
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
wp_editor(
$comment->comment_content, 'content', array(
$comment->comment_content,
'content',
array(
'media_buttons' => false,
'tinymce' => false,
'quicktags' => $quicktags_settings,
@ -156,7 +158,7 @@ if ( $comment->comment_parent ) :
);
?>
</div>
<?php
<?php
endif;
endif;
?>
@ -226,5 +228,5 @@ $referer = wp_get_referer();
<script type="text/javascript">
try{document.post.name.focus();}catch(e){}
</script>
<?php
<?php
endif;

View File

@ -51,7 +51,8 @@ do_action( 'do_meta_boxes', 'link', 'advanced', $link );
do_action( 'do_meta_boxes', 'link', 'side', $link );
add_screen_option(
'layout_columns', array(
'layout_columns',
array(
'max' => 2,
'default' => 2,
)
@ -153,7 +154,7 @@ do_meta_boxes( null, 'advanced', $link );
<?php
if ( $link_id ) :
?>
?>
<input type="hidden" name="action" value="save" />
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id; ?>" />

View File

@ -284,5 +284,5 @@ do_action( "{$taxonomy}_edit_form", $tag, $taxonomy );
<script type="text/javascript">
try{document.forms.edittag.name.focus();}catch(e){}
</script>
<?php
<?php
endif;

View File

@ -55,7 +55,8 @@ if ( 'post' != $post_type ) {
}
add_screen_option(
'per_page', array(
'per_page',
array(
'default' => 20,
'option' => 'edit_' . $tax->name . '_per_page',
)
@ -95,7 +96,8 @@ switch ( $wp_list_table->current_action() ) {
array(
'error' => true,
'message' => 4,
), $referer
),
$referer
);
}
@ -187,7 +189,8 @@ switch ( $wp_list_table->current_action() ) {
array(
'error' => true,
'message' => 5,
), $referer
),
$referer
);
}
break;
@ -337,8 +340,8 @@ if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
<?php if ( $message ) : ?>
<div id="message" class="<?php echo $class; ?> notice is-dismissible"><p><?php echo $message; ?></p></div>
<?php
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );
<?php
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'message', 'error' ), $_SERVER['REQUEST_URI'] );
endif;
?>
<div id="ajax-response"></div>
@ -401,41 +404,41 @@ if ( current_user_can( $tax->cap->edit_terms ) ) {
* @param string $taxonomy The taxonomy slug.
*/
do_action( "{$taxonomy}_pre_add_form", $taxonomy );
?>
?>
<div class="form-wrap">
<h2><?php echo $tax->labels->add_new_item; ?></h2>
<form id="addtag" method="post" action="edit-tags.php" class="validate"
<?php
/**
<?php
/**
* Fires inside the Add Tag form tag.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* @since 3.7.0
*/
do_action( "{$taxonomy}_term_new_form_tag" );
?>
do_action( "{$taxonomy}_term_new_form_tag" );
?>
>
<input type="hidden" name="action" value="add-tag" />
<input type="hidden" name="screen" value="<?php echo esc_attr( $current_screen->id ); ?>" />
<input type="hidden" name="taxonomy" value="<?php echo esc_attr( $taxonomy ); ?>" />
<input type="hidden" name="post_type" value="<?php echo esc_attr( $post_type ); ?>" />
<?php wp_nonce_field( 'add-tag', '_wpnonce_add-tag' ); ?>
<?php wp_nonce_field( 'add-tag', '_wpnonce_add-tag' ); ?>
<div class="form-field form-required term-name-wrap">
<label for="tag-name"><?php _ex( 'Name', 'term name' ); ?></label>
<input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
<p><?php _e( 'The name is how it appears on your site.' ); ?></p>
</div>
<?php if ( ! global_terms_enabled() ) : ?>
<?php if ( ! global_terms_enabled() ) : ?>
<div class="form-field term-slug-wrap">
<label for="tag-slug"><?php _e( 'Slug' ); ?></label>
<input name="slug" id="tag-slug" type="text" value="" size="40" />
<p><?php _e( 'The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); ?></p>
</div>
<?php endif; // global_terms_enabled() ?>
<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
<?php if ( is_taxonomy_hierarchical( $taxonomy ) ) : ?>
<div class="form-field term-parent-wrap">
<label for="parent"><?php echo esc_html( $tax->labels->parent_item ); ?></label>
<?php
@ -480,15 +483,15 @@ do_action( "{$taxonomy}_term_new_form_tag" );
<p><?php _e( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); ?></p>
<?php endif; ?>
</div>
<?php endif; // is_taxonomy_hierarchical() ?>
<?php endif; // is_taxonomy_hierarchical() ?>
<div class="form-field term-description-wrap">
<label for="tag-description"><?php _e( 'Description' ); ?></label>
<textarea name="description" id="tag-description" rows="5" cols="40"></textarea>
<p><?php _e( 'The description is not prominent by default; however, some themes may show it.' ); ?></p>
</div>
<?php
if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
<?php
if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
/**
* Fires after the Add Tag form fields for non-hierarchical taxonomies.
*
@ -497,9 +500,9 @@ if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
* @param string $taxonomy The taxonomy slug.
*/
do_action( 'add_tag_form_fields', $taxonomy );
}
}
/**
/**
* Fires after the Add Term form fields.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
@ -508,11 +511,11 @@ if ( ! is_taxonomy_hierarchical( $taxonomy ) ) {
*
* @param string $taxonomy The taxonomy slug.
*/
do_action( "{$taxonomy}_add_form_fields", $taxonomy );
do_action( "{$taxonomy}_add_form_fields", $taxonomy );
submit_button( $tax->labels->add_new_item );
submit_button( $tax->labels->add_new_item );
if ( 'category' == $taxonomy ) {
if ( 'category' == $taxonomy ) {
/**
* Fires at the end of the Edit Category form.
*
@ -522,7 +525,7 @@ if ( 'category' == $taxonomy ) {
* @param object $arg Optional arguments cast to an object.
*/
do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
} elseif ( 'link_category' == $taxonomy ) {
} elseif ( 'link_category' == $taxonomy ) {
/**
* Fires at the end of the Edit Link form.
*
@ -532,7 +535,7 @@ if ( 'category' == $taxonomy ) {
* @param object $arg Optional arguments cast to an object.
*/
do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
} else {
} else {
/**
* Fires at the end of the Add Tag form.
*
@ -542,9 +545,9 @@ if ( 'category' == $taxonomy ) {
* @param string $taxonomy The taxonomy slug.
*/
do_action( 'add_tag_form', $taxonomy );
}
}
/**
/**
* Fires at the end of the Add Term form for all taxonomies.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
@ -553,8 +556,8 @@ if ( 'category' == $taxonomy ) {
*
* @param string $taxonomy The taxonomy slug.
*/
do_action( "{$taxonomy}_add_form", $taxonomy );
?>
do_action( "{$taxonomy}_add_form", $taxonomy );
?>
</form></div>
<?php } ?>
@ -587,15 +590,15 @@ do_action( "{$taxonomy}_add_form", $taxonomy );
);
?>
</p>
<?php if ( current_user_can( 'import' ) ) : ?>
<?php if ( current_user_can( 'import' ) ) : ?>
<p><?php printf( __( 'Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.' ), esc_url( $import_link ) ); ?></p>
<?php endif; ?>
<?php endif; ?>
</div>
<?php elseif ( 'post_tag' == $taxonomy && current_user_can( 'import' ) ) : ?>
<div class="form-wrap edit-term-notes">
<p><?php printf( __( 'Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>.' ), esc_url( $import_link ) ); ?></p>
</div>
<?php
<?php
endif;
/**
@ -620,7 +623,7 @@ do_action( "after-{$taxonomy}-table", $taxonomy );
<script type="text/javascript">
try{document.forms.addtag['tag-name'].focus();}catch(e){}
</script>
<?php
<?php
endif;
$wp_list_table->inline_edit();

View File

@ -127,7 +127,8 @@ if ( $doaction ) {
'trashed' => $trashed,
'ids' => join( ',', $post_ids ),
'locked' => $locked,
), $sendback
),
$sendback
);
break;
case 'untrash':
@ -290,7 +291,8 @@ get_current_screen()->set_screen_reader_content(
);
add_screen_option(
'per_page', array(
'per_page',
array(
'default' => 20,
'option' => 'edit_' . $post_type . '_per_page',
)

View File

@ -23,7 +23,7 @@ $title = __( 'Export' );
* @since 3.5.0
*/
function export_add_js() {
?>
?>
<script type="text/javascript">
jQuery(document).ready(function($){
var form = $('#export-filters'),
@ -39,7 +39,7 @@ function export_add_js() {
});
});
</script>
<?php
<?php
}
add_action( 'admin_head', 'export_add_js' );
@ -144,7 +144,8 @@ function export_date_options( $post_type = 'post' ) {
FROM $wpdb->posts
WHERE post_type = %s AND post_status != 'auto-draft'
ORDER BY post_date DESC
", $post_type
",
$post_type
)
);
@ -280,9 +281,10 @@ foreach ( get_post_types(
array(
'_builtin' => false,
'can_export' => true,
), 'objects'
),
'objects'
) as $post_type ) :
?>
?>
<p><label><input type="radio" name="content" value="<?php echo esc_attr( $post_type->name ); ?>" /> <?php echo esc_html( $post_type->label ); ?></label></p>
<?php endforeach; ?>

View File

@ -96,7 +96,7 @@ if ( empty( $importers ) ) {
echo '<p>' . __( 'No importers are available.' ) . '</p>'; // TODO: make more helpful
} else {
uasort( $importers, '_usort_by_first_member' );
?>
?>
<table class="widefat importers striped">
<?php
@ -119,8 +119,10 @@ if ( empty( $importers ) ) {
'action' => 'activate',
'plugin' => $plugin_file,
'from' => 'import',
), admin_url( 'plugins.php' )
), 'activate-plugin_' . $plugin_file
),
admin_url( 'plugins.php' )
),
'activate-plugin_' . $plugin_file
);
$action = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
@ -142,8 +144,10 @@ if ( empty( $importers ) ) {
'action' => 'install-plugin',
'plugin' => $plugin_slug,
'from' => 'import',
), self_admin_url( 'update.php' )
), 'install-plugin_' . $plugin_slug
),
self_admin_url( 'update.php' )
),
'install-plugin_' . $plugin_slug
);
$action = sprintf(
'<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%3$s" aria-label="%4$s">%5$s</a>',
@ -166,7 +170,8 @@ if ( empty( $importers ) ) {
$url = add_query_arg(
array(
'import' => $importer_id,
), self_admin_url( 'admin.php' )
),
self_admin_url( 'admin.php' )
);
$action = sprintf(
'<a href="%1$s" aria-label="%2$s">%3$s</a>',
@ -188,7 +193,8 @@ if ( empty( $importers ) ) {
'TB_iframe' => 'true',
'width' => 600,
'height' => 550,
), network_admin_url( 'plugin-install.php' )
),
network_admin_url( 'plugin-install.php' )
);
$action .= sprintf(
' | <a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">%3$s</a>',
@ -212,7 +218,7 @@ if ( empty( $importers ) ) {
}
?>
</table>
<?php
<?php
}
if ( current_user_can( 'install_plugins' ) ) {

View File

@ -514,7 +514,8 @@ function _wp_ajax_add_hierarchical_term() {
ob_start();
wp_terms_checklist(
0, array(
0,
array(
'taxonomy' => $taxonomy->name,
'descendants_and_self' => $cat_id,
'selected_cats' => $checked_categories,
@ -547,7 +548,8 @@ function _wp_ajax_add_hierarchical_term() {
ob_start();
wp_terms_checklist(
0, array(
0,
array(
'taxonomy' => $taxonomy->name,
'descendants_and_self' => $term_id,
'selected_cats' => $checked_categories,
@ -998,7 +1000,8 @@ function wp_ajax_get_tagcloud() {
}
$tags = get_terms(
$taxonomy, array(
$taxonomy,
array(
'number' => 45,
'orderby' => 'count',
'order' => 'DESC',
@ -1020,7 +1023,8 @@ function wp_ajax_get_tagcloud() {
// We need raw tag names here, so don't filter the output
$return = wp_generate_tag_cloud(
$tags, array(
$tags,
array(
'filter' => 0,
'format' => 'list',
)
@ -1460,7 +1464,8 @@ function wp_ajax_add_meta() {
'meta_key' => $key,
'meta_value' => $value,
'meta_id' => $mid,
), $c
),
$c
),
'position' => 0,
'supplemental' => array( 'postid' => $meta->post_id ),
@ -1625,7 +1630,8 @@ function wp_ajax_menu_get_metabox() {
$item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
ob_start();
call_user_func_array(
$callback, array(
$callback,
array(
null,
array(
'id' => 'add-' . $item->name,
@ -3166,7 +3172,8 @@ function wp_ajax_query_themes() {
}
$args = wp_parse_args(
wp_unslash( $_REQUEST['request'] ), array(
wp_unslash( $_REQUEST['request'] ),
array(
'per_page' => 20,
'fields' => $theme_field_defaults,
)
@ -3196,7 +3203,8 @@ function wp_ajax_query_themes() {
array(
'theme' => $theme->slug,
'_wpnonce' => wp_create_nonce( 'install-theme_' . $theme->slug ),
), $update_php
),
$update_php
);
if ( current_user_can( 'switch_themes' ) ) {
@ -3206,7 +3214,8 @@ function wp_ajax_query_themes() {
'action' => 'enable',
'_wpnonce' => wp_create_nonce( 'enable-theme_' . $theme->slug ),
'theme' => $theme->slug,
), network_admin_url( 'themes.php' )
),
network_admin_url( 'themes.php' )
);
} else {
$theme->activate_url = add_query_arg(
@ -3214,7 +3223,8 @@ function wp_ajax_query_themes() {
'action' => 'activate',
'_wpnonce' => wp_create_nonce( 'switch-theme_' . $theme->slug ),
'stylesheet' => $theme->slug,
), admin_url( 'themes.php' )
),
admin_url( 'themes.php' )
);
}
}
@ -3223,7 +3233,8 @@ function wp_ajax_query_themes() {
$theme->customize_url = add_query_arg(
array(
'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),
), wp_customize_url( $theme->slug )
),
wp_customize_url( $theme->slug )
);
}
@ -3666,7 +3677,8 @@ function wp_ajax_install_theme() {
include_once( ABSPATH . 'wp-admin/includes/theme.php' );
$api = themes_api(
'theme_information', array(
'theme_information',
array(
'slug' => $slug,
'fields' => array( 'sections' => false ),
)
@ -3719,7 +3731,8 @@ function wp_ajax_install_theme() {
'action' => 'enable',
'_wpnonce' => wp_create_nonce( 'enable-theme_' . $slug ),
'theme' => $slug,
), network_admin_url( 'themes.php' )
),
network_admin_url( 'themes.php' )
);
} else {
$status['activateUrl'] = add_query_arg(
@ -3727,7 +3740,8 @@ function wp_ajax_install_theme() {
'action' => 'activate',
'_wpnonce' => wp_create_nonce( 'switch-theme_' . $slug ),
'stylesheet' => $slug,
), admin_url( 'themes.php' )
),
admin_url( 'themes.php' )
);
}
}
@ -3736,7 +3750,8 @@ function wp_ajax_install_theme() {
$status['customizeUrl'] = add_query_arg(
array(
'return' => urlencode( network_admin_url( 'theme-install.php', 'relative' ) ),
), wp_customize_url( $slug )
),
wp_customize_url( $slug )
);
}
@ -3950,7 +3965,8 @@ function wp_ajax_install_plugin() {
include_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
$api = plugins_api(
'plugin_information', array(
'plugin_information',
array(
'slug' => sanitize_key( wp_unslash( $_POST['slug'] ) ),
'fields' => array(
'sections' => false,
@ -4010,7 +4026,8 @@ function wp_ajax_install_plugin() {
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $install_status['file'] ),
'action' => 'activate',
'plugin' => $install_status['file'],
), $plugins_url
),
$plugins_url
);
}
@ -4220,7 +4237,8 @@ function wp_ajax_search_plugins() {
/** @var WP_Plugins_List_Table $wp_list_table */
$wp_list_table = _get_list_table(
'WP_Plugins_List_Table', array(
'WP_Plugins_List_Table',
array(
'screen' => get_current_screen(),
)
);
@ -4235,11 +4253,13 @@ function wp_ajax_search_plugins() {
// Set the correct requester, so pagination works.
$_SERVER['REQUEST_URI'] = add_query_arg(
array_diff_key(
$_POST, array(
$_POST,
array(
'_ajax_nonce' => null,
'action' => null,
)
), network_admin_url( 'plugins.php', 'relative' )
),
network_admin_url( 'plugins.php', 'relative' )
);
$GLOBALS['s'] = wp_unslash( $_POST['s'] );
@ -4269,7 +4289,8 @@ function wp_ajax_search_install_plugins() {
/** @var WP_Plugin_Install_List_Table $wp_list_table */
$wp_list_table = _get_list_table(
'WP_Plugin_Install_List_Table', array(
'WP_Plugin_Install_List_Table',
array(
'screen' => get_current_screen(),
)
);
@ -4284,11 +4305,13 @@ function wp_ajax_search_install_plugins() {
// Set the correct requester, so pagination works.
$_SERVER['REQUEST_URI'] = add_query_arg(
array_diff_key(
$_POST, array(
$_POST,
array(
'_ajax_nonce' => null,
'action' => null,
)
), network_admin_url( 'plugin-install.php', 'relative' )
),
network_admin_url( 'plugin-install.php', 'relative' )
);
$wp_list_table->prepare_items();

View File

@ -83,7 +83,8 @@ class Automatic_Upgrader_Skin extends WP_Upgrader_Skin {
// Only allow basic HTML in the messages, as it'll be used in emails/logs rather than direct browser output.
$string = wp_kses(
$string, array(
$string,
array(
'a' => array(
'href' => true,
),

View File

@ -180,7 +180,9 @@ class Core_Upgrader extends WP_Upgrader {
$original_result = $result;
$result = new WP_Error(
'rollback_was_required', $this->strings['rollback_was_required'], (object) array(
'rollback_was_required',
$this->strings['rollback_was_required'],
(object) array(
'update' => $original_result,
'rollback' => $rollback_result,
)
@ -189,10 +191,14 @@ class Core_Upgrader extends WP_Upgrader {
}
/** This action is documented in wp-admin/includes/class-wp-upgrader.php */
do_action( 'upgrader_process_complete', $this, array(
do_action(
'upgrader_process_complete',
$this,
array(
'action' => 'update',
'type' => 'core',
) );
)
);
// Clear the current updates
delete_site_transient( 'update_core' );

View File

@ -275,12 +275,16 @@ class Language_Pack_Upgrader extends WP_Upgrader {
remove_action( 'upgrader_process_complete', 'wp_update_themes' );
/** This action is documented in wp-admin/includes/class-wp-upgrader.php */
do_action( 'upgrader_process_complete', $this, array(
do_action(
'upgrader_process_complete',
$this,
array(
'action' => 'update',
'type' => 'translation',
'bulk' => true,
'translations' => $language_updates_results,
) );
)
);
// Re-add upgrade hooks.
add_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
@ -337,7 +341,8 @@ class Language_Pack_Upgrader extends WP_Upgrader {
if ( ! $mo || ! $po ) {
return new WP_Error(
'incompatible_archive_pomo', $this->strings['incompatible_archive'],
'incompatible_archive_pomo',
$this->strings['incompatible_archive'],
/* translators: 1: .po, 2: .mo */
sprintf(
__( 'The language pack is missing either the %1$s or %2$s files.' ),

View File

@ -306,12 +306,16 @@ class Plugin_Upgrader extends WP_Upgrader {
wp_clean_plugins_cache( $parsed_args['clear_update_cache'] );
/** This action is documented in wp-admin/includes/class-wp-upgrader.php */
do_action( 'upgrader_process_complete', $this, array(
do_action(
'upgrader_process_complete',
$this,
array(
'action' => 'update',
'type' => 'plugin',
'bulk' => true,
'plugins' => $plugins,
) );
)
);
$this->skin->bulk_footer();

View File

@ -67,7 +67,8 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
'action' => 'activate',
'template' => urlencode( $template ),
'stylesheet' => urlencode( $stylesheet ),
), admin_url( 'themes.php' )
),
admin_url( 'themes.php' )
);
$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );

View File

@ -51,7 +51,8 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
'action' => 'activate',
'template' => urlencode( $template ),
'stylesheet' => urlencode( $stylesheet ),
), admin_url( 'themes.php' )
),
admin_url( 'themes.php' )
);
$activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $stylesheet );

View File

@ -111,7 +111,8 @@ class Theme_Upgrader extends WP_Upgrader {
// We don't have the parent theme, let's install it.
$api = themes_api(
'theme_information', array(
'theme_information',
array(
'slug' => $theme_info->get( 'Template' ),
'fields' => array(
'sections' => false,
@ -418,7 +419,9 @@ class Theme_Upgrader extends WP_Upgrader {
/** This action is documented in wp-admin/includes/class-wp-upgrader.php */
do_action(
'upgrader_process_complete', $this, array(
'upgrader_process_complete',
$this,
array(
'action' => 'update',
'type' => 'theme',
'bulk' => true,
@ -468,7 +471,8 @@ class Theme_Upgrader extends WP_Upgrader {
// A proper archive should have a style.css file in the single subdirectory
if ( ! file_exists( $working_directory . 'style.css' ) ) {
return new WP_Error(
'incompatible_archive_theme_no_style', $this->strings['incompatible_archive'],
'incompatible_archive_theme_no_style',
$this->strings['incompatible_archive'],
/* translators: %s: style.css */
sprintf(
__( 'The theme is missing the %s stylesheet.' ),
@ -478,7 +482,8 @@ class Theme_Upgrader extends WP_Upgrader {
}
$info = get_file_data(
$working_directory . 'style.css', array(
$working_directory . 'style.css',
array(
'Name' => 'Theme Name',
'Template' => 'Template',
)
@ -486,7 +491,8 @@ class Theme_Upgrader extends WP_Upgrader {
if ( empty( $info['Name'] ) ) {
return new WP_Error(
'incompatible_archive_theme_no_name', $this->strings['incompatible_archive'],
'incompatible_archive_theme_no_name',
$this->strings['incompatible_archive'],
/* translators: %s: style.css */
sprintf(
__( 'The %s stylesheet doesn&#8217;t contain a valid theme header.' ),
@ -498,7 +504,8 @@ class Theme_Upgrader extends WP_Upgrader {
// If it's not a child theme, it must have at least an index.php to be legit.
if ( empty( $info['Template'] ) && ! file_exists( $working_directory . 'index.php' ) ) {
return new WP_Error(
'incompatible_archive_theme_no_index', $this->strings['incompatible_archive'],
'incompatible_archive_theme_no_index',
$this->strings['incompatible_archive'],
/* translators: %s: index.php */
sprintf(
__( 'The theme is missing the %s file.' ),

View File

@ -240,7 +240,8 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
array(
'edit-menu-item' => $item_id,
'cancel' => time(),
), admin_url( 'nav-menus.php' )
),
admin_url( 'nav-menus.php' )
)
);
?>

View File

@ -336,7 +336,8 @@ class WP_Automatic_Updater {
// Boom, This sites about to get a whole new splash of paint!
$upgrade_result = $upgrader->upgrade(
$upgrader_item, array(
$upgrader_item,
array(
'clear_update_cache' => false,
// Always use partial builds if possible for core updates.
'pre_check_md5' => false,
@ -574,7 +575,8 @@ class WP_Automatic_Updater {
}
update_site_option(
'auto_core_update_failed', array(
'auto_core_update_failed',
array(
'attempted' => $core_update->current,
'current' => $wp_version,
'error_code' => $error_code,
@ -600,7 +602,8 @@ class WP_Automatic_Updater {
*/
protected function send_email( $type, $core_update, $result = null ) {
update_site_option(
'auto_core_update_notified', array(
'auto_core_update_notified',
array(
'type' => $type,
'email' => get_site_option( 'admin_email' ),
'version' => $core_update->current,

View File

@ -158,7 +158,8 @@ class WP_Comments_List_Table extends WP_List_Table {
$total_comments = get_comments(
array_merge(
$args, array(
$args,
array(
'count' => true,
'offset' => 0,
'number' => 0,
@ -277,10 +278,12 @@ class WP_Comments_List_Table extends WP_List_Table {
if ( 'mine' === $status ) {
$current_user_id = get_current_user_id();
$num_comments->mine = get_comments( array(
$num_comments->mine = get_comments(
array(
'user_id' => $current_user_id,
'count' => true,
) );
)
);
$link = add_query_arg( 'user_id', $current_user_id, $link );
} else {
$link = remove_query_arg( 'user_id', $link );
@ -367,15 +370,15 @@ class WP_Comments_List_Table extends WP_List_Table {
if ( ! isset( $has_items ) ) {
$has_items = $this->has_items();
}
?>
?>
<div class="alignleft actions">
<?php
if ( 'top' === $which ) {
?>
<?php
if ( 'top' === $which ) {
?>
<label class="screen-reader-text" for="filter-by-comment-type"><?php _e( 'Filter by comment type' ); ?></label>
<select id="filter-by-comment-type" name="comment_type">
<option value=""><?php _e( 'All comment types' ); ?></option>
<?php
<?php
/**
* Filters the comment types dropdown menu.
*
@ -384,18 +387,19 @@ if ( 'top' === $which ) {
* @param string[] $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
*/
$comment_types = apply_filters(
'admin_comment_types_dropdown', array(
'admin_comment_types_dropdown',
array(
'comment' => __( 'Comments' ),
'pings' => __( 'Pings' ),
)
);
foreach ( $comment_types as $type => $label ) {
foreach ( $comment_types as $type => $label ) {
echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
}
}
?>
</select>
<?php
<?php
/**
* Fires just before the Filter submit button for comment types.
*
@ -403,13 +407,13 @@ foreach ( $comment_types as $type => $label ) {
*/
do_action( 'restrict_manage_comments' );
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
}
if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_user_can( 'moderate_comments' ) && $has_items ) {
wp_nonce_field( 'bulk-destroy', '_destroy_nonce' );
$title = ( 'spam' === $comment_status ) ? esc_attr__( 'Empty Spam' ) : esc_attr__( 'Empty Trash' );
submit_button( $title, 'apply', 'delete_all', false );
}
}
/**
* Fires after the Filter submit button for comment types.
*
@ -490,7 +494,7 @@ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us
$this->screen->render_screen_reader_content( 'heading_list' );
?>
?>
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
<thead>
<tr>
@ -516,7 +520,7 @@ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us
</tfoot>
</table>
<?php
<?php
$this->display_tablenav( 'bottom' );
}
@ -759,7 +763,8 @@ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us
array(
's' => $author_ip,
'mode' => 'detail',
), admin_url( 'edit-comments.php' )
),
admin_url( 'edit-comments.php' )
);
if ( 'spam' === $comment_status ) {
$author_ip_url = add_query_arg( 'comment_status', 'spam', $author_ip_url );

View File

@ -100,9 +100,9 @@ class WP_Links_List_Table extends WP_List_Table {
if ( 'top' != $which ) {
return;
}
?>
?>
<div class="alignleft actions">
<?php
<?php
$dropdown_options = array(
'selected' => $cat_id,
'name' => 'cat_id',
@ -117,9 +117,9 @@ class WP_Links_List_Table extends WP_List_Table {
echo '<label class="screen-reader-text" for="cat_id">' . __( 'Filter by category' ) . '</label>';
wp_dropdown_categories( $dropdown_options );
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
?>
?>
</div>
<?php
<?php
}
/**
@ -293,11 +293,11 @@ class WP_Links_List_Table extends WP_List_Table {
$link = sanitize_bookmark( $link );
$link->link_name = esc_attr( $link->link_name );
$link->link_category = wp_get_link_cats( $link->link_id );
?>
?>
<tr id="link-<?php echo $link->link_id; ?>">
<?php $this->single_row_columns( $link ); ?>
</tr>
<?php
<?php
}
}

View File

@ -137,7 +137,8 @@ class WP_List_Table {
*/
public function __construct( $args = array() ) {
$args = wp_parse_args(
$args, array(
$args,
array(
'plural' => '',
'singular' => '',
'ajax' => false,
@ -274,7 +275,8 @@ class WP_List_Table {
*/
protected function set_pagination_args( $args ) {
$args = wp_parse_args(
$args, array(
$args,
array(
'total_items' => 0,
'total_pages' => 0,
'per_page' => 0,
@ -360,13 +362,13 @@ class WP_List_Table {
if ( ! empty( $_REQUEST['detached'] ) ) {
echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />';
}
?>
?>
<p class="search-box">
<label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label>
<input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" />
<?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?>
</p>
<?php
<?php
}
/**
@ -568,7 +570,8 @@ class WP_List_Table {
WHERE post_type = %s
$extra_checks
ORDER BY post_date DESC
", $post_type
",
$post_type
)
);
@ -589,12 +592,12 @@ class WP_List_Table {
}
$m = isset( $_GET['m'] ) ? (int) $_GET['m'] : 0;
?>
?>
<label for="filter-by-date" class="screen-reader-text"><?php _e( 'Filter by date' ); ?></label>
<select name="m" id="filter-by-date">
<option<?php selected( $m, 0 ); ?> value="0"><?php _e( 'All dates' ); ?></option>
<?php
foreach ( $months as $arc_row ) {
<?php
foreach ( $months as $arc_row ) {
if ( 0 == $arc_row->year ) {
continue;
}
@ -609,10 +612,10 @@ foreach ( $months as $arc_row ) {
/* translators: 1: month name, 2: 4-digit year */
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
);
}
?>
}
?>
</select>
<?php
<?php
}
/**
@ -623,11 +626,11 @@ foreach ( $months as $arc_row ) {
* @param string $current_mode
*/
protected function view_switcher( $current_mode ) {
?>
?>
<input type="hidden" name="mode" value="<?php echo esc_attr( $current_mode ); ?>" />
<div class="view-switch">
<?php
foreach ( $this->modes as $mode => $title ) {
<?php
foreach ( $this->modes as $mode => $title ) {
$classes = array( 'view-' . $mode );
if ( $current_mode === $mode ) {
$classes[] = 'current';
@ -638,10 +641,10 @@ foreach ( $this->modes as $mode => $title ) {
implode( ' ', $classes ),
$title
);
}
}
?>
</div>
<?php
<?php
}
/**
@ -677,7 +680,8 @@ foreach ( $this->modes as $mode => $title ) {
array(
'p' => $post_id,
'comment_status' => 'approved',
), admin_url( 'edit-comments.php' )
),
admin_url( 'edit-comments.php' )
)
),
$approved_comments_number,
@ -699,7 +703,8 @@ foreach ( $this->modes as $mode => $title ) {
array(
'p' => $post_id,
'comment_status' => 'moderated',
), admin_url( 'edit-comments.php' )
),
admin_url( 'edit-comments.php' )
)
),
$pending_comments_number,
@ -1152,7 +1157,7 @@ foreach ( $this->modes as $mode => $title ) {
$this->display_tablenav( 'top' );
$this->screen->render_screen_reader_content( 'heading_list' );
?>
?>
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
<thead>
<tr>
@ -1177,7 +1182,7 @@ foreach ( $this->modes as $mode => $title ) {
</tfoot>
</table>
<?php
<?php
$this->display_tablenav( 'bottom' );
}
@ -1217,7 +1222,7 @@ foreach ( $this->modes as $mode => $title ) {
<br class="clear" />
</div>
<?php
<?php
}
/**

View File

@ -171,10 +171,10 @@ class WP_Media_List_Table extends WP_List_Table {
if ( 'bar' !== $which ) {
return;
}
?>
?>
<div class="actions">
<?php
if ( ! is_singular() ) {
<?php
if ( ! is_singular() ) {
if ( ! $this->is_trash ) {
$this->months_dropdown( 'attachment' );
}
@ -183,14 +183,14 @@ if ( ! is_singular() ) {
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
}
if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_items() ) {
if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_items() ) {
submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
}
}
?>
</div>
<?php
<?php
}
/**
@ -236,7 +236,7 @@ if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_it
$views = $this->get_views();
$this->screen->render_screen_reader_content( 'heading_views' );
?>
?>
<div class="wp-filter">
<div class="filter-items">
<?php $this->view_switcher( $mode ); ?>
@ -252,21 +252,21 @@ if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_it
?>
</select>
<?php
<?php
$this->extra_tablenav( 'bar' );
/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
$views = apply_filters( "views_{$this->screen->id}", array() );
// Back compat for pre-4.0 view links.
if ( ! empty( $views ) ) {
if ( ! empty( $views ) ) {
echo '<ul class="filter-links">';
foreach ( $views as $class => $view ) {
echo "<li class='$class'>$view</li>";
}
echo '</ul>';
}
?>
}
?>
</div>
<div class="search-form">
@ -487,12 +487,12 @@ if ( ! empty( $views ) ) {
$parent_type = get_post_type_object( $parent->post_type );
if ( $parent_type && $parent_type->show_ui && current_user_can( 'edit_post', $post->post_parent ) ) {
?>
?>
<strong><a href="<?php echo get_edit_post_link( $post->post_parent ); ?>">
<?php echo $title; ?></a></strong>
<?php
} elseif ( $parent_type && current_user_can( 'read_post', $post->post_parent ) ) {
?>
?>
<strong><?php echo $title; ?></strong>
<?php
} else {
@ -505,7 +505,8 @@ if ( ! empty( $views ) ) {
'parent_post_id' => $post->post_parent,
'media[]' => $post->ID,
'_wpnonce' => wp_create_nonce( 'bulk-' . $this->_args['plural'] ),
), 'upload.php'
),
'upload.php'
);
printf(
'<br /><a href="%s" class="hide-if-no-js detach-from-parent" aria-label="%s">%s</a>',

View File

@ -176,7 +176,8 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
$total_sites = get_sites(
array_merge(
$args, array(
$args,
array(
'count' => true,
'offset' => 0,
'number' => 0,
@ -406,12 +407,14 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
public function column_users( $blog ) {
$user_count = wp_cache_get( $blog['blog_id'] . '_user_count', 'blog-details' );
if ( ! $user_count ) {
$blog_users = new WP_User_Query( array(
$blog_users = new WP_User_Query(
array(
'blog_id' => $blog['blog_id'],
'fields' => 'ID',
'number' => 1,
'count_total' => true,
) );
)
);
$user_count = $blog_users->get_total();
wp_cache_set( $blog['blog_id'] . '_user_count', $user_count, 'blog-details', 12 * HOUR_IN_SECONDS );
}

View File

@ -153,7 +153,9 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
$total_this_page = $totals[ $status ];
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'themes' => $totals,
'totals' => wp_get_update_data(),
)
@ -423,7 +425,8 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
'theme' => $theme_key,
'paged' => $page,
's' => $s,
), $url
),
$url
);
if ( $this->is_site_themes ) {
@ -448,7 +451,8 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
'theme' => $theme_key,
'paged' => $page,
's' => $s,
), $url
),
$url
);
if ( $this->is_site_themes ) {
@ -475,7 +479,8 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
'theme_status' => $context,
'paged' => $page,
's' => $s,
), 'themes.php'
),
'themes.php'
);
/* translators: %s: theme name */

View File

@ -256,7 +256,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
}
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'plugins' => $js_plugins,
'totals' => wp_get_update_data(),
)
@ -308,7 +310,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$views = apply_filters( "views_{$this->screen->id}", $views );
$this->screen->render_screen_reader_content( 'heading_views' );
?>
?>
<div class="wp-filter">
<ul class="filter-links">
<?php
@ -323,7 +325,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
<?php install_search_form(); ?>
</div>
<?php
<?php
}
/**
@ -340,16 +342,16 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$this->display_tablenav( 'top' );
?>
?>
<div class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>">
<?php
<?php
$this->screen->render_screen_reader_content( 'heading_list' );
?>
?>
<div id="the-list"<?php echo $data_attr; ?>>
<?php $this->display_rows_or_placeholder(); ?>
</div>
</div>
<?php
<?php
$this->display_tablenav( 'bottom' );
}
@ -560,7 +562,8 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $status['file'] ),
'action' => 'activate',
'plugin' => $status['file'],
), network_admin_url( 'plugins.php' )
),
network_admin_url( 'plugins.php' )
);
if ( is_network_admin() ) {

View File

@ -256,7 +256,9 @@ class WP_Plugins_List_Table extends WP_List_Table {
}
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'plugins' => $js_plugins,
'totals' => wp_get_update_data(),
)

View File

@ -49,7 +49,7 @@ class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
$singular = $this->_args['singular'];
wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
?>
?>
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" style="display:none;">
<tbody id="the-comment-list"
<?php
@ -65,7 +65,7 @@ class WP_Post_Comments_List_Table extends WP_Comments_List_Table {
?>
</tbody>
</table>
<?php
<?php
}
/**

View File

@ -98,7 +98,9 @@ class WP_Posts_List_Table extends WP_List_Table {
WHERE post_type = %s
AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
AND post_author = %d
", $post_type, get_current_user_id()
",
$post_type,
get_current_user_id()
)
)
);
@ -460,10 +462,10 @@ class WP_Posts_List_Table extends WP_List_Table {
* @param string $which
*/
protected function extra_tablenav( $which ) {
?>
?>
<div class="alignleft actions">
<?php
if ( 'top' === $which && ! is_singular() ) {
<?php
if ( 'top' === $which && ! is_singular() ) {
ob_start();
$this->months_dropdown( $this->screen->post_type );
@ -492,14 +494,14 @@ if ( 'top' === $which && ! is_singular() ) {
echo $output;
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
}
}
if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {
if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_others_posts ) && $this->has_items() ) {
submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
}
?>
}
?>
</div>
<?php
<?php
/**
* Fires immediately following the closing "actions" div in the tablenav for the posts
* list table.
@ -1588,10 +1590,10 @@ if ( ! $bulk && $can_publish ) :
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
wp_dropdown_pages( $dropdown_args );
?>
?>
</label>
<?php
<?php
endif; // hierarchical
if ( ! $bulk ) :
@ -1611,9 +1613,9 @@ if ( ! $bulk && $can_publish ) :
<label>
<span class="title"><?php _e( 'Template' ); ?></span>
<select name="page_template">
<?php if ( $bulk ) : ?>
<?php if ( $bulk ) : ?>
<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
<?php endif; // $bulk ?>
<?php endif; // $bulk ?>
<?php
/** This filter is documented in wp-admin/includes/meta-boxes.php */
$default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'quick-edit' );
@ -1825,8 +1827,8 @@ if ( ! $bulk && $can_publish ) :
<?php
$bulk++;
}
?>
?>
</tbody></table></form>
<?php
<?php
}
}

View File

@ -968,7 +968,8 @@ if ( $this->show_screen_options() ) :
*/
public function render_screen_options( $options = array() ) {
$options = wp_parse_args(
$options, array(
$options,
array(
'wrap' => true,
)
);
@ -1235,7 +1236,7 @@ if ( $this->show_screen_options() ) :
// This needs a submit button
add_filter( 'screen_options_show_submit', '__return_true' );
?>
?>
<fieldset class="metabox-prefs view-mode">
<legend><?php _e( 'View Mode' ); ?></legend>
<label for="list-view-mode">
@ -1247,7 +1248,7 @@ if ( $this->show_screen_options() ) :
<?php _e( 'Excerpt View' ); ?>
</label>
</fieldset>
<?php
<?php
}
/**

View File

@ -212,7 +212,8 @@ class WP_Terms_List_Table extends WP_List_Table {
$taxonomy = $this->screen->taxonomy;
$args = wp_parse_args(
$this->callback_args, array(
$this->callback_args,
array(
'page' => 1,
'number' => 20,
'search' => '',
@ -607,7 +608,7 @@ class WP_Terms_List_Table extends WP_List_Table {
if ( ! current_user_can( $tax->cap->edit_terms ) ) {
return;
}
?>
?>
<form method="get"><table style="display: none"><tbody id="inlineedit">
<tr id="inline-edit" class="inline-edit-row" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">

View File

@ -190,7 +190,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
*/
public function display() {
wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
?>
?>
<div class="tablenav top themes">
<div class="alignleft actions">
<?php
@ -270,7 +270,8 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
array(
'tab' => 'theme-information',
'theme' => $theme->slug,
), self_admin_url( 'theme-install.php' )
),
self_admin_url( 'theme-install.php' )
);
$actions = array();
@ -279,14 +280,16 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
array(
'action' => 'install-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' )
),
self_admin_url( 'update.php' )
);
$update_url = add_query_arg(
array(
'action' => 'upgrade-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' )
),
self_admin_url( 'update.php' )
);
$status = $this->_get_theme_status( $theme );
@ -346,10 +349,12 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
</a>
<h3><?php echo $name; ?></h3>
<div class="theme-author"><?php
<div class="theme-author">
<?php
/* translators: %s: theme author */
printf( __( 'By %s' ), $author );
?></div>
?>
</div>
<div class="action-links">
<ul>
@ -430,14 +435,16 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
array(
'action' => 'install-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' )
),
self_admin_url( 'update.php' )
);
$update_url = add_query_arg(
array(
'action' => 'upgrade-theme',
'theme' => $theme->slug,
), self_admin_url( 'update.php' )
),
self_admin_url( 'update.php' )
);
$status = $this->_get_theme_status( $theme );
@ -474,10 +481,12 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
}
?>
<h3 class="theme-name"><?php echo $name; ?></h3>
<span class="theme-by"><?php
<span class="theme-by">
<?php
/* translators: %s: theme author */
printf( __( 'By %s' ), $author );
?></span>
?>
</span>
<?php if ( isset( $theme->screenshot_url ) ) : ?>
<img class="theme-screenshot" src="<?php echo esc_url( $theme->screenshot_url ); ?>" alt="" />
<?php endif; ?>

View File

@ -137,7 +137,7 @@ class WP_Themes_List_Table extends WP_List_Table {
*/
public function display() {
wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
?>
?>
<?php $this->tablenav( 'top' ); ?>
<div id="availablethemes">
@ -145,7 +145,7 @@ class WP_Themes_List_Table extends WP_List_Table {
</div>
<?php $this->tablenav( 'bottom' ); ?>
<?php
<?php
}
/**

View File

@ -286,7 +286,7 @@ class WP_Users_List_Table extends WP_List_Table {
* @param string $which The location of the extra table nav markup: 'top' or 'bottom'.
*/
do_action( 'restrict_manage_users', $which );
?>
?>
</div>
<?php
/**

View File

@ -226,7 +226,7 @@ function wp_dashboard() {
$columns_css = " columns-$columns";
}
?>
?>
<div id="dashboard-widgets" class="metabox-holder<?php echo $columns_css; ?>">
<div id="postbox-container-1" class="postbox-container">
<?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
@ -242,7 +242,7 @@ function wp_dashboard() {
</div>
</div>
<?php
<?php
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
@ -260,7 +260,7 @@ function wp_dashboard() {
* @since 2.7.0
*/
function wp_dashboard_right_now() {
?>
?>
<div class="main">
<ul>
<?php
@ -427,7 +427,7 @@ function wp_network_dashboard_right_now() {
echo implode( " |</li>\n", $actions ) . "</li>\n";
echo '</ul>';
}
?>
?>
<br class="clear" />
<p class="youhave"><?php echo $sentence; ?></p>
@ -458,7 +458,7 @@ function wp_network_dashboard_right_now() {
<?php submit_button( __( 'Search Sites' ), '', false, false, array( 'id' => 'submit_sites' ) ); ?>
</p>
</form>
<?php
<?php
/**
* Fires at the end of the 'Right Now' widget in the Network Admin dashboard.
*
@ -510,7 +510,7 @@ function wp_dashboard_quick_press( $error_msg = false ) {
}
$post_ID = (int) $post->ID;
?>
?>
<form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form hide-if-no-js">
@ -692,7 +692,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
$actions_string .= "<span class='$action'>$sep$link</span>";
}
}
?>
?>
<li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
@ -768,7 +768,7 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
<?php endif; ?>
</div>
</li>
<?php
<?php
$GLOBALS['comment'] = null;
}
@ -1049,7 +1049,9 @@ function wp_dashboard_trigger_widget_control( $widget_control_id = false ) {
if ( is_scalar( $widget_control_id ) && $widget_control_id && isset( $wp_dashboard_control_callbacks[ $widget_control_id ] ) && is_callable( $wp_dashboard_control_callbacks[ $widget_control_id ] ) ) {
call_user_func(
$wp_dashboard_control_callbacks[ $widget_control_id ], '', array(
$wp_dashboard_control_callbacks[ $widget_control_id ],
'',
array(
'id' => $widget_control_id,
'callback' => $wp_dashboard_control_callbacks[ $widget_control_id ],
)
@ -1760,7 +1762,8 @@ function wp_welcome_panel() {
if ( current_theme_supports( 'widgets' ) && current_theme_supports( 'menus' ) ) {
printf(
__( 'Manage <a href="%1$s">widgets</a> or <a href="%2$s">menus</a>' ),
admin_url( 'widgets.php' ), admin_url( 'nav-menus.php' )
admin_url( 'widgets.php' ),
admin_url( 'nav-menus.php' )
);
} elseif ( current_theme_supports( 'widgets' ) ) {
echo '<a href="' . admin_url( 'widgets.php' ) . '">' . __( 'Manage widgets' ) . '</a>';

View File

@ -445,7 +445,7 @@ function export_wp( $args = array() ) {
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!-- contained in this file into your site. -->
<?php the_generator( 'export' ); ?>
<?php the_generator( 'export' ); ?>
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/<?php echo WXR_VERSION; ?>/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
@ -464,9 +464,9 @@ function export_wp( $args = array() ) {
<wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
<wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
<?php wxr_authors_list( $post_ids ); ?>
<?php wxr_authors_list( $post_ids ); ?>
<?php foreach ( $cats as $c ) : ?>
<?php foreach ( $cats as $c ) : ?>
<wp:category>
<wp:term_id><?php echo intval( $c->term_id ); ?></wp:term_id>
<wp:category_nicename><?php echo wxr_cdata( $c->slug ); ?></wp:category_nicename>
@ -477,8 +477,8 @@ function export_wp( $args = array() ) {
wxr_term_meta( $c );
?>
</wp:category>
<?php endforeach; ?>
<?php foreach ( $tags as $t ) : ?>
<?php endforeach; ?>
<?php foreach ( $tags as $t ) : ?>
<wp:tag>
<wp:term_id><?php echo intval( $t->term_id ); ?></wp:term_id>
<wp:tag_slug><?php echo wxr_cdata( $t->slug ); ?></wp:tag_slug>
@ -488,8 +488,8 @@ function export_wp( $args = array() ) {
wxr_term_meta( $t );
?>
</wp:tag>
<?php endforeach; ?>
<?php foreach ( $terms as $t ) : ?>
<?php endforeach; ?>
<?php foreach ( $terms as $t ) : ?>
<wp:term>
<wp:term_id><?php echo wxr_cdata( $t->term_id ); ?></wp:term_id>
<wp:term_taxonomy><?php echo wxr_cdata( $t->taxonomy ); ?></wp:term_taxonomy>
@ -501,19 +501,19 @@ function export_wp( $args = array() ) {
wxr_term_meta( $t );
?>
</wp:term>
<?php endforeach; ?>
<?php
if ( 'all' == $args['content'] ) {
<?php endforeach; ?>
<?php
if ( 'all' == $args['content'] ) {
wxr_nav_menu_terms();}
?>
?>
<?php
/** This action is documented in wp-includes/feed-rss2.php */
do_action( 'rss2_head' );
?>
<?php
if ( $post_ids ) {
<?php
if ( $post_ids ) {
/**
* @global WP_Query $wp_query
*/
@ -607,8 +607,8 @@ if ( $post_ids ) {
<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
</wp:postmeta>
<?php
endforeach;
<?php
endforeach;
$_comments = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_approved <> 'spam'", $post->ID ) );
$comments = array_map( 'get_comment', $_comments );
@ -627,9 +627,9 @@ endforeach;
<wp:comment_type><?php echo wxr_cdata( $c->comment_type ); ?></wp:comment_type>
<wp:comment_parent><?php echo intval( $c->comment_parent ); ?></wp:comment_parent>
<wp:comment_user_id><?php echo intval( $c->user_id ); ?></wp:comment_user_id>
<?php
<?php
$c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
foreach ( $c_meta as $meta ) :
foreach ( $c_meta as $meta ) :
/**
* Filters whether to selectively skip comment meta used for WXR exports.
*
@ -650,16 +650,16 @@ foreach ( $c_meta as $meta ) :
<wp:meta_key><?php echo wxr_cdata( $meta->meta_key ); ?></wp:meta_key>
<wp:meta_value><?php echo wxr_cdata( $meta->meta_value ); ?></wp:meta_value>
</wp:commentmeta>
<?php endforeach; ?>
<?php endforeach; ?>
</wp:comment>
<?php endforeach; ?>
<?php endforeach; ?>
</item>
<?php
}
}
}
?>
}
?>
</channel>
</rss>
<?php
<?php
}

View File

@ -890,11 +890,13 @@ function _wp_handle_upload( &$file, $overrides, $time, $action ) {
* @param string $context The type of upload action. Values include 'upload' or 'sideload'.
*/
return apply_filters(
'wp_handle_upload', array(
'wp_handle_upload',
array(
'file' => $new_file,
'url' => $url,
'type' => $type,
), 'wp_handle_sideload' === $action ? 'sideload' : 'upload'
),
'wp_handle_sideload' === $action ? 'sideload' : 'upload'
);
}
@ -982,7 +984,8 @@ function download_url( $url, $timeout = 300 ) {
}
$response = wp_safe_remote_get(
$url, array(
$url,
array(
'timeout' => $timeout,
'stream' => true,
'filename' => $tmpfname,
@ -1679,7 +1682,8 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
}
$credentials = get_option(
'ftp_credentials', array(
'ftp_credentials',
array(
'hostname' => '',
'username' => '',
)
@ -1786,24 +1790,24 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false,
*/
$types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context );
?>
?>
<form action="<?php echo esc_url( $form_post ); ?>" method="post">
<div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form">
<?php
// Print a H1 heading in the FTP credentials modal dialog, default is a H2.
$heading_tag = 'h2';
if ( 'plugins.php' === $pagenow || 'plugin-install.php' === $pagenow ) {
<?php
// Print a H1 heading in the FTP credentials modal dialog, default is a H2.
$heading_tag = 'h2';
if ( 'plugins.php' === $pagenow || 'plugin-install.php' === $pagenow ) {
$heading_tag = 'h1';
}
echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connection Information' ) . "</$heading_tag>";
?>
}
echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connection Information' ) . "</$heading_tag>";
?>
<p id="request-filesystem-credentials-desc">
<?php
<?php
$label_user = __( 'Username' );
$label_pass = __( 'Password' );
_e( 'To perform the requested action, WordPress needs to access your web server.' );
echo ' ';
if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
if ( isset( $types['ssh'] ) ) {
_e( 'Please enter your FTP or SSH credentials to proceed.' );
$label_user = __( 'FTP/SSH Username' );
@ -1814,7 +1818,7 @@ if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
$label_pass = __( 'FTP Password' );
}
echo ' ';
}
}
_e( 'If you do not remember your credentials, you should contact your web host.' );
$hostname_value = esc_attr( $hostname );
@ -1826,7 +1830,7 @@ if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
if ( defined( 'FTP_PASS' ) ) {
$password_value = '*****';
}
?>
?>
</p>
<label for="hostname">
<span class="field-title"><?php _e( 'Hostname' ); ?></span>
@ -1846,31 +1850,31 @@ if ( ( isset( $types['ftp'] ) || isset( $types['ftps'] ) ) ) {
<?php
if ( ! defined( 'FTP_PASS' ) ) {
_e( 'This password will not be stored on the server.' );}
?>
?>
</em>
</label>
</div>
<fieldset>
<legend><?php _e( 'Connection Type' ); ?></legend>
<?php
<?php
$disabled = disabled( ( defined( 'FTP_SSL' ) && FTP_SSL ) || ( defined( 'FTP_SSH' ) && FTP_SSH ), true, false );
foreach ( $types as $name => $text ) :
foreach ( $types as $name => $text ) :
?>
<label for="<?php echo esc_attr( $name ); ?>">
<input type="radio" name="connection_type" id="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $name ); ?>" <?php checked( $name, $connection_type ); ?> <?php echo $disabled; ?> />
<?php echo $text; ?>
</label>
<?php
<?php
endforeach;
?>
?>
</fieldset>
<?php
if ( isset( $types['ssh'] ) ) {
<?php
if ( isset( $types['ssh'] ) ) {
$hidden_class = '';
if ( 'ssh' != $connection_type || empty( $connection_type ) ) {
$hidden_class = ' class="hidden"';
}
?>
?>
<fieldset id="ssh-keys"<?php echo $hidden_class; ?>>
<legend><?php _e( 'Authentication Keys' ); ?></legend>
<label for="public_key">
@ -1883,15 +1887,15 @@ if ( isset( $types['ssh'] ) ) {
</label>
<p id="auth-keys-desc"><?php _e( 'Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.' ); ?></p>
</fieldset>
<?php
}
<?php
}
foreach ( (array) $extra_fields as $field ) {
foreach ( (array) $extra_fields as $field ) {
if ( isset( $submitted_form[ $field ] ) ) {
echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( $submitted_form[ $field ] ) . '" />';
}
}
?>
}
?>
<p class="request-filesystem-credentials-action-buttons">
<?php wp_nonce_field( 'filesystem-credentials', '_fs_nonce', false, true ); ?>
<button class="button cancel-button" data-js-action="close" type="button"><?php _e( 'Cancel' ); ?></button>
@ -1899,7 +1903,7 @@ foreach ( (array) $extra_fields as $field ) {
</p>
</div>
</form>
<?php
<?php
return false;
}
@ -1955,9 +1959,9 @@ function wp_privacy_generate_personal_data_export_group_html( $group_data ) {
$allowed_tags = array(
'a' => array(
'href' => array(),
'target' => array()
'target' => array(),
),
'br' => array()
'br' => array(),
);
$allowed_protocols = array( 'http', 'https' );
$group_html = '';
@ -2060,22 +2064,22 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
fwrite( $file, "<head>\n" );
fwrite( $file, "<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />\n" );
fwrite( $file, "<style type='text/css'>" );
fwrite( $file, "body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }" );
fwrite( $file, "table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }" );
fwrite( $file, "th { padding: 5px; text-align: left; width: 20%; }" );
fwrite( $file, "td { padding: 5px; }" );
fwrite( $file, "tr:nth-child(odd) { background-color: #fafafa; }" );
fwrite( $file, "</style>" );
fwrite( $file, "<title>" );
fwrite( $file, 'body { color: black; font-family: Arial, sans-serif; font-size: 11pt; margin: 15px auto; width: 860px; }' );
fwrite( $file, 'table { background: #f0f0f0; border: 1px solid #ddd; margin-bottom: 20px; width: 100%; }' );
fwrite( $file, 'th { padding: 5px; text-align: left; width: 20%; }' );
fwrite( $file, 'td { padding: 5px; }' );
fwrite( $file, 'tr:nth-child(odd) { background-color: #fafafa; }' );
fwrite( $file, '</style>' );
fwrite( $file, '<title>' );
fwrite( $file, esc_html( $title ) );
fwrite( $file, "</title>" );
fwrite( $file, '</title>' );
fwrite( $file, "</head>\n" );
// Body.
fwrite( $file, "<body>\n" );
// Heading.
fwrite( $file, "<h1>" . esc_html__( 'Personal Data Export' ) . "</h1>" );
fwrite( $file, '<h1>' . esc_html__( 'Personal Data Export' ) . '</h1>' );
// And now, all the Groups.
$groups = get_post_meta( $request_id, '_export_data_grouped', true );
@ -2197,9 +2201,9 @@ function wp_privacy_send_personal_data_export_email( $request_id ) {
$expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS );
$expiration_date = date_i18n( get_option( 'date_format' ), time() + $expiration );
/* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */
$email_text = __(
'Howdy,
/* translators: Do not translate EXPIRATION, LINK, SITENAME, SITEURL: those are placeholders. */
$email_text = __(
'Howdy,
Your request for an export of personal data has been completed. You may
download your personal data by clicking on the link below. For privacy
@ -2211,7 +2215,7 @@ so please download it before then.
Regards,
All at ###SITENAME###
###SITEURL###'
);
);
/**
* Filters the text of the email sent with a personal data export file.

View File

@ -80,7 +80,7 @@ function wp_image_editor( $post_id, $msg = false ) {
</div>
</div>
<?php if ( $can_restore ) { ?>
<?php if ( $can_restore ) { ?>
<div class="imgedit-group">
<div class="imgedit-group-top">
@ -103,7 +103,7 @@ function wp_image_editor( $post_id, $msg = false ) {
</div>
</div>
<?php } ?>
<?php } ?>
<div class="imgedit-group">
<div class="imgedit-group-top">
@ -243,7 +243,7 @@ function wp_image_editor( $post_id, $msg = false ) {
<div class="imgedit-wait" id="imgedit-wait-<?php echo $post_id; ?>"></div>
<div class="hidden" id="imgedit-leaving-<?php echo $post_id; ?>"><?php _e( "There are unsaved changes that will be lost. 'OK' to continue, 'Cancel' to return to the Image Editor." ); ?></div>
</div>
<?php
<?php
}
/**

View File

@ -141,7 +141,8 @@ function wp_get_popular_importers() {
array(
'locale' => $locale,
'version' => $wp_version,
), 'http://api.wordpress.org/core/importers/1.1/'
),
'http://api.wordpress.org/core/importers/1.1/'
);
$options = array( 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url( '/' ) );

View File

@ -263,12 +263,12 @@ function _cleanup_image_add_caption( $matches ) {
* @param string $html
*/
function media_send_to_editor( $html ) {
?>
?>
<script type="text/javascript">
var win = window.dialogArguments || opener || parent || top;
win.send_to_editor( <?php echo wp_json_encode( $html ); ?> );
</script>
<?php
<?php
exit;
}
@ -388,7 +388,8 @@ function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrid
'post_title' => $title,
'post_content' => $content,
'post_excerpt' => $excerpt,
), $post_data
),
$post_data
);
// This should never be set as it would then overwrite an existing attachment.
@ -458,7 +459,8 @@ function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data
'post_parent' => $post_id,
'post_title' => $title,
'post_content' => $content,
), $post_data
),
$post_data
);
// This should never be set as it would then overwrite an existing attachment.
@ -484,24 +486,24 @@ function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data
*/
function wp_iframe( $content_func /* ... */ ) {
_wp_admin_html_begin();
?>
?>
<title><?php bloginfo( 'name' ); ?> &rsaquo; <?php _e( 'Uploads' ); ?> &#8212; <?php _e( 'WordPress' ); ?></title>
<?php
<?php
wp_enqueue_style( 'colors' );
// Check callback name for 'media'
if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) )
wp_enqueue_style( 'colors' );
// Check callback name for 'media'
if ( ( is_array( $content_func ) && ! empty( $content_func[1] ) && 0 === strpos( (string) $content_func[1], 'media' ) )
|| ( ! is_array( $content_func ) && 0 === strpos( $content_func, 'media' ) ) ) {
wp_enqueue_style( 'deprecated-media' );
}
wp_enqueue_style( 'ie' );
?>
}
wp_enqueue_style( 'ie' );
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>', pagenow = 'media-upload-popup', adminpage = 'media-upload-popup',
isRtl = <?php echo (int) is_rtl(); ?>;
</script>
<?php
<?php
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_enqueue_scripts', 'media-upload-popup' );
@ -536,7 +538,7 @@ isRtl = <?php echo (int) is_rtl(); ?>;
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_head' );
if ( is_string( $content_func ) ) {
if ( is_string( $content_func ) ) {
/**
* Fires in the admin header for each specific form tab in the legacy
* (pre-3.5.0) media upload popup.
@ -549,30 +551,30 @@ if ( is_string( $content_func ) ) {
* @since 2.5.0
*/
do_action( "admin_head_{$content_func}" );
}
}
$body_id_attr = '';
if ( isset( $GLOBALS['body_id'] ) ) {
$body_id_attr = '';
if ( isset( $GLOBALS['body_id'] ) ) {
$body_id_attr = ' id="' . $GLOBALS['body_id'] . '"';
}
?>
}
?>
</head>
<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js">
<script type="text/javascript">
document.body.className = document.body.className.replace('no-js', 'js');
</script>
<?php
<?php
$args = func_get_args();
$args = array_slice( $args, 1 );
call_user_func_array( $content_func, $args );
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts' );
?>
?>
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
</body>
</html>
<?php
<?php
}
/**
@ -1069,7 +1071,8 @@ function image_size_input_fields( $post, $check = '' ) {
* include 'Thumbnail', 'Medium', 'Large', 'Full Size'.
*/
$size_names = apply_filters(
'image_size_names_choose', array(
'image_size_names_choose',
array(
'thumbnail' => __( 'Thumbnail' ),
'medium' => __( 'Medium' ),
'large' => __( 'Large' ),
@ -1781,9 +1784,15 @@ function get_compat_media_markup( $attachment_id, $args = null ) {
$form_fields = apply_filters( 'attachment_fields_to_edit', $form_fields, $post );
unset(
$form_fields['image-size'], $form_fields['align'], $form_fields['image_alt'],
$form_fields['post_title'], $form_fields['post_excerpt'], $form_fields['post_content'],
$form_fields['url'], $form_fields['menu_order'], $form_fields['image_url']
$form_fields['image-size'],
$form_fields['align'],
$form_fields['image_alt'],
$form_fields['post_title'],
$form_fields['post_excerpt'],
$form_fields['post_content'],
$form_fields['url'],
$form_fields['menu_order'],
$form_fields['image_url']
);
/** This filter is documented in wp-admin/includes/media.php */
@ -1943,28 +1952,28 @@ function media_upload_form( $errors = null ) {
if ( ! $max_upload_size ) {
$max_upload_size = 0;
}
?>
?>
<div id="media-upload-notice">
<?php
<?php
if ( isset( $errors['upload_notice'] ) ) {
if ( isset( $errors['upload_notice'] ) ) {
echo $errors['upload_notice'];
}
}
?>
?>
</div>
<div id="media-upload-error">
<?php
<?php
if ( isset( $errors['upload_error'] ) && is_wp_error( $errors['upload_error'] ) ) {
if ( isset( $errors['upload_error'] ) && is_wp_error( $errors['upload_error'] ) ) {
echo $errors['upload_error']->get_error_message();
}
}
?>
?>
</div>
<?php
if ( is_multisite() && ! is_upload_space_available() ) {
<?php
if ( is_multisite() && ! is_upload_space_available() ) {
/**
* Fires when an upload will exceed the defined upload space quota for a network site.
*
@ -1972,24 +1981,24 @@ if ( is_multisite() && ! is_upload_space_available() ) {
*/
do_action( 'upload_ui_over_quota' );
return;
}
}
/**
/**
* Fires just before the legacy (pre-3.5.0) upload interface is loaded.
*
* @since 2.6.0
*/
do_action( 'pre-upload-ui' );
do_action( 'pre-upload-ui' );
$post_params = array(
$post_params = array(
'post_id' => $post_id,
'_wpnonce' => wp_create_nonce( 'media-form' ),
'type' => $_type,
'tab' => $_tab,
'short' => '1',
);
);
/**
/**
* Filters the media upload post parameters.
*
* @since 3.1.0 As 'swfupload_post_params'
@ -1997,13 +2006,13 @@ $post_params = array(
*
* @param array $post_params An array of media upload parameters used by Plupload.
*/
$post_params = apply_filters( 'upload_post_params', $post_params );
$post_params = apply_filters( 'upload_post_params', $post_params );
/*
/*
* Since 4.9 the `runtimes` setting is hardcoded in our version of Plupload to `html5,html4`,
* and the `flash_swf_url` and `silverlight_xap_url` are not used.
*/
$plupload_init = array(
$plupload_init = array(
'browse_button' => 'plupload-browse-button',
'container' => 'plupload-upload-ui',
'drop_element' => 'drag-drop-area',
@ -2013,53 +2022,53 @@ $plupload_init = array(
'max_file_size' => $max_upload_size . 'b',
),
'multipart_params' => $post_params,
);
);
// Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
// when enabled. See #29602.
if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&
// Currently only iOS Safari supports multiple files uploading but iOS 7.x has a bug that prevents uploading of videos
// when enabled. See #29602.
if ( wp_is_mobile() && strpos( $_SERVER['HTTP_USER_AGENT'], 'OS 7_' ) !== false &&
strpos( $_SERVER['HTTP_USER_AGENT'], 'like Mac OS X' ) !== false ) {
$plupload_init['multi_selection'] = false;
}
}
/**
/**
* Filters the default Plupload settings.
*
* @since 3.3.0
*
* @param array $plupload_init An array of default settings used by Plupload.
*/
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
$plupload_init = apply_filters( 'plupload_init', $plupload_init );
?>
?>
<script type="text/javascript">
<?php
// Verify size is an int. If not return default value.
$large_size_h = absint( get_option( 'large_size_h' ) );
if ( ! $large_size_h ) {
<?php
// Verify size is an int. If not return default value.
$large_size_h = absint( get_option( 'large_size_h' ) );
if ( ! $large_size_h ) {
$large_size_h = 1024;
}
$large_size_w = absint( get_option( 'large_size_w' ) );
if ( ! $large_size_w ) {
}
$large_size_w = absint( get_option( 'large_size_w' ) );
if ( ! $large_size_w ) {
$large_size_w = 1024;
}
?>
}
?>
var resize_height = <?php echo $large_size_h; ?>, resize_width = <?php echo $large_size_w; ?>,
wpUploaderInit = <?php echo wp_json_encode( $plupload_init ); ?>;
</script>
<div id="plupload-upload-ui" class="hide-if-no-js">
<?php
/**
<?php
/**
* Fires before the upload interface loads.
*
* @since 2.6.0 As 'pre-flash-upload-ui'
* @since 3.3.0
*/
do_action( 'pre-plupload-upload-ui' );
?>
do_action( 'pre-plupload-upload-ui' );
?>
<div id="drag-drop-area">
<div class="drag-drop-inside">
<p class="drag-drop-info"><?php _e( 'Drop files here' ); ?></p>
@ -2067,15 +2076,15 @@ do_action( 'pre-plupload-upload-ui' );
<p class="drag-drop-buttons"><input id="plupload-browse-button" type="button" value="<?php esc_attr_e( 'Select Files' ); ?>" class="button" /></p>
</div>
</div>
<?php
/**
<?php
/**
* Fires after the upload interface loads.
*
* @since 2.6.0 As 'post-flash-upload-ui'
* @since 3.3.0
*/
do_action( 'post-plupload-upload-ui' );
?>
do_action( 'post-plupload-upload-ui' );
?>
</div>
<div id="html-upload-ui" class="hide-if-js">
@ -2094,18 +2103,18 @@ do_action( 'post-plupload-upload-ui' );
<a href="#" onclick="try{top.tb_remove();}catch(e){}; return false;"><?php _e( 'Cancel' ); ?></a>
</p>
<div class="clear"></div>
<?php
/**
<?php
/**
* Fires after the upload button in the media upload interface.
*
* @since 2.6.0
*/
do_action( 'post-html-upload-ui' );
?>
do_action( 'post-html-upload-ui' );
?>
</div>
<p class="max-upload-size"><?php printf( __( 'Maximum upload file size: %s.' ), esc_html( size_format( $max_upload_size ) ) ); ?></p>
<?php
<?php
/**
* Fires on the post upload UI screen.
@ -2148,16 +2157,16 @@ function media_upload_type_form( $type = 'file', $errors = null, $id = null ) {
if ( get_user_setting( 'uploader' ) ) {
$form_class .= ' html-uploader';
}
?>
?>
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
<?php submit_button( '', 'hidden', 'save', false ); ?>
<?php submit_button( '', 'hidden', 'save', false ); ?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<?php wp_nonce_field( 'media-form' ); ?>
<?php wp_nonce_field( 'media-form' ); ?>
<h3 class="media-title"><?php _e( 'Add media files from your computer' ); ?></h3>
<?php media_upload_form( $errors ); ?>
<?php media_upload_form( $errors ); ?>
<script type="text/javascript">
jQuery(function($){
@ -2169,9 +2178,9 @@ jQuery(function($){
});
</script>
<div id="media-items">
<?php
<?php
if ( $id ) {
if ( $id ) {
if ( ! is_wp_error( $id ) ) {
add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 );
echo get_media_items( $id, $errors );
@ -2179,15 +2188,15 @@ if ( $id ) {
echo '<div id="media-upload-error">' . esc_html( $id->get_error_message() ) . '</div></div>';
exit;
}
}
?>
}
?>
</div>
<p class="savebutton ml-submit">
<?php submit_button( __( 'Save all changes' ), '', 'save', false ); ?>
<?php submit_button( __( 'Save all changes' ), '', 'save', false ); ?>
</p>
</form>
<?php
<?php
}
/**
@ -2216,11 +2225,11 @@ function media_upload_type_url_form( $type = null, $errors = null, $id = null )
if ( get_user_setting( 'uploader' ) ) {
$form_class .= ' html-uploader';
}
?>
?>
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="<?php echo $type; ?>-form">
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<?php wp_nonce_field( 'media-form' ); ?>
<?php wp_nonce_field( 'media-form' ); ?>
<h3 class="media-title"><?php _e( 'Insert media from another website' ); ?></h3>
@ -2240,9 +2249,9 @@ var addExtImage = {
if ( f.alt.value )
alt = f.alt.value.replace(/'/g, '&#039;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
<?php
<?php
/** This filter is documented in wp-admin/includes/media.php */
if ( ! apply_filters( 'disable_captions', '' ) ) {
if ( ! apply_filters( 'disable_captions', '' ) ) {
?>
if ( f.caption.value ) {
caption = f.caption.value.replace(/\r\n|\r/g, '\n');
@ -2252,7 +2261,7 @@ if ( ! apply_filters( 'disable_captions', '' ) ) {
caption = caption.replace(/\s*\n\s*/g, '<br />');
}
<?php } ?>
<?php } ?>
cls = caption ? '' : ' class="'+t.align+'"';
@ -2318,20 +2327,20 @@ jQuery(document).ready( function($) {
<div id="media-items">
<div class="media-item media-blank">
<?php
/**
<?php
/**
* Filters the insert media from URL form HTML.
*
* @since 3.3.0
*
* @param string $form_html The insert from URL form HTML.
*/
echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );
?>
echo apply_filters( 'type_url_form_media', wp_media_insert_url_form( $type ) );
?>
</div>
</div>
</form>
<?php
<?php
}
/**
@ -2360,7 +2369,7 @@ function media_upload_gallery_form( $errors ) {
if ( get_user_setting( 'uploader' ) ) {
$form_class .= ' html-uploader';
}
?>
?>
<script type="text/javascript">
jQuery(function($){
@ -2373,18 +2382,18 @@ jQuery(function($){
</script>
<div id="sort-buttons" class="hide-if-no-js">
<span>
<?php _e( 'All Tabs:' ); ?>
<?php _e( 'All Tabs:' ); ?>
<a href="#" id="showall"><?php _e( 'Show' ); ?></a>
<a href="#" id="hideall" style="display:none;"><?php _e( 'Hide' ); ?></a>
</span>
<?php _e( 'Sort Order:' ); ?>
<?php _e( 'Sort Order:' ); ?>
<a href="#" id="asc"><?php _e( 'Ascending' ); ?></a> |
<a href="#" id="desc"><?php _e( 'Descending' ); ?></a> |
<a href="#" id="clear"><?php _ex( 'Clear', 'verb' ); ?></a>
</div>
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="gallery-form">
<?php wp_nonce_field( 'media-form' ); ?>
<?php //media_upload_form( $errors ); ?>
<?php wp_nonce_field( 'media-form' ); ?>
<?php //media_upload_form( $errors ); ?>
<table class="widefat">
<thead><tr>
<th><?php _e( 'Media' ); ?></th>
@ -2393,19 +2402,23 @@ jQuery(function($){
</tr></thead>
</table>
<div id="media-items">
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
<?php echo get_media_items( $post_id, $errors ); ?>
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
<?php echo get_media_items( $post_id, $errors ); ?>
</div>
<p class="ml-submit">
<?php
submit_button(
__( 'Save all changes' ), 'savebutton', 'save', false, array(
<?php
submit_button(
__( 'Save all changes' ),
'savebutton',
'save',
false,
array(
'id' => 'save-all',
'style' => 'display: none;',
)
);
?>
);
?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<input type="hidden" name="type" value="<?php echo esc_attr( $GLOBALS['type'] ); ?>" />
<input type="hidden" name="tab" value="<?php echo esc_attr( $GLOBALS['tab'] ); ?>" />
@ -2488,7 +2501,7 @@ submit_button(
</p>
</div>
</form>
<?php
<?php
}
/**
@ -2534,7 +2547,7 @@ function media_upload_library_form( $errors ) {
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query( $q );
?>
?>
<form id="filter" method="get">
<input type="hidden" name="type" value="<?php echo esc_attr( $type ); ?>" />
@ -2550,11 +2563,11 @@ function media_upload_library_form( $errors ) {
</p>
<ul class="subsubsub">
<?php
$type_links = array();
$_num_posts = (array) wp_count_attachments();
$matches = wp_match_mime_types( array_keys( $post_mime_types ), array_keys( $_num_posts ) );
foreach ( $matches as $_type => $reals ) {
<?php
$type_links = array();
$_num_posts = (array) wp_count_attachments();
$matches = wp_match_mime_types( array_keys( $post_mime_types ), array_keys( $_num_posts ) );
foreach ( $matches as $_type => $reals ) {
foreach ( $reals as $real ) {
if ( isset( $num_posts[ $_type ] ) ) {
$num_posts[ $_type ] += $_num_posts[ $real ];
@ -2562,18 +2575,18 @@ foreach ( $matches as $_type => $reals ) {
$num_posts[ $_type ] = $_num_posts[ $real ];
}
}
}
// If available type specified by media button clicked, filter by that type
if ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) {
}
// If available type specified by media button clicked, filter by that type
if ( empty( $_GET['post_mime_type'] ) && ! empty( $num_posts[ $type ] ) ) {
$_GET['post_mime_type'] = $type;
list($post_mime_types, $avail_post_mime_types) = wp_edit_attachments_query();
}
if ( empty( $_GET['post_mime_type'] ) || $_GET['post_mime_type'] == 'all' ) {
}
if ( empty( $_GET['post_mime_type'] ) || $_GET['post_mime_type'] == 'all' ) {
$class = ' class="current"';
} else {
} else {
$class = '';
}
$type_links[] = '<li><a href="' . esc_url(
}
$type_links[] = '<li><a href="' . esc_url(
add_query_arg(
array(
'post_mime_type' => 'all',
@ -2581,8 +2594,8 @@ $type_links[] = '<li><a href="' . esc_url(
'm' => false,
)
)
) . '"' . $class . '>' . __( 'All Types' ) . '</a>';
foreach ( $post_mime_types as $mime_type => $label ) {
) . '"' . $class . '>' . __( 'All Types' ) . '</a>';
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';
if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {
@ -2601,8 +2614,8 @@ foreach ( $post_mime_types as $mime_type => $label ) {
)
)
) . '"' . $class . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[ $mime_type ] ), '<span id="' . $mime_type . '-counter">' . number_format_i18n( $num_posts[ $mime_type ] ) . '</span>' ) . '</a>';
}
/**
}
/**
* Filters the media upload mime type list items.
*
* Returned values should begin with an `<li>` tag.
@ -2611,15 +2624,15 @@ foreach ( $post_mime_types as $mime_type => $label ) {
*
* @param string[] $type_links An array of list items containing mime type link HTML.
*/
echo implode( ' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';
unset( $type_links );
?>
echo implode( ' | </li>', apply_filters( 'media_upload_mime_type_links', $type_links ) ) . '</li>';
unset( $type_links );
?>
</ul>
<div class="tablenav">
<?php
$page_links = paginate_links(
<?php
$page_links = paginate_links(
array(
'base' => add_query_arg( 'paged', '%#%' ),
'format' => '',
@ -2628,29 +2641,29 @@ $page_links = paginate_links(
'total' => ceil( $wp_query->found_posts / 10 ),
'current' => $q['paged'],
)
);
);
if ( $page_links ) {
if ( $page_links ) {
echo "<div class='tablenav-pages'>$page_links</div>";
}
?>
}
?>
<div class="alignleft actions">
<?php
<?php
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
$arc_query = "SELECT DISTINCT YEAR(post_date) AS yyear, MONTH(post_date) AS mmonth FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_date DESC";
$arc_result = $wpdb->get_results( $arc_query );
$arc_result = $wpdb->get_results( $arc_query );
$month_count = count( $arc_result );
$selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0;
$month_count = count( $arc_result );
$selected_month = isset( $_GET['m'] ) ? $_GET['m'] : 0;
if ( $month_count && ! ( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
?>
if ( $month_count && ! ( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
?>
<select name='m'>
<option<?php selected( $selected_month, 0 ); ?> value='0'><?php _e( 'All dates' ); ?></option>
<?php
foreach ( $arc_result as $arc_row ) {
<?php
foreach ( $arc_result as $arc_row ) {
if ( $arc_row->yyear == 0 ) {
continue;
}
@ -2665,12 +2678,12 @@ foreach ( $arc_result as $arc_row ) {
echo "<option$default value='" . esc_attr( $arc_row->yyear . $arc_row->mmonth ) . "'>";
echo esc_html( $wp_locale->get_month( $arc_row->mmonth ) . " $arc_row->yyear" );
echo "</option>\n";
}
?>
}
?>
</select>
<?php } ?>
<?php } ?>
<?php submit_button( __( 'Filter &#187;' ), '', 'post-query-submit', false ); ?>
<?php submit_button( __( 'Filter &#187;' ), '', 'post-query-submit', false ); ?>
</div>
@ -2680,8 +2693,8 @@ foreach ( $arc_result as $arc_row ) {
<form enctype="multipart/form-data" method="post" action="<?php echo esc_url( $form_action_url ); ?>" class="<?php echo $form_class; ?>" id="library-form">
<?php wp_nonce_field( 'media-form' ); ?>
<?php //media_upload_form( $errors ); ?>
<?php wp_nonce_field( 'media-form' ); ?>
<?php //media_upload_form( $errors ); ?>
<script type="text/javascript">
<!--
@ -2696,15 +2709,15 @@ jQuery(function($){
</script>
<div id="media-items">
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
<?php echo get_media_items( null, $errors ); ?>
<?php add_filter( 'attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2 ); ?>
<?php echo get_media_items( null, $errors ); ?>
</div>
<p class="ml-submit">
<?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false ); ?>
<?php submit_button( __( 'Save all changes' ), 'savebutton', 'save', false ); ?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
</p>
</form>
<?php
<?php
}
/**
@ -2868,15 +2881,15 @@ function media_upload_max_image_resize() {
$a = '<a href="' . esc_url( admin_url( 'options-media.php' ) ) . '" target="_blank">';
$end = '</a>';
}
?>
?>
<p class="hide-if-no-js"><label>
<input name="image_resize" type="checkbox" id="image_resize" value="true"<?php echo $checked; ?> />
<?php
<?php
/* translators: 1: link start tag, 2: link end tag, 3: width, 4: height */
printf( __( 'Scale images to match the large size selected in %1$simage options%2$s (%3$d &times; %4$d).' ), $a, $end, (int) get_option( 'large_size_w', '1024' ), (int) get_option( 'large_size_h', '1024' ) );
?>
?>
</label></p>
<?php
<?php
}
/**
@ -2937,7 +2950,7 @@ function edit_form_image_editor( $post ) {
<?php
if ( $open ) {
wp_image_editor( $attachment_id );}
?>
?>
</div>
<?php
elseif ( $attachment_id && wp_attachment_is( 'audio', $post ) ) :
@ -3055,7 +3068,7 @@ function attachment_submitbox_metadata() {
$media_dims = apply_filters( 'media_meta', $media_dims, $post );
$att_url = wp_get_attachment_url( $post->ID );
?>
?>
<div class="misc-pub-section misc-pub-attachment">
<label for="attachment_url"><?php _e( 'File URL:' ); ?></label>
<input type="text" class="widefat urlfield" readonly="readonly" name="attachment_url" id="attachment_url" value="<?php echo esc_attr( $att_url ); ?>" />
@ -3179,7 +3192,7 @@ function attachment_submitbox_metadata() {
<div class="misc-pub-section misc-pub-dimensions">
<?php _e( 'Dimensions:' ); ?> <strong><?php echo $media_dims; ?></strong>
</div>
<?php
<?php
endif;
}

View File

@ -25,25 +25,25 @@ function post_submit_meta_box( $post, $args = array() ) {
$post_type = $post->post_type;
$post_type_object = get_post_type_object( $post_type );
$can_publish = current_user_can( $post_type_object->cap->publish_posts );
?>
?>
<div class="submitbox" id="submitpost">
<div id="minor-publishing">
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
<?php submit_button( __( 'Save' ), '', 'save' ); ?>
<?php submit_button( __( 'Save' ), '', 'save' ); ?>
</div>
<div id="minor-publishing-actions">
<div id="save-action">
<?php
if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) {
<?php
if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) {
$private_style = '';
if ( 'private' == $post->post_status ) {
$private_style = 'style="display:none"';
}
?>
?>
<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e( 'Save Draft' ); ?>" class="button" />
<span class="spinner"></span>
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
@ -51,44 +51,44 @@ if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pendi
<span class="spinner"></span>
<?php } ?>
</div>
<?php if ( is_post_type_viewable( $post_type_object ) ) : ?>
<?php if ( is_post_type_viewable( $post_type_object ) ) : ?>
<div id="preview-action">
<?php
$preview_link = esc_url( get_preview_post_link( $post ) );
if ( 'publish' == $post->post_status ) {
<?php
$preview_link = esc_url( get_preview_post_link( $post ) );
if ( 'publish' == $post->post_status ) {
$preview_button_text = __( 'Preview Changes' );
} else {
} else {
$preview_button_text = __( 'Preview' );
}
}
$preview_button = sprintf(
$preview_button = sprintf(
'%1$s<span class="screen-reader-text"> %2$s</span>',
$preview_button_text,
/* translators: accessibility text */
__( '(opens in a new tab)' )
);
?>
);
?>
<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>
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
</div>
<?php endif; // public post type ?>
<?php
/**
<?php
/**
* Fires before the post time/date setting in the Publish meta box.
*
* @since 4.4.0
*
* @param WP_Post $post WP_Post object for the current post.
*/
do_action( 'post_submitbox_minor_actions', $post );
?>
do_action( 'post_submitbox_minor_actions', $post );
?>
<div class="clear"></div>
</div><!-- #minor-publishing-actions -->
<div id="misc-publishing-actions">
<div class="misc-pub-section misc-pub-post-status">
<?php _e( 'Status:' ); ?> <span id="post-status-display">
<?php _e( 'Status:' ); ?> <span id="post-status-display">
<?php
switch ( $post->post_status ) {
@ -109,22 +109,22 @@ do_action( 'post_submitbox_minor_actions', $post );
_e( 'Draft' );
break;
}
?>
?>
</span>
<?php
if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) {
<?php
if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) {
$private_style = '';
if ( 'private' == $post->post_status ) {
$private_style = 'style="display:none"';
}
?>
?>
<a href="#post_status" <?php echo $private_style; ?> class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
<div id="post-status-select" class="hide-if-js">
<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 ); ?>" />
<label for="post_status" class="screen-reader-text"><?php _e( 'Set status' ); ?></label>
<select name="post_status" id="post_status">
<?php if ( 'publish' == $post->post_status ) : ?>
<?php if ( 'publish' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e( 'Published' ); ?></option>
<?php elseif ( 'private' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e( 'Privately Published' ); ?></option>
@ -132,7 +132,7 @@ if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e( 'Scheduled' ); ?></option>
<?php endif; ?>
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e( 'Pending Review' ); ?></option>
<?php if ( 'auto-draft' == $post->post_status ) : ?>
<?php if ( 'auto-draft' == $post->post_status ) : ?>
<option<?php selected( $post->post_status, 'auto-draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
<?php else : ?>
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e( 'Draft' ); ?></option>
@ -146,7 +146,7 @@ if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_
</div><!-- .misc-pub-section -->
<div class="misc-pub-section misc-pub-visibility" id="visibility">
<?php _e( 'Visibility:' ); ?> <span id="post-visibility-display">
<?php _e( 'Visibility:' ); ?> <span id="post-visibility-display">
<?php
if ( 'private' == $post->post_status ) {
@ -165,19 +165,19 @@ if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_
}
echo esc_html( $visibility_trans );
?>
?>
</span>
<?php if ( $can_publish ) { ?>
<?php if ( $can_publish ) { ?>
<a href="#visibility" class="edit-visibility hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit visibility' ); ?></span></a>
<div id="post-visibility-select" class="hide-if-js">
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo esc_attr( $post->post_password ); ?>" />
<?php if ( $post_type == 'post' ) : ?>
<?php if ( $post_type == 'post' ) : ?>
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> />
<?php endif; ?>
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo esc_attr( $visibility ); ?>" />
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e( 'Public' ); ?></label><br />
<?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>
<?php if ( $post_type == 'post' && current_user_can( 'edit_others_posts' ) ) : ?>
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked( is_sticky( $post->ID ) ); ?> /> <label for="sticky" class="selectit"><?php _e( 'Stick this post to the front page' ); ?></label><br /></span>
<?php endif; ?>
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e( 'Password protected' ); ?></label><br />
@ -193,10 +193,10 @@ if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_
</div><!-- .misc-pub-section -->
<?php
/* translators: Publish box date format, see https://secure.php.net/date */
$datef = __( 'M j, Y @ H:i' );
if ( 0 != $post->ID ) {
<?php
/* translators: Publish box date format, see https://secure.php.net/date */
$datef = __( 'M j, Y @ H:i' );
if ( 0 != $post->ID ) {
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
/* translators: Post date information. %s: Date on which the post is currently scheduled to be published */
$stamp = __( 'Scheduled for: <b>%s</b>' );
@ -213,13 +213,13 @@ if ( 0 != $post->ID ) {
$stamp = __( 'Publish on: <b>%s</b>' );
}
$date = date_i18n( $datef, strtotime( $post->post_date ) );
} else { // draft (no saves, and thus no date specified)
} else { // draft (no saves, and thus no date specified)
$stamp = __( 'Publish <b>immediately</b>' );
$date = date_i18n( $datef, strtotime( current_time( 'mysql' ) ) );
}
}
if ( ! empty( $args['args']['revisions_count'] ) ) :
?>
if ( ! empty( $args['args']['revisions_count'] ) ) :
?>
<div class="misc-pub-section misc-pub-revisions">
<?php
/* translators: Post revisions heading. %s: The number of available revisions */
@ -227,11 +227,11 @@ if ( ! empty( $args['args']['revisions_count'] ) ) :
?>
<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>
</div>
<?php
<?php
endif;
if ( $can_publish ) : // Contributors don't get to choose the date of publish
?>
if ( $can_publish ) : // Contributors don't get to choose the date of publish
?>
<div class="misc-pub-section curtime misc-pub-curtime">
<span id="timestamp">
<?php printf( $stamp, $date ); ?></span>
@ -243,7 +243,7 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish
</div><?php // /misc-pub-section ?>
<?php endif; ?>
<?php if ( 'draft' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?>
<?php if ( 'draft' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?>
<div class="notice notice-info notice-alt inline">
<p>
<?php
@ -261,10 +261,10 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish
?>
</p>
</div>
<?php endif; ?>
<?php endif; ?>
<?php
/**
<?php
/**
* Fires after the post time/date setting in the Publish meta box.
*
* @since 2.9.0
@ -272,15 +272,15 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish
*
* @param WP_Post $post WP_Post object for the current post.
*/
do_action( 'post_submitbox_misc_actions', $post );
?>
do_action( 'post_submitbox_misc_actions', $post );
?>
</div>
<div class="clear"></div>
</div>
<div id="major-publishing-actions">
<?php
/**
<?php
/**
* Fires at the beginning of the publishing actions section of the Publish meta box.
*
* @since 2.7.0
@ -289,11 +289,11 @@ do_action( 'post_submitbox_misc_actions', $post );
* @param WP_Post|null $post WP_Post object for the current post on Edit Post screen,
* null on Edit Link screen.
*/
do_action( 'post_submitbox_start', $post );
?>
do_action( 'post_submitbox_start', $post );
?>
<div id="delete-action">
<?php
if ( current_user_can( 'delete_post', $post->ID ) ) {
<?php
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( ! EMPTY_TRASH_DAYS ) {
$delete_text = __( 'Delete Permanently' );
} else {
@ -302,43 +302,43 @@ if ( current_user_can( 'delete_post', $post->ID ) ) {
?>
<a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>"><?php echo $delete_text; ?></a>
<?php
}
?>
}
?>
</div>
<div id="publishing-action">
<span class="spinner"></span>
<?php
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) {
<?php
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) {
if ( $can_publish ) :
if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :
?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php echo esc_attr_x( 'Schedule', 'post action/button label' ); ?>" />
<?php submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?>
<?php else : ?>
<?php else : ?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Publish' ); ?>" />
<?php submit_button( __( 'Publish' ), 'primary large', 'publish', false ); ?>
<?php
endif;
<?php
endif;
else :
?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Submit for Review' ); ?>" />
<?php submit_button( __( 'Submit for Review' ), 'primary large', 'publish', false ); ?>
<?php
<?php
endif;
} else {
?>
} else {
?>
<input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr_e( 'Update' ); ?>" />
<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update' ); ?>" />
<?php
}
?>
<?php
}
?>
</div>
<div class="clear"></div>
</div>
</div>
<?php
<?php
}
/**
@ -349,14 +349,14 @@ endif;
* @param object $post
*/
function attachment_submit_meta_box( $post ) {
?>
?>
<div class="submitbox" id="submitpost">
<div id="minor-publishing">
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
<?php submit_button( __( 'Save' ), '', 'save' ); ?>
<?php submit_button( __( 'Save' ), '', 'save' ); ?>
</div>
@ -418,7 +418,7 @@ function attachment_submit_meta_box( $post ) {
</div>
<?php
<?php
}
/**
@ -501,7 +501,7 @@ function post_tags_meta_box( $post, $box ) {
if ( ! is_string( $terms_to_edit ) ) {
$terms_to_edit = '';
}
?>
?>
<div class="tagsdiv" id="<?php echo $tax_name; ?>">
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
@ -521,10 +521,10 @@ function post_tags_meta_box( $post, $box ) {
</div>
<ul class="tagchecklist" role="list"></ul>
</div>
<?php if ( $user_can_assign_terms ) : ?>
<?php if ( $user_can_assign_terms ) : ?>
<p class="hide-if-no-js"><button type="button" class="button-link tagcloud-link" id="link-<?php echo $tax_name; ?>" aria-expanded="false"><?php echo $taxonomy->labels->choose_from_most_used; ?></button></p>
<?php endif; ?>
<?php
<?php
}
/**
@ -579,12 +579,13 @@ function post_categories_meta_box( $post, $box ) {
<ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear">
<?php
wp_terms_checklist(
$post->ID, array(
$post->ID,
array(
'taxonomy' => $tax_name,
'popular_cats' => $popular_ids,
)
);
?>
?>
</ul>
</div>
<?php if ( current_user_can( $taxonomy->cap->edit_terms ) ) : ?>
@ -657,18 +658,18 @@ function post_categories_meta_box( $post, $box ) {
* @param object $post
*/
function post_excerpt_meta_box( $post ) {
?>
?>
<label class="screen-reader-text" for="excerpt"><?php _e( 'Excerpt' ); ?></label><textarea rows="1" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
<p>
<?php
<?php
printf(
/* translators: %s: Codex URL */
__( 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="%s">Learn more about manual excerpts</a>.' ),
__( 'https://codex.wordpress.org/Excerpt' )
);
?>
?>
</p>
<?php
<?php
}
/**
@ -690,25 +691,25 @@ function post_trackback_meta_box( $post ) {
$pings .= '</ul>';
}
?>
?>
<p>
<label for="trackback_url"><?php _e( 'Send trackbacks to:' ); ?></label>
<?php echo $form_trackback; ?>
</p>
<p id="trackback-url-desc" class="howto"><?php _e( 'Separate multiple URLs with spaces' ); ?></p>
<p>
<?php
<?php
printf(
/* translators: %s: Codex URL */
__( 'Trackbacks are a way to notify legacy blog systems that you&#8217;ve linked to them. If you link other WordPress sites, they&#8217;ll be notified automatically using <a href="%s">pingbacks</a>, no other action necessary.' ),
__( 'https://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments' )
);
?>
?>
</p>
<?php
if ( ! empty( $pings ) ) {
<?php
if ( ! empty( $pings ) ) {
echo $pings;
}
}
}
/**
@ -719,30 +720,30 @@ if ( ! empty( $pings ) ) {
* @param object $post
*/
function post_custom_meta_box( $post ) {
?>
?>
<div id="postcustomstuff">
<div id="ajax-response"></div>
<?php
$metadata = has_meta( $post->ID );
foreach ( $metadata as $key => $value ) {
<?php
$metadata = has_meta( $post->ID );
foreach ( $metadata as $key => $value ) {
if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) {
unset( $metadata[ $key ] );
}
}
list_meta( $metadata );
meta_form( $post );
?>
}
list_meta( $metadata );
meta_form( $post );
?>
</div>
<p>
<?php
<?php
printf(
/* translators: %s: Codex URL */
__( 'Custom fields can be used to add extra metadata to a post that you can <a href="%s">use in your theme</a>.' ),
__( 'https://codex.wordpress.org/Using_Custom_Fields' )
);
?>
?>
</p>
<?php
<?php
}
/**
@ -753,7 +754,7 @@ meta_form( $post );
* @param object $post
*/
function post_comment_status_meta_box( $post ) {
?>
?>
<input name="advanced_view" type="hidden" value="1" />
<p class="meta-options">
<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 />
@ -777,7 +778,7 @@ function post_comment_status_meta_box( $post ) {
do_action( 'post_comment_status_meta_box-options', $post );
?>
</p>
<?php
<?php
}
/**
@ -844,9 +845,9 @@ function post_comment_meta_box( $post ) {
function post_slug_meta_box( $post ) {
/** This filter is documented in wp-admin/edit-tag-form.php */
$editable_slug = apply_filters( 'editable_slug', $post->post_name, $post );
?>
?>
<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( $editable_slug ); ?>" />
<?php
<?php
}
/**
@ -860,9 +861,9 @@ function post_slug_meta_box( $post ) {
*/
function post_author_meta_box( $post ) {
global $user_ID;
?>
?>
<label class="screen-reader-text" for="post_author_override"><?php _e( 'Author' ); ?></label>
<?php
<?php
wp_dropdown_users(
array(
'who' => 'authors',
@ -919,10 +920,10 @@ function page_attributes_meta_box( $post ) {
$dropdown_args = apply_filters( 'page_attributes_dropdown_pages_args', $dropdown_args, $post );
$pages = wp_dropdown_pages( $dropdown_args );
if ( ! empty( $pages ) ) :
?>
?>
<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p>
<?php echo $pages; ?>
<?php
<?php echo $pages; ?>
<?php
endif; // end empty pages check
endif; // end hierarchical check.
@ -930,8 +931,8 @@ function page_attributes_meta_box( $post ) {
$template = ! empty( $post->page_template ) ? $post->page_template : false;
?>
<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label>
<?php
/**
<?php
/**
* Fires immediately after the label inside the 'Template' section
* of the 'Page Attributes' meta box.
*
@ -940,12 +941,12 @@ function page_attributes_meta_box( $post ) {
* @param string $template The template used for the current post.
* @param WP_Post $post The current post.
*/
do_action( 'page_attributes_meta_box_template', $template, $post );
?>
do_action( 'page_attributes_meta_box_template', $template, $post );
?>
</p>
<select name="page_template" id="page_template">
<?php
/**
<?php
/**
* Filters the title of the default page template displayed in the drop-down.
*
* @since 4.1.0
@ -954,29 +955,29 @@ do_action( 'page_attributes_meta_box_template', $template, $post );
* @param string $context Where the option label is displayed. Possible values
* include 'meta-box' or 'quick-edit'.
*/
$default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' );
?>
$default_title = apply_filters( 'default_page_template_title', __( 'Default Template' ), 'meta-box' );
?>
<option value="default"><?php echo esc_html( $default_title ); ?></option>
<?php page_template_dropdown( $template, $post->post_type ); ?>
<?php page_template_dropdown( $template, $post->post_type ); ?>
</select>
<?php endif; ?>
<?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>
<?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?>
<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p>
<input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" />
<?php
/**
<?php
/**
* Fires before the help hint text in the 'Page Attributes' meta box.
*
* @since 4.9.0
*
* @param WP_Post $post The current post.
*/
do_action( 'page_attributes_misc_attributes', $post );
?>
<?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?>
do_action( 'page_attributes_misc_attributes', $post );
?>
<?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?>
<p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p>
<?php
endif;
<?php
endif;
endif;
}
@ -990,19 +991,19 @@ endif;
* @param object $link
*/
function link_submit_meta_box( $link ) {
?>
?>
<div class="submitbox" id="submitlink">
<div id="minor-publishing">
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
<div style="display:none;">
<?php submit_button( __( 'Save' ), '', 'save', false ); ?>
<?php submit_button( __( 'Save' ), '', 'save', false ); ?>
</div>
<div id="minor-publishing-actions">
<div id="preview-action">
<?php if ( ! empty( $link->link_id ) ) { ?>
<?php if ( ! empty( $link->link_id ) ) { ?>
<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e( 'Visit Link' ); ?></a>
<?php } ?>
</div>
@ -1018,20 +1019,20 @@ function link_submit_meta_box( $link ) {
</div>
<div id="major-publishing-actions">
<?php
/** This action is documented in wp-admin/includes/meta-boxes.php */
do_action( 'post_submitbox_start', null );
?>
<?php
/** This action is documented in wp-admin/includes/meta-boxes.php */
do_action( 'post_submitbox_start', null );
?>
<div id="delete-action">
<?php
if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) {
?>
<?php
if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can( 'manage_links' ) ) {
?>
<a class="submitdelete deletion" href="<?php echo wp_nonce_url( "link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ); ?>" onclick="if ( confirm('<?php echo esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ); ?>') ) {return true;}return false;"><?php _e( 'Delete' ); ?></a>
<?php } ?>
</div>
<div id="publishing-action">
<?php if ( ! empty( $link->link_id ) ) { ?>
<?php if ( ! empty( $link->link_id ) ) { ?>
<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Update Link' ); ?>" />
<?php } else { ?>
<input name="save" type="submit" class="button button-primary button-large" id="publish" value="<?php esc_attr_e( 'Add Link' ); ?>" />
@ -1039,17 +1040,17 @@ if ( ! empty( $_GET['action'] ) && 'edit' == $_GET['action'] && current_user_can
</div>
<div class="clear"></div>
</div>
<?php
/**
<?php
/**
* Fires at the end of the Publish box in the Link editing screen.
*
* @since 2.5.0
*/
do_action( 'submitlink_box' );
?>
do_action( 'submitlink_box' );
?>
<div class="clear"></div>
</div>
<?php
<?php
}
/**
@ -1060,7 +1061,7 @@ do_action( 'submitlink_box' );
* @param object $link
*/
function link_categories_meta_box( $link ) {
?>
?>
<div id="taxonomy-linkcategory" class="categorydiv">
<ul id="category-tabs" class="category-tabs">
<li class="tabs"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
@ -1096,7 +1097,7 @@ function link_categories_meta_box( $link ) {
</p>
</div>
</div>
<?php
<?php
}
/**
@ -1108,20 +1109,20 @@ function link_categories_meta_box( $link ) {
*/
function link_target_meta_box( $link ) {
?>
?>
<fieldset><legend class="screen-reader-text"><span><?php _e( 'Target' ); ?></span></legend>
<p><label for="link_target_blank" class="selectit">
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_blank' ) ? 'checked="checked"' : '' ); ?> />
<?php _e( '<code>_blank</code> &mdash; new window or tab.' ); ?></label></p>
<?php _e( '<code>_blank</code> &mdash; new window or tab.' ); ?></label></p>
<p><label for="link_target_top" class="selectit">
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '_top' ) ? 'checked="checked"' : '' ); ?> />
<?php _e( '<code>_top</code> &mdash; current window or tab, with no frames.' ); ?></label></p>
<?php _e( '<code>_top</code> &mdash; current window or tab, with no frames.' ); ?></label></p>
<p><label for="link_target_none" class="selectit">
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ( $link->link_target == '' ) ? 'checked="checked"' : '' ); ?> />
<?php _e( '<code>_none</code> &mdash; same window or tab.' ); ?></label></p>
<?php _e( '<code>_none</code> &mdash; same window or tab.' ); ?></label></p>
</fieldset>
<p><?php _e( 'Choose the target frame for your link.' ); ?></p>
<?php
<?php
}
/**
@ -1173,7 +1174,7 @@ function xfn_check( $class, $value = '', $deprecated = '' ) {
* @param object $link
*/
function link_xfn_meta_box( $link ) {
?>
?>
<table class="links-table">
<tr>
<th scope="row"><label for="link_rel"><?php /* translators: xfn: http://gmpg.org/xfn/ */ _e( 'rel:' ); ?></label></th>
@ -1280,7 +1281,7 @@ function link_xfn_meta_box( $link ) {
</table>
<p><?php _e( 'If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.' ); ?></p>
<?php
<?php
}
/**
@ -1291,7 +1292,7 @@ function link_xfn_meta_box( $link ) {
* @param object $link
*/
function link_advanced_meta_box( $link ) {
?>
?>
<table class="links-table" cellpadding="0">
<tr>
<th scope="row"><label for="link_image"><?php _e( 'Image Address' ); ?></label></th>
@ -1321,7 +1322,7 @@ function link_advanced_meta_box( $link ) {
</td>
</tr>
</table>
<?php
<?php
}
/**

View File

@ -165,7 +165,8 @@ function insert_with_markers( $filename, $marker, $insertion ) {
// Generate the new file data
$new_file_data = implode(
"\n", array_merge(
"\n",
array_merge(
$pre_lines,
array( $start_marker ),
$insertion,
@ -855,7 +856,8 @@ function admin_color_scheme_picker( $user_id ) {
array(
'fresh' => '',
'light' => '',
), $_wp_admin_css_colors
),
$_wp_admin_css_colors
)
);
}
@ -1147,7 +1149,7 @@ function wp_admin_canonical_url() {
window.history.replaceState( null, null, document.getElementById( 'wp-admin-canonical' ).href + window.location.hash );
}
</script>
<?php
<?php
}
/**
@ -1428,13 +1430,15 @@ final class WP_Privacy_Policy_Content {
?>
<div class="policy-text-updated notice notice-warning">
<p><?php
<p>
<?php
printf(
/* translators: %s: Privacy Policy Guide URL */
__( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
esc_url( admin_url( 'tools.php?wp-privacy-policy-guide=1' ) )
);
?></p>
?>
</p>
</div>
<?php
}

View File

@ -961,11 +961,11 @@ function can_edit_network( $network_id ) {
* @access private
*/
function _thickbox_path_admin_subfolder() {
?>
?>
<script type="text/javascript">
var tb_pathToImage = "<?php echo includes_url( 'js/thickbox/loadingAnimation.gif', 'relative' ); ?>";
</script>
<?php
<?php
}
/**
@ -1084,7 +1084,7 @@ function confirm_delete_users( $users ) {
endif;
submit_button( __( 'Confirm Deletion' ), 'primary' );
?>
?>
</form>
<?php
return true;
@ -1096,7 +1096,7 @@ function confirm_delete_users( $users ) {
* @since 4.1.0
*/
function network_settings_add_js() {
?>
?>
<script type="text/javascript">
jQuery(document).ready( function($) {
var languageSelect = $( '#WPLANG' );
@ -1109,7 +1109,7 @@ jQuery(document).ready( function($) {
});
});
</script>
<?php
<?php
}
/**
@ -1147,7 +1147,8 @@ function network_edit_site_nav( $args = array() ) {
* }
*/
$links = apply_filters(
'network_edit_site_nav_links', array(
'network_edit_site_nav_links',
array(
'site-info' => array(
'label' => __( 'Info' ),
'url' => 'site-info.php',
@ -1173,7 +1174,8 @@ function network_edit_site_nav( $args = array() ) {
// Parse arguments
$r = wp_parse_args(
$args, array(
$args,
array(
'blog_id' => isset( $_GET['blog_id'] ) ? (int) $_GET['blog_id'] : 0,
'links' => $links,
'selected' => 'site-info',

View File

@ -105,7 +105,8 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
}
} elseif ( 'taxonomy' == $matches[1] ) {
$terms = get_terms(
$matches[2], array(
$matches[2],
array(
'name__like' => $query,
'number' => 10,
)
@ -149,7 +150,8 @@ function wp_nav_menu_setup() {
if ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
$user = wp_get_current_user();
update_user_option(
$user->ID, 'managenav-menuscolumnshidden',
$user->ID,
'managenav-menuscolumnshidden',
array(
0 => 'link-target',
1 => 'css-classes',
@ -439,7 +441,8 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
<ul id="<?php echo $post_type_name; ?>checklist-most-recent" class="categorychecklist form-no-clear">
<?php
$recent_args = array_merge(
$args, array(
$args,
array(
'orderby' => 'post_date',
'order' => 'DESC',
'posts_per_page' => 15,
@ -530,7 +533,8 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
} else {
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
array_unshift(
$posts, (object) array(
$posts,
(object) array(
'front_or_home' => true,
'ID' => 0,
'object_id' => $_nav_menu_placeholder,
@ -551,7 +555,8 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
if ( $post_type->has_archive ) {
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
array_unshift(
$posts, (object) array(
$posts,
(object) array(
'ID' => 0,
'object_id' => $_nav_menu_placeholder,
'object' => $post_type_name,
@ -677,8 +682,10 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
$num_pages = ceil(
wp_count_terms(
$taxonomy_name, array_merge(
$args, array(
$taxonomy_name,
array_merge(
$args,
array(
'number' => '',
'offset' => '',
)
@ -763,7 +770,8 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
<ul id="<?php echo $taxonomy_name; ?>checklist-pop" class="categorychecklist form-no-clear" >
<?php
$popular_terms = get_terms(
$taxonomy_name, array(
$taxonomy_name,
array(
'orderby' => 'count',
'order' => 'DESC',
'number' => 10,
@ -800,7 +808,8 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
if ( isset( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] ) ) {
$searched = esc_attr( $_REQUEST[ 'quick-search-taxonomy-' . $taxonomy_name ] );
$search_results = get_terms(
$taxonomy_name, array(
$taxonomy_name,
array(
'name__like' => $searched,
'fields' => 'all',
'orderby' => 'count',
@ -1096,7 +1105,8 @@ function _wp_delete_orphaned_draft_menu_items() {
*/
function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) {
$unsorted_menu_items = wp_get_nav_menu_items(
$nav_menu_selected_id, array(
$nav_menu_selected_id,
array(
'orderby' => 'ID',
'output' => ARRAY_A,
'output_key' => 'ID',

View File

@ -250,7 +250,7 @@ function network_step1( $errors = false ) {
</tr>
</table>
<?php
<?php
endif;
if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' && ( allow_subdirectory_install() || ! allow_subdomain_install() ) ) {
@ -411,15 +411,15 @@ function network_step2( $errors = false ) {
} else {
if ( is_multisite() ) {
$subdomain_install = is_subdomain_install();
?>
?>
<p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p>
<?php
<?php
} else {
$subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );
?>
?>
<div class="error"><p><strong><?php _e( 'Warning:' ); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>
<p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>
<?php
<?php
}
}
@ -428,7 +428,7 @@ function network_step2( $errors = false ) {
$subdir_replacement_12 = $subdomain_install ? '$1' : '$2';
if ( $_POST || ! is_multisite() ) {
?>
?>
<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>
<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>
<div class="updated inline"><p>
@ -459,9 +459,9 @@ function network_step2( $errors = false ) {
}
?>
</p></div>
<?php
<?php
}
?>
?>
<ol>
<li><p>
<?php
@ -487,7 +487,7 @@ define('PATH_CURRENT_SITE', '<?php echo $base; ?>');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
</textarea>
<?php
<?php
$keys_salts = array(
'AUTH_KEY' => '',
'SECURE_AUTH_KEY' => '',
@ -498,13 +498,13 @@ define('BLOG_ID_CURRENT_SITE', 1);
'LOGGED_IN_SALT' => '',
'NONCE_SALT' => '',
);
foreach ( $keys_salts as $c => $v ) {
foreach ( $keys_salts as $c => $v ) {
if ( defined( $c ) ) {
unset( $keys_salts[ $c ] );
}
}
}
if ( ! empty( $keys_salts ) ) {
if ( ! empty( $keys_salts ) ) {
$keys_salts_str = '';
$from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
if ( is_wp_error( $from_api ) ) {
@ -518,7 +518,7 @@ if ( ! empty( $keys_salts ) ) {
}
}
$num_keys_salts = count( $keys_salts );
?>
?>
<p>
<?php
if ( 1 == $num_keys_salts ) {
@ -538,12 +538,12 @@ if ( ! empty( $keys_salts ) ) {
<?php _e( 'To make your installation more secure, you should also add:' ); ?>
</p>
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>
<?php
}
?>
<?php
}
?>
</li>
<?php
if ( iis7_supports_permalinks() ) :
<?php
if ( iis7_supports_permalinks() ) :
// IIS doesn't support RewriteBase, all your RewriteBase are belong to us
$iis_subdir_match = ltrim( $base, '/' ) . $subdir_match;
$iis_rewrite_base = ltrim( $base, '/' ) . $rewrite_base;
@ -651,7 +651,7 @@ EOF;
}
?>
<textarea class="code" readonly="readonly" cols="100" rows="<?php echo substr_count( $htaccess_file, "\n" ) + 1; ?>">
<?php echo esc_textarea( $htaccess_file ); ?></textarea></li>
<?php echo esc_textarea( $htaccess_file ); ?></textarea></li>
</ol>
<?php

View File

@ -13,7 +13,7 @@
* @since 4.2.0
*/
function options_discussion_add_js() {
?>
?>
<script>
(function($){
var parent = $( '#show_avatars' ),
@ -23,7 +23,7 @@ function options_discussion_add_js() {
});
})(jQuery);
</script>
<?php
<?php
}
/**
@ -32,7 +32,7 @@ function options_discussion_add_js() {
* @since 3.5.0
*/
function options_general_add_js() {
?>
?>
<script type="text/javascript">
jQuery(document).ready(function($){
var $siteName = $( '#wp-admin-bar-site-name' ).children( 'a' ).first(),
@ -88,7 +88,7 @@ function options_general_add_js() {
});
});
</script>
<?php
<?php
}
/**
@ -97,7 +97,7 @@ function options_general_add_js() {
* @since 3.5.0
*/
function options_reading_add_js() {
?>
?>
<script type="text/javascript">
jQuery(document).ready(function($){
var section = $('#front-static-pages'),
@ -110,7 +110,7 @@ function options_reading_add_js() {
section.find('input:radio').change(check_disabled);
});
</script>
<?php
<?php
}
/**

View File

@ -288,7 +288,8 @@ function install_dashboard() {
$tags[ $tag['name'] ] = (object) $data;
}
echo wp_generate_tag_cloud(
$tags, array(
$tags,
array(
'single_text' => __( '%s plugin' ),
'multiple_text' => __( '%s plugins' ),
)
@ -331,7 +332,7 @@ function install_search_form( $deprecated = true ) {
* @since 2.8.0
*/
function install_plugins_upload() {
?>
?>
<div class="upload-plugin">
<p class="install-help"><?php _e( 'If you have a plugin in a .zip format, you may install it by uploading it here.' ); ?></p>
<form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-plugin' ); ?>">
@ -341,7 +342,7 @@ function install_plugins_upload() {
<?php submit_button( __( 'Install Now' ), '', 'install-plugin-submit', false ); ?>
</form>
</div>
<?php
<?php
}
/**
@ -501,7 +502,8 @@ function install_plugin_information() {
}
$api = plugins_api(
'plugin_information', array(
'plugin_information',
array(
'slug' => wp_unslash( $_REQUEST['plugin'] ),
)
);
@ -690,7 +692,7 @@ function install_plugin_information() {
'number' => $api->num_ratings,
)
);
?>
?>
<p aria-hidden="true" class="fyi-description"><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></p>
<?php
}

View File

@ -239,7 +239,8 @@ function edit_post( $post_data = null ) {
if ( post_type_supports( $ptype->name, 'revisions' ) ) {
$revisions = wp_get_post_revisions(
$post_ID, array(
$post_ID,
array(
'order' => 'ASC',
'posts_per_page' => 1,
)
@ -955,8 +956,10 @@ function has_meta( $postid ) {
$wpdb->prepare(
"SELECT meta_key, meta_value, meta_id, post_id
FROM $wpdb->postmeta WHERE post_id = %d
ORDER BY meta_key,meta_id", $postid
), ARRAY_A
ORDER BY meta_key,meta_id",
$postid
),
ARRAY_A
);
}
@ -1711,7 +1714,7 @@ if ( $override ) {
<?php
}
?>
?>
</p>
</div>
<?php
@ -2002,7 +2005,8 @@ function taxonomy_meta_box_sanitize_cb_input( $taxonomy, $terms ) {
}
$_term = get_terms(
$taxonomy, array(
$taxonomy,
array(
'name' => $term,
'fields' => 'ids',
'hide_empty' => false,

View File

@ -167,7 +167,8 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
$now_gmt = time();
$revisions = wp_get_post_revisions(
$post->ID, array(
$post->ID,
array(
'order' => 'ASC',
'check_enabled' => false,
)
@ -194,7 +195,9 @@ function wp_prepare_revisions_for_js( $post, $selected_revision_id, $from = null
$modified_gmt = strtotime( $revision->post_modified_gmt . ' +0000' );
if ( $can_restore ) {
$restore_link = str_replace(
'&amp;', '&', wp_nonce_url(
'&amp;',
'&',
wp_nonce_url(
add_query_arg(
array(
'revision' => $revision->ID,

View File

@ -1027,7 +1027,8 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
if ( 1 == $network_id ) {
$wpdb->insert(
$wpdb->site, array(
$wpdb->site,
array(
'domain' => $domain,
'path' => $path,
)
@ -1035,7 +1036,8 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
$network_id = $wpdb->insert_id;
} else {
$wpdb->insert(
$wpdb->site, array(
$wpdb->site,
array(
'domain' => $domain,
'path' => $path,
'id' => $network_id,
@ -1179,7 +1181,8 @@ We hope you enjoy your new site. Thanks!
$current_site->path = $path;
$current_site->site_name = ucfirst( $domain );
$wpdb->insert(
$wpdb->blogs, array(
$wpdb->blogs,
array(
'site_id' => $network_id,
'blog_id' => 1,
'domain' => $domain,
@ -1207,7 +1210,8 @@ We hope you enjoy your new site. Thanks!
$errstr = '';
$hostname = substr( md5( time() ), 0, 6 ) . '.' . $domain; // Very random hostname!
$page = wp_remote_get(
'http://' . $hostname, array(
'http://' . $hostname,
array(
'timeout' => 5,
'httpversion' => '1.1',
)

View File

@ -39,7 +39,8 @@ require_once( ABSPATH . 'wp-admin/includes/class-wp-internal-pointers.php' );
*/
function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true ) {
wp_terms_checklist(
$post_id, array(
$post_id,
array(
'taxonomy' => 'category',
'descendants_and_self' => $descendants_and_self,
'selected_cats' => $selected_cats,
@ -128,7 +129,8 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
$args['popular_cats'] = $r['popular_cats'];
} else {
$args['popular_cats'] = get_terms(
$taxonomy, array(
$taxonomy,
array(
'fields' => 'ids',
'orderby' => 'count',
'order' => 'DESC',
@ -139,7 +141,8 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
}
if ( $descendants_and_self ) {
$categories = (array) get_terms(
$taxonomy, array(
$taxonomy,
array(
'child_of' => $descendants_and_self,
'hierarchical' => 0,
'hide_empty' => 0,
@ -204,7 +207,8 @@ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $ech
}
$terms = get_terms(
$taxonomy, array(
$taxonomy,
array(
'orderby' => 'count',
'order' => 'DESC',
'number' => $number,
@ -262,7 +266,8 @@ function wp_link_category_checklist( $link_id = 0 ) {
}
$categories = get_terms(
'link_category', array(
'link_category',
array(
'orderby' => 'name',
'hide_empty' => 0,
)
@ -404,7 +409,9 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
* @param array $args An array of default args.
*/
$content = apply_filters(
'wp_comment_reply', '', array(
'wp_comment_reply',
'',
array(
'position' => $position,
'checkbox' => $checkbox,
'mode' => $mode,
@ -424,9 +431,9 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
}
}
?>
?>
<form method="get">
<?php if ( $table_row ) : ?>
<?php if ( $table_row ) : ?>
<table style="display:none;"><tbody id="com-reply"><tr id="replyrow" class="inline-edit-row" style="display:none;"><td colspan="<?php echo $wp_list_table->get_column_count(); ?>" class="colspanchange">
<?php else : ?>
<div id="com-reply" style="display:none;"><div id="replyrow" style="display:none;">
@ -443,7 +450,9 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
<?php
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
wp_editor(
'', 'replycontent', array(
'',
'replycontent',
array(
'media_buttons' => false,
'tinymce' => false,
'quicktags' => $quicktags_settings,
@ -499,13 +508,13 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
}
?>
</fieldset>
<?php if ( $table_row ) : ?>
<?php if ( $table_row ) : ?>
</td></tr></tbody></table>
<?php else : ?>
<?php else : ?>
</div></div>
<?php endif; ?>
<?php endif; ?>
</form>
<?php
<?php
}
/**
@ -514,14 +523,14 @@ function wp_comment_reply( $position = 1, $checkbox = false, $mode = 'single', $
* @since 2.9.0
*/
function wp_comment_trashnotice() {
?>
?>
<div class="hidden" id="trash-undo-holder">
<div class="trash-undo-inside"><?php printf( __( 'Comment by %s moved to the trash.' ), '<strong></strong>' ); ?> <span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
</div>
<div class="hidden" id="spam-undo-holder">
<div class="spam-undo-inside"><?php printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' ); ?> <span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span></div>
</div>
<?php
<?php
}
/**
@ -549,7 +558,7 @@ function list_meta( $meta ) {
return;
}
$count = 0;
?>
?>
<table id="list-table">
<thead>
<tr>
@ -558,14 +567,14 @@ function list_meta( $meta ) {
</tr>
</thead>
<tbody id='the-list' data-wp-lists='list:meta'>
<?php
foreach ( $meta as $entry ) {
<?php
foreach ( $meta as $entry ) {
echo _list_meta_row( $entry, $count );
}
?>
}
?>
</tbody>
</table>
<?php
<?php
}
/**
@ -676,7 +685,7 @@ function meta_form( $post = null ) {
} else {
$meta_key_input_id = 'metakeyinput';
}
?>
?>
<p><strong><?php _e( 'Add New Custom Field:' ); ?></strong></p>
<table id="newmeta">
<thead>
@ -689,18 +698,18 @@ function meta_form( $post = null ) {
<tbody>
<tr>
<td id="newmetaleft" class="left">
<?php if ( $keys ) { ?>
<?php if ( $keys ) { ?>
<select id="metakeyselect" name="metakeyselect">
<option value="#NONE#"><?php _e( '&mdash; Select &mdash;' ); ?></option>
<?php
<?php
foreach ( $keys as $key ) {
foreach ( $keys as $key ) {
if ( is_protected_meta( $key, 'post' ) || ! current_user_can( 'add_post_meta', $post->ID, $key ) ) {
continue;
}
echo "\n<option value='" . esc_attr( $key ) . "'>" . esc_html( $key ) . '</option>';
}
?>
}
?>
</select>
<input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" value="" />
<a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;">
@ -715,20 +724,24 @@ foreach ( $keys as $key ) {
<tr><td colspan="2">
<div class="submit">
<?php
submit_button(
__( 'Add Custom Field' ), '', 'addmeta', false, array(
<?php
submit_button(
__( 'Add Custom Field' ),
'',
'addmeta',
false,
array(
'id' => 'newmeta-submit',
'data-wp-lists' => 'add:the-list:newmeta',
)
);
?>
);
?>
</div>
<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
<?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?>
</td></tr>
</tbody>
</table>
<?php
<?php
}
@ -817,13 +830,13 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
$cur_timeunit = 'cur_' . $timeunit;
echo '<input type="hidden" id="' . $cur_timeunit . '" name="' . $cur_timeunit . '" value="' . $curr . '" />' . "\n";
}
?>
?>
<p>
<a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e( 'OK' ); ?></a>
<a href="#edit_timestamp" class="cancel-timestamp hide-if-no-js button-cancel"><?php _e( 'Cancel' ); ?></a>
</p>
<?php
<?php
}
/**
@ -934,7 +947,7 @@ function wp_import_upload_form( $action ) {
<p><strong><?php echo $upload_dir['error']; ?></strong></p></div>
<?php
else :
?>
?>
<form enctype="multipart/form-data" id="import-upload-form" method="post" class="wp-upload-form" action="<?php echo esc_url( wp_nonce_url( $action, 'import-upload' ) ); ?>">
<p>
<label for="upload"><?php _e( 'Choose a file from your computer:' ); ?></label> (<?php printf( __( 'Maximum size: %s' ), $size ); ?>)
@ -942,9 +955,9 @@ function wp_import_upload_form( $action ) {
<input type="hidden" name="action" value="save" />
<input type="hidden" name="max_file_size" value="<?php echo $bytes; ?>" />
</p>
<?php submit_button( __( 'Upload file and import' ), 'primary' ); ?>
<?php submit_button( __( 'Upload file and import' ), 'primary' ); ?>
</form>
<?php
<?php
endif;
}
@ -1317,7 +1330,8 @@ function add_settings_section( $id, $title, $callback, $page ) {
if ( 'misc' == $page ) {
_deprecated_argument(
__FUNCTION__, '3.0.0',
__FUNCTION__,
'3.0.0',
/* translators: %s: misc */
sprintf(
__( 'The "%s" options group has been removed. Use another settings group.' ),
@ -1329,7 +1343,8 @@ function add_settings_section( $id, $title, $callback, $page ) {
if ( 'privacy' == $page ) {
_deprecated_argument(
__FUNCTION__, '3.5.0',
__FUNCTION__,
'3.5.0',
/* translators: %s: privacy */
sprintf(
__( 'The "%s" options group has been removed. Use another settings group.' ),
@ -1386,7 +1401,8 @@ function add_settings_field( $id, $title, $callback, $page, $section = 'default'
if ( 'misc' == $page ) {
_deprecated_argument(
__FUNCTION__, '3.0.0',
__FUNCTION__,
'3.0.0',
/* translators: %s: misc */
sprintf(
__( 'The "%s" options group has been removed. Use another settings group.' ),
@ -1398,7 +1414,8 @@ function add_settings_field( $id, $title, $callback, $page, $section = 'default'
if ( 'privacy' == $page ) {
_deprecated_argument(
__FUNCTION__, '3.5.0',
__FUNCTION__,
'3.5.0',
/* translators: %s: privacy */
sprintf(
__( 'The "%s" options group has been removed. Use another settings group.' ),
@ -1650,7 +1667,7 @@ function settings_errors( $setting = '', $sanitize = false, $hide_on_update = fa
* @param string $found_action
*/
function find_posts_div( $found_action = '' ) {
?>
?>
<div id="find-posts" class="find-box" style="display: none;">
<div id="find-posts-head" class="find-box-head">
<?php _e( 'Attach to existing content' ); ?>
@ -1676,7 +1693,7 @@ function find_posts_div( $found_action = '' ) {
<div class="clear"></div>
</div>
</div>
<?php
<?php
}
/**
@ -1745,11 +1762,11 @@ function iframe_header( $title = '', $deprecated = false ) {
@header( 'Content-Type: ' . get_option( 'html_type' ) . '; charset=' . get_option( 'blog_charset' ) );
_wp_admin_html_begin();
?>
?>
<title><?php bloginfo( 'name' ); ?> &rsaquo; <?php echo $title; ?> &#8212; <?php _e( 'WordPress' ); ?></title>
<?php
wp_enqueue_style( 'colors' );
?>
<?php
wp_enqueue_style( 'colors' );
?>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
function tb_close(){var win=window.dialogArguments||opener||parent||top;win.tb_remove();}
@ -1761,50 +1778,50 @@ var ajaxurl = '<?php echo admin_url( 'admin-ajax.php', 'relative' ); ?>',
decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>',
isRtl = <?php echo (int) is_rtl(); ?>;
</script>
<?php
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_enqueue_scripts', $hook_suffix );
<?php
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_enqueue_scripts', $hook_suffix );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_styles-$hook_suffix" );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_styles-$hook_suffix" );
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_styles' );
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_styles' );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_scripts-$hook_suffix" );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_print_scripts-$hook_suffix" );
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_scripts' );
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_print_scripts' );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_head-$hook_suffix" );
/** This action is documented in wp-admin/admin-header.php */
do_action( "admin_head-$hook_suffix" );
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_head' );
/** This action is documented in wp-admin/admin-header.php */
do_action( 'admin_head' );
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
$admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
if ( is_rtl() ) {
if ( is_rtl() ) {
$admin_body_class .= ' rtl';
}
}
?>
?>
</head>
<?php
/** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' );
$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
?>
<?php
/** This filter is documented in wp-admin/admin-header.php */
$admin_body_classes = apply_filters( 'admin_body_class', '' );
$admin_body_classes = ltrim( $admin_body_classes . ' ' . $admin_body_class );
?>
<body
<?php
/**
<?php
/**
* @global string $body_id
*/
if ( isset( $GLOBALS['body_id'] ) ) {
if ( isset( $GLOBALS['body_id'] ) ) {
echo ' id="' . $GLOBALS['body_id'] . '"';
}
?>
}
?>
class="wp-admin wp-core-ui no-js iframe <?php echo $admin_body_classes; ?>">
<script type="text/javascript">
(function(){
@ -1813,7 +1830,7 @@ c = c.replace(/no-js/, 'js');
document.body.className = c;
})();
</script>
<?php
<?php
}
/**
@ -1834,7 +1851,7 @@ function iframe_footer() {
global $hook_suffix;
?>
<div class="hidden">
<?php
<?php
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_footer', $hook_suffix );
@ -1843,12 +1860,12 @@ function iframe_footer() {
/** This action is documented in wp-admin/admin-footer.php */
do_action( 'admin_print_footer_scripts' );
?>
?>
</div>
<script type="text/javascript">if(typeof wpOnload=="function")wpOnload();</script>
</body>
</html>
<?php
<?php
}
/**
@ -2013,7 +2030,7 @@ function _media_states( $post ) {
* @since 2.8.0
*/
function compression_test() {
?>
?>
<script type="text/javascript">
var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>;
var testCompression = {
@ -2063,7 +2080,7 @@ function compression_test() {
};
testCompression.check();
</script>
<?php
<?php
}
/**
@ -2173,7 +2190,7 @@ function _wp_admin_html_begin() {
@header( 'X-UA-Compatible: IE=edge' );
}
?>
?>
<!DOCTYPE html>
<!--[if IE 8]>
<html xmlns="http://www.w3.org/1999/xhtml" class="ie8 <?php echo $admin_html_class; ?>"
@ -2201,7 +2218,7 @@ function _wp_admin_html_begin() {
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php echo get_option( 'blog_charset' ); ?>" />
<?php
<?php
}
/**

View File

@ -124,7 +124,7 @@ function install_theme_search_form( $type_selector = true ) {
<input type="search" name="s" id="s" size="30" value="<?php echo esc_attr( $term ); ?>" autofocus="autofocus" />
<?php submit_button( __( 'Search' ), '', 'search', false ); ?>
</form>
<?php
<?php
}
/**
@ -134,7 +134,7 @@ function install_theme_search_form( $type_selector = true ) {
*/
function install_themes_dashboard() {
install_theme_search_form( false );
?>
?>
<h4><?php _e( 'Feature Filter' ); ?></h4>
<p class="install-help"><?php _e( 'Find a theme based on specific features.' ); ?></p>
@ -152,7 +152,7 @@ function install_themes_dashboard() {
foreach ( $features as $feature => $feature_name ) {
$feature_name = esc_html( $feature_name );
$feature = esc_attr( $feature );
?>
?>
<li>
<input type="checkbox" name="features[]" id="feature-id-<?php echo $feature; ?>" value="<?php echo $feature; ?>" />
@ -162,22 +162,22 @@ function install_themes_dashboard() {
<?php } ?>
</ol>
<br class="clear" />
<?php
<?php
}
?>
</div>
<br class="clear" />
<?php submit_button( __( 'Find Themes' ), '', 'search' ); ?>
<?php submit_button( __( 'Find Themes' ), '', 'search' ); ?>
</form>
<?php
<?php
}
/**
* @since 2.8.0
*/
function install_themes_upload() {
?>
?>
<p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install it by uploading it here.' ); ?></p>
<form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>">
<?php wp_nonce_field( 'theme-upload' ); ?>

View File

@ -183,7 +183,8 @@ function get_theme_update_available( $theme ) {
'TB_iframe' => 'true',
'width' => 1024,
'height' => 800,
), $update['url']
),
$update['url']
); //Theme browser inside WP? replace this, Also, theme preview JS will override this on the available list.
$update_url = wp_nonce_url( admin_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $stylesheet ) ), 'upgrade-theme_' . $stylesheet );

View File

@ -34,7 +34,8 @@ function get_core_updates( $options = array() ) {
array(
'available' => true,
'dismissed' => false,
), $options
),
$options
);
$dismissed = get_site_option( 'dismissed_update_core' );
@ -549,7 +550,8 @@ function wp_theme_update_row( $theme_key, $theme ) {
'TB_iframe' => 'true',
'width' => 1024,
'height' => 800,
), $current->response[ $theme_key ]['url']
),
$current->response[ $theme_key ]['url']
);
/** @var WP_MS_Themes_List_Table $wp_list_table */

View File

@ -147,7 +147,8 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
$cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
if ( $cat_id == null ) {
$wpdb->insert(
$wpdb->sitecategories, array(
$wpdb->sitecategories,
array(
'cat_ID' => 0,
'cat_name' => $cat_name,
'category_nicename' => $cat_slug,
@ -162,7 +163,8 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
}
$wpdb->insert(
$wpdb->terms, array(
$wpdb->terms,
array(
'term_id' => $cat_id,
'name' => $cat_name,
'slug' => $cat_slug,
@ -170,7 +172,8 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
)
);
$wpdb->insert(
$wpdb->term_taxonomy, array(
$wpdb->term_taxonomy,
array(
'term_id' => $cat_id,
'taxonomy' => 'category',
'description' => '',
@ -206,7 +209,8 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
}
$wpdb->insert(
$wpdb->posts, array(
$wpdb->posts,
array(
'post_author' => $user_id,
'post_date' => $now,
'post_date_gmt' => $now_gmt,
@ -225,7 +229,8 @@ if ( ! function_exists( 'wp_install_defaults' ) ) :
)
);
$wpdb->insert(
$wpdb->term_relationships, array(
$wpdb->term_relationships,
array(
'term_taxonomy_id' => $cat_tt_id,
'object_id' => 1,
)
@ -248,7 +253,8 @@ To get started with moderating, editing, and deleting comments, please visit the
Commenter avatars come from <a href="https://gravatar.com">Gravatar</a>.'
);
$wpdb->insert(
$wpdb->comments, array(
$wpdb->comments,
array(
'comment_post_ID' => 1,
'comment_author' => $first_comment_author,
'comment_author_email' => $first_comment_email,
@ -275,12 +281,14 @@ Commenter avatars come from <a href="https://gravatar.com">Gravatar</a>.'
<blockquote>The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickeys to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.</blockquote>
As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to delete this page and create new pages for your content. Have fun!"
), admin_url()
),
admin_url()
);
$first_post_guid = get_option( 'home' ) . '/?page_id=2';
$wpdb->insert(
$wpdb->posts, array(
$wpdb->posts,
array(
'post_author' => $user_id,
'post_date' => $now,
'post_date_gmt' => $now_gmt,
@ -300,7 +308,8 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
)
);
$wpdb->insert(
$wpdb->postmeta, array(
$wpdb->postmeta,
array(
'post_id' => 2,
'meta_key' => '_wp_page_template',
'meta_value' => 'default',
@ -323,7 +332,8 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
$privacy_policy_guid = get_option( 'home' ) . '/?page_id=3';
$wpdb->insert(
$wpdb->posts, array(
$wpdb->posts,
array(
'post_author' => $user_id,
'post_date' => $now,
'post_date_gmt' => $now_gmt,
@ -344,7 +354,8 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
)
);
$wpdb->insert(
$wpdb->postmeta, array(
$wpdb->postmeta,
array(
'post_id' => 3,
'meta_key' => '_wp_page_template',
'meta_value' => 'default',
@ -355,13 +366,15 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
// Set up default widgets for default theme.
update_option(
'widget_search', array(
'widget_search',
array(
2 => array( 'title' => '' ),
'_multiwidget' => 1,
)
);
update_option(
'widget_recent-posts', array(
'widget_recent-posts',
array(
2 => array(
'title' => '',
'number' => 5,
@ -370,7 +383,8 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
)
);
update_option(
'widget_recent-comments', array(
'widget_recent-comments',
array(
2 => array(
'title' => '',
'number' => 5,
@ -379,7 +393,8 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
)
);
update_option(
'widget_archives', array(
'widget_archives',
array(
2 => array(
'title' => '',
'count' => 0,
@ -389,7 +404,8 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
)
);
update_option(
'widget_categories', array(
'widget_categories',
array(
2 => array(
'title' => '',
'count' => 0,
@ -400,13 +416,15 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
)
);
update_option(
'widget_meta', array(
'widget_meta',
array(
2 => array( 'title' => '' ),
'_multiwidget' => 1,
)
);
update_option(
'sidebars_widgets', array(
'sidebars_widgets',
array(
'wp_inactive_widgets' => array(),
'sidebar-1' => array(
0 => 'search-2',
@ -442,7 +460,8 @@ As a new WordPress user, you should go to <a href=\"%s\">your dashboard</a> to d
// Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id.
if ( ! is_super_admin( $user_id ) && $user_id != 1 ) {
$wpdb->delete(
$wpdb->usermeta, array(
$wpdb->usermeta,
array(
'user_id' => $user_id,
'meta_key' => $wpdb->base_prefix . '1_capabilities',
)
@ -564,7 +583,11 @@ We hope you enjoy your new site. Thanks!
--The WordPress Team
https://wordpress.org/
'
), $blog_url, $name, $password, $login_url
),
$blog_url,
$name,
$password,
$login_url
);
@wp_mail( $email, __( 'New WordPress Site' ), $message );
@ -832,7 +855,8 @@ function upgrade_100() {
$cat = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->post2cat WHERE post_id = %d AND category_id = %d", $post->ID, $post->post_category ) );
if ( ! $cat && 0 != $post->post_category ) { // If there's no result
$wpdb->insert(
$wpdb->post2cat, array(
$wpdb->post2cat,
array(
'post_id' => $post->ID,
'category_id' => $post->post_category,
)
@ -1116,7 +1140,8 @@ function upgrade_160() {
$objects = $wpdb->get_results( "SELECT ID, post_type FROM $wpdb->posts WHERE post_status = 'object'" );
foreach ( $objects as $object ) {
$wpdb->update(
$wpdb->posts, array(
$wpdb->posts,
array(
'post_status' => 'attachment',
'post_mime_type' => $object->post_type,
'post_type' => '',
@ -1234,7 +1259,11 @@ function upgrade_230() {
$wpdb->query(
$wpdb->prepare(
"INSERT INTO $wpdb->terms (term_id, name, slug, term_group) VALUES
(%d, %s, %s, %d)", $term_id, $name, $slug, $term_group
(%d, %s, %s, %d)",
$term_id,
$name,
$slug,
$term_group
)
);
@ -1288,7 +1317,8 @@ function upgrade_230() {
}
$wpdb->insert(
$wpdb->term_relationships, array(
$wpdb->term_relationships,
array(
'object_id' => $post_id,
'term_taxonomy_id' => $tt_id,
)
@ -1327,7 +1357,8 @@ function upgrade_230() {
$default_link_cat = $term_id;
$wpdb->insert(
$wpdb->term_taxonomy, array(
$wpdb->term_taxonomy,
array(
'term_id' => $term_id,
'taxonomy' => 'link_category',
'description' => '',
@ -1355,7 +1386,8 @@ function upgrade_230() {
}
$wpdb->insert(
$wpdb->term_relationships, array(
$wpdb->term_relationships,
array(
'object_id' => $link->link_id,
'term_taxonomy_id' => $tt_id,
)
@ -1376,7 +1408,8 @@ function upgrade_230() {
continue;
}
$wpdb->insert(
$wpdb->term_relationships, array(
$wpdb->term_relationships,
array(
'object_id' => $link_id,
'term_taxonomy_id' => $tt_id,
)

View File

@ -537,7 +537,7 @@ jQuery(document).ready( function($) {
});
});
</script>
<?php
<?php
}
/**
@ -550,12 +550,12 @@ jQuery(document).ready( function($) {
* @param object $user User data object
*/
function use_ssl_preference( $user ) {
?>
?>
<tr class="user-use-ssl-wrap">
<th scope="row"><?php _e( 'Use https' ); ?></th>
<td><label for="use_ssl"><input name="use_ssl" type="checkbox" id="use_ssl" value="1" <?php checked( '1', $user->use_ssl ); ?> /> <?php _e( 'Always use https when visiting the admin' ); ?></label></td>
</tr>
<?php
<?php
}
/**
@ -576,7 +576,10 @@ this email. This invitation will expire in a few days.
Please click the following link to activate your user account:
%%s'
), wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ), home_url(), wp_specialchars_decode( translate_user_role( $role['name'] ) )
),
wp_specialchars_decode( get_bloginfo( 'name' ), ENT_QUOTES ),
home_url(),
wp_specialchars_decode( translate_user_role( $role['name'] ) )
);
}
@ -627,10 +630,12 @@ function _wp_privacy_completed_request( $request_id ) {
update_post_meta( $request_id, '_wp_user_request_completed_timestamp', time() );
$request = wp_update_post( array(
$request = wp_update_post(
array(
'ID' => $request_id,
'post_status' => 'request-completed',
) );
)
);
return $request;
}
@ -755,7 +760,8 @@ function _wp_personal_data_cleanup_requests() {
/** This filter is documented in wp-includes/user.php */
$expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );
$requests_query = new WP_Query( array(
$requests_query = new WP_Query(
array(
'post_type' => 'user_request',
'posts_per_page' => -1,
'post_status' => 'request-pending',
@ -766,16 +772,19 @@ function _wp_personal_data_cleanup_requests() {
'before' => $expires . ' seconds ago',
),
),
) );
)
);
$request_ids = $requests_query->posts;
foreach ( $request_ids as $request_id ) {
wp_update_post( array(
wp_update_post(
array(
'ID' => $request_id,
'post_status' => 'request-failed',
'post_password' => '',
) );
)
);
}
}
@ -796,10 +805,12 @@ function _wp_personal_data_export_page() {
// "Borrow" xfn.js for now so we don't have to create new files.
wp_enqueue_script( 'xfn' );
$requests_table = new WP_Privacy_Data_Export_Requests_Table( array(
$requests_table = new WP_Privacy_Data_Export_Requests_Table(
array(
'plural' => 'privacy_requests',
'singular' => 'privacy_request',
) );
)
);
$requests_table->process_bulk_action();
$requests_table->prepare_items();
?>
@ -867,10 +878,12 @@ function _wp_personal_data_removal_page() {
// "Borrow" xfn.js for now so we don't have to create new files.
wp_enqueue_script( 'xfn' );
$requests_table = new WP_Privacy_Data_Removal_Requests_Table( array(
$requests_table = new WP_Privacy_Data_Removal_Requests_Table(
array(
'plural' => 'privacy_requests',
'singular' => 'privacy_request',
) );
)
);
$requests_table->process_bulk_action();
$requests_table->prepare_items();
@ -1502,10 +1515,18 @@ class WP_Privacy_Data_Export_Requests_Table extends WP_Privacy_Requests_Table {
submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
break;
case 'request-completed':
echo '<a href="' . esc_url( wp_nonce_url( add_query_arg( array(
echo '<a href="' . esc_url(
wp_nonce_url(
add_query_arg(
array(
'action' => 'delete',
'request_id' => array( $item->ID ),
), admin_url( 'tools.php?page=export_personal_data' ) ), 'bulk-privacy_requests' ) ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
),
admin_url( 'tools.php?page=export_personal_data' )
),
'bulk-privacy_requests'
)
) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
break;
}
}
@ -1616,10 +1637,18 @@ class WP_Privacy_Data_Removal_Requests_Table extends WP_Privacy_Requests_Table {
submit_button( __( 'Retry' ), 'secondary', 'privacy_action_email_retry[' . $item->ID . ']', false );
break;
case 'request-completed':
echo '<a href="' . esc_url( wp_nonce_url( add_query_arg( array(
echo '<a href="' . esc_url(
wp_nonce_url(
add_query_arg(
array(
'action' => 'delete',
'request_id' => array( $item->ID ),
), admin_url( 'tools.php?page=remove_personal_data' ) ), 'bulk-privacy_requests' ) ) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
),
admin_url( 'tools.php?page=remove_personal_data' )
),
'bulk-privacy_requests'
)
) . '" class="button">' . esc_html__( 'Remove request' ) . '</a>';
break;
}
}

View File

@ -299,9 +299,9 @@ function wp_widget_control( $sidebar_args ) {
</div>
<div class="widget-description">
<?php echo ( $widget_description = wp_widget_description( $widget_id ) ) ? "$widget_description\n" : "$widget_title\n"; ?>
<?php echo ( $widget_description = wp_widget_description( $widget_id ) ) ? "$widget_description\n" : "$widget_title\n"; ?>
</div>
<?php
<?php
echo $sidebar_args['after_widget'];
return $sidebar_args;

View File

@ -8,7 +8,7 @@
// Sanity check.
if ( false ) {
?>
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
@ -21,7 +21,7 @@ if ( false ) {
<p>WordPress requires that your web server is running PHP. Your server does not have PHP installed, or PHP is turned off.</p>
</body>
</html>
<?php
<?php
}
/**
@ -63,7 +63,7 @@ function display_header( $body_classes = '' ) {
if ( $body_classes ) {
$body_classes = ' ' . $body_classes;
}
?>
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
@ -79,7 +79,7 @@ function display_header( $body_classes = '' ) {
<body class="wp-core-ui<?php echo $body_classes; ?>">
<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p>
<?php
<?php
} // end display_header()
/**
@ -108,7 +108,7 @@ function display_setup_form( $error = null ) {
$admin_email = isset( $_POST['admin_email'] ) ? trim( wp_unslash( $_POST['admin_email'] ) ) : '';
if ( ! is_null( $error ) ) {
?>
?>
<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
<p class="message"><?php echo $error; ?></p>
<?php } ?>
@ -211,7 +211,7 @@ function display_setup_form( $error = null ) {
<p class="step"><?php submit_button( __( 'Install WordPress' ), 'large', 'Submit', false, array( 'id' => 'submit' ) ); ?></p>
<input type="hidden" name="language" value="<?php echo isset( $_REQUEST['language'] ) ? esc_attr( $_REQUEST['language'] ) : ''; ?>" />
</form>
<?php
<?php
} // end display_setup_form()
// Let's check to make sure WP isn't already installed.
@ -317,14 +317,14 @@ switch ( $step ) {
$scripts_to_print[] = 'user-profile';
display_header();
?>
?>
<h1><?php _ex( 'Welcome', 'Howdy' ); ?></h1>
<p><?php _e( 'Welcome to the famous five-minute WordPress installation process! Just fill in the information below and you&#8217;ll be on your way to using the most extendable and powerful personal publishing platform in the world.' ); ?></p>
<h2><?php _e( 'Information needed' ); ?></h2>
<p><?php _e( 'Please provide the following information. Don&#8217;t worry, you can always change these settings later.' ); ?></p>
<?php
<?php
display_setup_form();
break;
case 2:
@ -376,7 +376,7 @@ switch ( $step ) {
if ( $error === false ) {
$wpdb->show_errors();
$result = wp_install( $weblog_title, $user_name, $admin_email, $public, '', wp_slash( $admin_password ), $loaded_language );
?>
?>
<h1><?php _e( 'Success!' ); ?></h1>
@ -402,7 +402,7 @@ switch ( $step ) {
<p class="step"><a href="<?php echo esc_url( wp_login_url() ); ?>" class="button button-large"><?php _e( 'Log In' ); ?></a></p>
<?php
<?php
}
break;
}

View File

@ -161,11 +161,11 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
} else {
echo '<p>' . __( 'WordPress can automatically look for some common database problems and repair them. Repairing can take a while, so please be patient.' ) . '</p>';
}
?>
?>
<p class="step"><a class="button button-large" href="repair.php?repair=1"><?php _e( 'Repair Database' ); ?></a></p>
<p><?php _e( 'WordPress can also attempt to optimize the database. This improves performance in some situations. Repairing and optimizing the database can take a long time and the database will be locked while optimizing.' ); ?></p>
<p class="step"><a class="button button-large" href="repair.php?repair=2"><?php _e( 'Repair and Optimize Database' ); ?></a></p>
<?php
<?php
}
?>
</body>

View File

@ -117,14 +117,14 @@ switch ( $action ) {
<div class="wrap">
<h1 class="wp-heading-inline">
<?php
echo esc_html( $title );
?>
<?php
echo esc_html( $title );
?>
</h1>
<?php
if ( current_user_can( 'upload_files' ) ) {
?>
<?php
if ( current_user_can( 'upload_files' ) ) {
?>
<a href="media-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
<?php } ?>
@ -139,7 +139,8 @@ if ( current_user_can( 'upload_files' ) ) {
<div id="media-item-<?php echo $att_id; ?>" class="media-item">
<?php
echo get_media_item(
$att_id, array(
$att_id,
array(
'toggle' => false,
'send' => false,
'delete' => false,
@ -147,7 +148,7 @@ if ( current_user_can( 'upload_files' ) ) {
'errors' => ! empty( $errors[ $att_id ] ) ? $errors[ $att_id ] : null,
)
);
?>
?>
</div>
</div>

View File

@ -87,7 +87,7 @@ Webmaster
<p><?php _e( 'Thank you. Please check your email for a link to confirm your action. Your site will not be deleted until this link is clicked.' ); ?></p>
<?php
<?php
} else {
?>
<p><?php printf( __( 'If you do not want to use your %s site any more, you can delete it using the form below. When you click <strong>Delete My Site Permanently</strong> you will be sent an email with a link in it. Click on this link to delete your site.' ), get_network()->site_name ); ?></p>

View File

@ -77,7 +77,7 @@ if ( empty( $blogs ) ) :
_e( 'You must be a member of at least one site to use this page.' );
echo '</p>';
else :
?>
?>
<hr class="wp-header-end">

View File

@ -611,7 +611,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
array(
array( 'autofocus' => $focus ),
'return' => urlencode( remove_query_arg( wp_removable_query_args(), wp_unslash( $_SERVER['REQUEST_URI'] ) ) ),
), admin_url( 'customize.php' )
),
admin_url( 'customize.php' )
)
),
__( 'Manage with Live Preview' )
@ -692,7 +693,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
array(
'action' => 'edit',
'menu' => $menu_locations[ $_location ],
), admin_url( 'nav-menus.php' )
),
admin_url( 'nav-menus.php' )
)
);
?>
@ -710,7 +712,8 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
'action' => 'edit',
'menu' => 0,
'use-location' => $_location,
), admin_url( 'nav-menus.php' )
),
admin_url( 'nav-menus.php' )
)
);
?>
@ -743,16 +746,18 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<span class="add-edit-menu-action">
<?php
printf(
__( 'Edit your menu below, or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ), esc_url(
__( 'Edit your menu below, or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
esc_url(
add_query_arg(
array(
'action' => 'edit',
'menu' => 0,
), admin_url( 'nav-menus.php' )
),
admin_url( 'nav-menus.php' )
)
)
);
?>
?>
<span class="screen-reader-text"><?php _e( 'Click the Save Menu button to save your changes.' ); ?></span>
</span><!-- /add-edit-menu-action -->
<?php else : ?>
@ -802,16 +807,18 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<span class="add-new-menu-action">
<?php
printf(
__( 'or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ), esc_url(
__( 'or <a href="%s">create a new menu</a>. Don&#8217;t forget to save your changes!' ),
esc_url(
add_query_arg(
array(
'action' => 'edit',
'menu' => 0,
), admin_url( 'nav-menus.php' )
),
admin_url( 'nav-menus.php' )
)
)
);
?>
?>
<span class="screen-reader-text"><?php _e( 'Click the Save Menu button to save your changes.' ); ?></span>
</span><!-- /add-new-menu-action -->
</form>
@ -819,10 +826,10 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
endif;
$metabox_holder_disabled_class = '';
if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
$metabox_holder_disabled_class = ' metabox-holder-disabled';
}
?>
}
?>
</div><!-- /manage-menus -->
<div id="nav-menus-frame" class="wp-clearfix">
<div id="menu-settings-column" class="metabox-holder<?php echo $metabox_holder_disabled_class; ?>">
@ -907,10 +914,10 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
endif;
$no_menus_style = '';
if ( $one_theme_location_no_menus ) {
if ( $one_theme_location_no_menus ) {
$no_menus_style = 'style="display: none;"';
}
?>
}
?>
<div class="menu-settings" <?php echo $no_menus_style; ?>>
<h3><?php _e( 'Menu Settings' ); ?></h3>
<?php
@ -973,8 +980,10 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
array(
'action' => 'delete',
'menu' => $nav_menu_selected_id,
), admin_url( 'nav-menus.php' )
), 'delete-nav_menu-' . $nav_menu_selected_id
),
admin_url( 'nav-menus.php' )
),
'delete-nav_menu-' . $nav_menu_selected_id
)
);
?>

View File

@ -107,7 +107,8 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) {
array(
'update' => 'updated',
'id' => $id,
), 'site-info.php'
),
'site-info.php'
)
);
exit;

View File

@ -173,7 +173,8 @@ Name: %3$s'
array(
'update' => 'added',
'id' => $id,
), 'site-new.php'
),
'site-new.php'
)
);
exit;
@ -212,13 +213,15 @@ if ( ! empty( $messages ) ) {
}
}
?>
<p><?php
<p>
<?php
printf(
/* translators: %s: asterisk to mark required form fields. */
__( 'Required fields are marked %s' ),
'<span class="required">*</span>'
);
?></p>
?>
</p>
<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
<table class="form-table">
@ -232,10 +235,10 @@ printf(
echo get_network()->domain . get_network()->path
?>
<input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
<?php
<?php
}
echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
?>
?>
</td>
</tr>
<tr class="form-field form-required">

View File

@ -65,7 +65,8 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] && is_
array(
'update' => 'updated',
'id' => $id,
), 'site-settings.php'
),
'site-settings.php'
)
);
exit;

View File

@ -151,7 +151,8 @@ if ( $action ) {
array(
'id' => $id,
$action => $n,
), $referer
),
$referer
)
);
exit;

View File

@ -296,7 +296,7 @@ do_action( 'network_site_users_after_list_table' );
/** This filter is documented in wp-admin/network/site-users.php */
if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_users_add_existing_form', true ) ) :
?>
?>
<h2 id="add-existing-user"><?php _e( 'Add Existing User' ); ?></h2>
<form action="site-users.php?action=adduser" id="adduser" method="post">
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
@ -330,7 +330,7 @@ if ( current_user_can( 'promote_users' ) && apply_filters( 'show_network_site_us
* @param bool $bool Whether to show the Add New User form. Default true.
*/
if ( current_user_can( 'create_users' ) && apply_filters( 'show_network_site_users_add_new_form', true ) ) :
?>
?>
<h2 id="add-new-user"><?php _e( 'Add New User' ); ?></h2>
<form action="<?php echo network_admin_url( 'site-users.php?action=newuser' ); ?>" id="newuser" method="post">
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />

View File

@ -181,14 +181,16 @@ if ( $action ) {
foreach ( $themes as $theme ) {
$delete_result = delete_theme(
$theme, esc_url(
$theme,
esc_url(
add_query_arg(
array(
'verify-delete' => 1,
'action' => 'delete-selected',
'checked' => $_REQUEST['checked'],
'_wpnonce' => $_REQUEST['_wpnonce'],
), network_admin_url( 'themes.php' )
),
network_admin_url( 'themes.php' )
)
)
);
@ -201,7 +203,8 @@ if ( $action ) {
'deleted' => count( $themes ),
'paged' => $paged,
's' => $s,
), network_admin_url( 'themes.php' )
),
network_admin_url( 'themes.php' )
)
);
exit;

View File

@ -82,7 +82,8 @@ switch ( $action ) {
echo "<li>$siteurl</li>";
$response = wp_remote_get(
$upgrade_url, array(
$upgrade_url,
array(
'timeout' => 120,
'httpversion' => '1.1',
'sslverify' => false,

View File

@ -66,7 +66,8 @@ if ( isset( $_REQUEST['action'] ) && 'add-user' == $_REQUEST['action'] ) {
array(
'update' => 'added',
'user_id' => $user_id,
), 'user-new.php'
),
'user-new.php'
)
);
exit;
@ -109,7 +110,7 @@ if ( ! empty( $messages ) ) {
}
if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
?>
?>
<div class="error">
<?php
foreach ( $add_user_errors->get_error_messages() as $message ) {

View File

@ -113,7 +113,8 @@ if ( isset( $_GET['action'] ) ) {
array(
'updated' => 'true',
'action' => $userfunction,
), wp_get_referer()
),
wp_get_referer()
)
);
} else {
@ -169,7 +170,8 @@ if ( isset( $_GET['action'] ) ) {
array(
'updated' => 'true',
'action' => $deletefunction,
), network_admin_url( 'users.php' )
),
network_admin_url( 'users.php' )
)
);
exit();
@ -245,7 +247,7 @@ if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty(
</p></div>
<?php
}
?>
?>
<div class="wrap">
<h1 class="wp-heading-inline"><?php esc_html_e( 'Users' ); ?></h1>

View File

@ -80,7 +80,7 @@ if ( ! is_multisite() ) {
if ( defined( 'WP_HOME' ) ) {
$wp_home_class = ' disabled';
}
?>
?>
<tr>
<th scope="row"><label for="siteurl"><?php _e( 'WordPress Address (URL)' ); ?></label></th>
@ -90,15 +90,15 @@ if ( ! is_multisite() ) {
<tr>
<th scope="row"><label for="home"><?php _e( 'Site Address (URL)' ); ?></label></th>
<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" />
<?php if ( ! defined( 'WP_HOME' ) ) : ?>
<?php if ( ! defined( 'WP_HOME' ) ) : ?>
<p class="description" id="home-description">
<?php
<?php
printf(
/* translators: %s: Codex URL */
__( 'Enter the address here if you <a href="%s">want your site home page to be different from your WordPress installation directory</a>.' ),
__( 'https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory' )
);
?>
?>
</p>
<?php endif; ?>
</td>
@ -113,7 +113,7 @@ if ( ! is_multisite() ) {
<?php
$new_admin_email = get_option( 'new_admin_email' );
if ( $new_admin_email && $new_admin_email != get_option( 'admin_email' ) ) :
?>
?>
<div class="updated inline">
<p>
<?php
@ -140,7 +140,7 @@ if ( $new_admin_email && $new_admin_email != get_option( 'admin_email' ) ) :
<th scope="row"><?php _e( 'Membership' ); ?></th>
<td> <fieldset><legend class="screen-reader-text"><span><?php _e( 'Membership' ); ?></span></legend><label for="users_can_register">
<input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked( '1', get_option( 'users_can_register' ) ); ?> />
<?php _e( 'Anyone can register' ); ?></label>
<?php _e( 'Anyone can register' ); ?></label>
</fieldset></td>
</tr>
@ -151,7 +151,7 @@ if ( $new_admin_email && $new_admin_email != get_option( 'admin_email' ) ) :
</td>
</tr>
<?php
<?php
}
$languages = get_available_languages();

View File

@ -96,28 +96,28 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
* @global array $wp_settings
*/
if ( isset( $GLOBALS['wp_settings']['media']['embeds'] ) ) :
?>
?>
<h2 class="title"><?php _e( 'Embeds' ); ?></h2>
<table class="form-table">
<?php do_settings_fields( 'media', 'embeds' ); ?>
<?php do_settings_fields( 'media', 'embeds' ); ?>
</table>
<?php endif; ?>
<?php if ( ! is_multisite() ) : ?>
<h2 class="title"><?php _e( 'Uploading Files' ); ?></h2>
<table class="form-table">
<?php
// If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
?>
<?php
// If upload_url_path is not the default (empty), and upload_path is not the default ('wp-content/uploads' or empty)
if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-content/uploads' && get_option( 'upload_path' ) ) ) :
?>
<tr>
<th scope="row"><label for="upload_path"><?php _e( 'Store uploads in this folder' ); ?></label></th>
<td><input name="upload_path" type="text" id="upload_path" value="<?php echo esc_attr( get_option( 'upload_path' ) ); ?>" class="regular-text code" />
<p class="description">
<?php
<?php
/* translators: %s: wp-content/uploads */
printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );
?>
?>
</p>
</td>
</tr>
@ -136,12 +136,12 @@ if ( get_option( 'upload_url_path' ) || ( get_option( 'upload_path' ) != 'wp-con
<?php endif; ?>
<label for="uploads_use_yearmonth_folders">
<input name="uploads_use_yearmonth_folders" type="checkbox" id="uploads_use_yearmonth_folders" value="1"<?php checked( '1', get_option( 'uploads_use_yearmonth_folders' ) ); ?> />
<?php _e( 'Organize my uploads into month- and year-based folders' ); ?>
<?php _e( 'Organize my uploads into month- and year-based folders' ); ?>
</label>
</td>
</tr>
<?php do_settings_fields( 'media', 'uploads' ); ?>
<?php do_settings_fields( 'media', 'uploads' ); ?>
</table>
<?php endif; ?>

View File

@ -317,13 +317,13 @@ printf( __( 'If you like, you may enter custom structures for your category and
<?php submit_button(); ?>
</form>
<?php if ( ! is_multisite() ) { ?>
<?php
if ( $iis7_permalinks ) :
<?php
if ( $iis7_permalinks ) :
if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
if ( file_exists( $home_path . 'web.config' ) ) :
?>
<p>
<?php
<?php
printf(
/* translators: 1: web.config, 2: Codex URL, 3: CTRL + a, 4: element code */
__( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %1$s file. Click in the field and press %3$s to select all. Then insert this rule inside of the %4$s element in %1$s file.' ),
@ -332,24 +332,24 @@ if ( $iis7_permalinks ) :
'<kbd>CTRL + a</kbd>',
'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
);
?>
?>
</p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field( 'update-permalink' ); ?>
<?php wp_nonce_field( 'update-permalink' ); ?>
<p><textarea rows="9" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules() ); ?></textarea></p>
</form>
<p>
<?php
<?php
printf(
/* translators: %s: web.config */
__( 'If you temporarily make your %s file writable for us to generate rewrite rules automatically, do not forget to revert the permissions after rule has been saved.' ),
'<code>web.config</code>'
);
?>
?>
</p>
<?php else : ?>
<p>
<?php
<?php
printf(
/* translators: 1: Codex URL, 2: web.config, 3: CTRL + a */
__( 'If the root directory of your site was <a href="%1$s">writable</a>, we could do this automatically, but it isn&#8217;t so this is the url rewrite rule you should have in your %2$s file. Create a new file, called %2$s in the root directory of your site. Click in the field and press %3$s to select all. Then insert this code into the %2$s file.' ),
@ -357,31 +357,31 @@ if ( $iis7_permalinks ) :
'<code>web.config</code>',
'<kbd>CTRL + a</kbd>'
);
?>
?>
</p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field( 'update-permalink' ); ?>
<?php wp_nonce_field( 'update-permalink' ); ?>
<p><textarea rows="18" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->iis7_url_rewrite_rules( true ) ); ?></textarea></p>
</form>
<p>
<?php
<?php
printf(
/* translators: %s: web.config */
__( 'If you temporarily make your site&#8217;s root directory writable for us to generate the %s file automatically, do not forget to revert the permissions after the file has been created.' ),
'<code>web.config</code>'
);
?>
?>
</p>
<?php endif; ?>
<?php endif; ?>
<?php elseif ( $is_nginx ) : ?>
<p><?php _e( '<a href="https://codex.wordpress.org/Nginx">Documentation on Nginx configuration</a>.' ); ?></p>
<?php
<?php
else :
if ( $permalink_structure && ! $using_index_permalinks && ! $writable && $update_required ) :
?>
<p>
<?php
<?php
printf(
/* translators: 1: .htaccess, 2: Codex URL, 3: CTRL + a */
__( 'If your %1$s file was <a href="%2$s">writable</a>, we could do this automatically, but it isn&#8217;t so these are the mod_rewrite rules you should have in your %1$s file. Click in the field and press %3$s to select all.' ),
@ -389,10 +389,10 @@ else :
__( 'https://codex.wordpress.org/Changing_File_Permissions' ),
'<kbd>CTRL + a</kbd>'
);
?>
?>
</p>
<form action="options-permalink.php" method="post">
<?php wp_nonce_field( 'update-permalink' ); ?>
<?php wp_nonce_field( 'update-permalink' ); ?>
<p><textarea rows="6" class="large-text readonly" name="rules" id="rules" readonly="readonly"><?php echo esc_textarea( $wp_rewrite->mod_rewrite_rules() ); ?></textarea></p>
</form>
<?php endif; ?>

View File

@ -62,8 +62,8 @@ if ( ! in_array( get_option( 'blog_charset' ), array( 'utf8', 'utf-8', 'UTF8', '
<?php if ( ! get_pages() ) : ?>
<input name="show_on_front" type="hidden" value="posts" />
<table class="form-table">
<?php
if ( 'posts' != get_option( 'show_on_front' ) ) :
<?php
if ( 'posts' != get_option( 'show_on_front' ) ) :
update_option( 'show_on_front', 'posts' );
endif;
@ -71,7 +71,7 @@ else :
if ( 'page' == get_option( 'show_on_front' ) && ! get_option( 'page_on_front' ) && ! get_option( 'page_for_posts' ) ) {
update_option( 'show_on_front', 'posts' );
}
?>
?>
<table class="form-table">
<tr>
<th scope="row"><?php _e( 'Your homepage displays' ); ?></th>
@ -90,7 +90,8 @@ else :
<li><label for="page_on_front">
<?php
printf(
__( 'Homepage: %s' ), wp_dropdown_pages(
__( 'Homepage: %s' ),
wp_dropdown_pages(
array(
'name' => 'page_on_front',
'echo' => 0,
@ -100,12 +101,13 @@ else :
)
)
);
?>
?>
</label></li>
<li><label for="page_for_posts">
<?php
printf(
__( 'Posts page: %s' ), wp_dropdown_pages(
__( 'Posts page: %s' ),
wp_dropdown_pages(
array(
'name' => 'page_for_posts',
'echo' => 0,
@ -115,10 +117,10 @@ else :
)
)
);
?>
?>
</label></li>
</ul>
<?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
<?php if ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) == get_option( 'page_on_front' ) ) : ?>
<div id="front-page-warning" class="error inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
<?php endif; ?>
</fieldset></td>

View File

@ -69,7 +69,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Formatting' ); ?></span></legend>
<label for="use_smilies">
<input name="use_smilies" type="checkbox" id="use_smilies" value="1" <?php checked( '1', get_option( 'use_smilies' ) ); ?> />
<?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br />
<?php _e( 'Convert emoticons like <code>:-)</code> and <code>:-P</code> to graphics on display' ); ?></label><br />
<label for="use_balanceTags"><input name="use_balanceTags" type="checkbox" id="use_balanceTags" value="1" <?php checked( '1', get_option( 'use_balanceTags' ) ); ?> /> <?php _e( 'WordPress should correct invalidly nested XHTML automatically' ); ?></label>
</fieldset></td>
</tr>
@ -107,12 +107,12 @@ unset( $post_formats['standard'] );
</tr>
<?php
if ( get_option( 'link_manager_enabled' ) ) :
?>
?>
<tr>
<th scope="row"><label for="default_link_category"><?php _e( 'Default Link Category' ); ?></label></th>
<td>
<?php
wp_dropdown_categories(
<?php
wp_dropdown_categories(
array(
'hide_empty' => 0,
'name' => 'default_link_category',
@ -121,8 +121,8 @@ wp_dropdown_categories(
'hierarchical' => true,
'taxonomy' => 'link_category',
)
);
?>
);
?>
</td>
</tr>
<?php endif; ?>
@ -136,18 +136,18 @@ do_settings_fields( 'writing', 'remote_publishing' ); // A deprecated section.
<?php
/** This filter is documented in wp-admin/options.php */
if ( apply_filters( 'enable_post_by_email_configuration', true ) ) {
?>
?>
<h2 class="title"><?php _e( 'Post via email' ); ?></h2>
<p>
<?php
printf(
<?php
printf(
/* translators: 1, 2, 3: examples of random email addresses */
__( 'To post to WordPress by email you must set up a secret email account with POP3 access. Any mail received at this address will be posted, so it&#8217;s a good idea to keep this address very secret. Here are three random strings you could use: %1$s, %2$s, %3$s.' ),
sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) ),
sprintf( '<kbd>%s</kbd>', wp_generate_password( 8, false ) )
);
?>
);
?>
</p>
<table class="form-table">
@ -171,8 +171,8 @@ printf(
<tr>
<th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th>
<td>
<?php
wp_dropdown_categories(
<?php
wp_dropdown_categories(
array(
'hide_empty' => 0,
'name' => 'default_email_category',
@ -180,11 +180,11 @@ wp_dropdown_categories(
'selected' => get_option( 'default_email_category' ),
'hierarchical' => true,
)
);
?>
);
?>
</td>
</tr>
<?php do_settings_fields( 'writing', 'post_via_email' ); ?>
<?php do_settings_fields( 'writing', 'post_via_email' ); ?>
</table>
<?php } ?>
@ -197,10 +197,10 @@ wp_dropdown_categories(
* @param bool $enable Whether to enable the Update Services settings area. Default true.
*/
if ( apply_filters( 'enable_update_services_configuration', true ) ) {
?>
?>
<h2 class="title"><?php _e( 'Update Services' ); ?></h2>
<?php if ( 1 == get_option( 'blog_public' ) ) : ?>
<?php if ( 1 == get_option( 'blog_public' ) ) : ?>
<p><label for="ping_sites">
<?php
@ -214,7 +214,7 @@ if ( apply_filters( 'enable_update_services_configuration', true ) ) {
<textarea name="ping_sites" id="ping_sites" class="large-text code" rows="3"><?php echo esc_textarea( get_option( 'ping_sites' ) ); ?></textarea>
<?php else : ?>
<?php else : ?>
<p>
<?php
@ -227,7 +227,7 @@ if ( apply_filters( 'enable_update_services_configuration', true ) ) {
?>
</p>
<?php endif; ?>
<?php endif; ?>
<?php } // enable_update_services_configuration ?>
<?php do_settings_sections( 'writing' ); ?>

View File

@ -261,7 +261,8 @@ if ( 'update' == $action ) {
foreach ( $options as $option ) {
if ( $unregistered ) {
_deprecated_argument(
'options.php', '2.7.0',
'options.php',
'2.7.0',
sprintf(
/* translators: %s: the option/setting */
__( 'The %s setting is unregistered. Unregistered settings are deprecated. See https://codex.wordpress.org/Settings_API' ),

View File

@ -298,7 +298,7 @@ if ( ! in_array( 'plugin_editor_notice', $dismissed_pointers, true ) ) :
} else {
$return_url = admin_url( '/' );
}
?>
?>
<div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js hidden">
<div class="notification-dialog-background"></div>
<div class="notification-dialog">
@ -315,7 +315,7 @@ if ( ! in_array( 'plugin_editor_notice', $dismissed_pointers, true ) ) :
</div>
</div>
</div>
<?php
<?php
endif; // editor warning notice
include( ABSPATH . 'wp-admin/admin-footer.php' );

View File

@ -492,7 +492,8 @@ if ( isset( $_GET['error'] ) ) :
'action' => 'error_scrape',
'plugin' => urlencode( $plugin ),
'_wpnonce' => urlencode( $_GET['_error_nonce'] ),
), admin_url( 'plugins.php' )
),
admin_url( 'plugins.php' )
);
?>
<iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe>
@ -500,7 +501,7 @@ if ( isset( $_GET['error'] ) ) :
}
?>
</div>
<?php
<?php
elseif ( isset( $_GET['deleted'] ) ) :
$delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
// Delete it once we're done.
@ -543,9 +544,9 @@ echo esc_html( $title );
<?php
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) {
?>
?>
<a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'plugin' ); ?></a>
<?php
<?php
}
if ( strlen( $s ) ) {

View File

@ -242,7 +242,8 @@ switch ( $action ) {
array(
'trashed' => 1,
'ids' => $post_id,
), $sendback
),
$sendback
)
);
exit();

View File

@ -33,8 +33,10 @@ function wp_load_press_this() {
'action' => 'activate',
'plugin' => $plugin_file,
'from' => 'press-this',
), admin_url( 'plugins.php' )
), 'activate-plugin_' . $plugin_file
),
admin_url( 'plugins.php' )
),
'activate-plugin_' . $plugin_file
);
$action = sprintf(
'<a href="%1$s" aria-label="%2$s">%2$s</a>',
@ -49,8 +51,10 @@ function wp_load_press_this() {
'action' => 'install-plugin',
'plugin' => $plugin_slug,
'from' => 'press-this',
), self_admin_url( 'update.php' )
), 'install-plugin_' . $plugin_slug
),
self_admin_url( 'update.php' )
),
'install-plugin_' . $plugin_slug
);
$action = sprintf(
'<a href="%1$s" class="install-now" data-slug="%2$s" data-name="%2$s" aria-label="%3$s">%3$s</a>',

View File

@ -195,16 +195,19 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
</th>
<td>
<?php
$has_pages = (bool) get_posts( array(
$has_pages = (bool) get_posts(
array(
'post_type' => 'page',
'posts_per_page' => 1,
'post_status' => array(
'publish',
'draft',
),
) );
)
);
if ( $has_pages ) : ?>
if ( $has_pages ) :
?>
<form method="post" action="">
<label for="page_for_privacy_policy">
<?php _e( 'Select an existing page:' ); ?>

View File

@ -63,7 +63,8 @@ switch ( $action ) {
array(
'message' => 5,
'revision' => $revision->ID,
), get_edit_post_link( $post->ID, 'url' )
),
get_edit_post_link( $post->ID, 'url' )
);
break;
case 'view':

View File

@ -102,7 +102,7 @@ function setup_config_display_header( $body_classes = array() ) {
}
header( 'Content-Type: text/html; charset=utf-8' );
?>
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
<head>
@ -114,7 +114,7 @@ function setup_config_display_header( $body_classes = array() ) {
</head>
<body class="<?php echo implode( ' ', $body_classes ); ?>">
<p id="logo"><a href="<?php echo esc_url( __( 'https://wordpress.org/' ) ); ?>" tabindex="-1"><?php _e( 'WordPress' ); ?></a></p>
<?php
<?php
} // end function setup_config_display_header();
$language = '';
@ -154,7 +154,7 @@ switch ( $step ) {
if ( ! empty( $loaded_language ) ) {
$step_1 .= '&amp;language=' . $loaded_language;
}
?>
?>
<h1 class="screen-reader-text"><?php _e( 'Before getting started' ); ?></h1>
<p><?php _e( 'Welcome to WordPress. Before getting started, we need some information on the database. You will need to know the following items before proceeding.' ); ?></p>
<ol>
@ -165,7 +165,7 @@ switch ( $step ) {
<li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li>
</ol>
<p>
<?php
<?php
/* translators: %s: wp-config.php */
printf(
__( 'We&#8217;re going to use this information to create a %s file.' ),
@ -188,12 +188,12 @@ switch ( $step ) {
__( 'Need more help? <a href="%s">We got it</a>.' ),
__( 'https://codex.wordpress.org/Editing_wp-config.php' )
);
?>
?>
</p>
<p><?php _e( 'In all likelihood, these items were supplied to you by your Web Host. If you don&#8217;t have this information, then you will need to contact them before you can continue. If you&#8217;re all ready&hellip;' ); ?></p>
<p class="step"><a href="<?php echo $step_1; ?>" class="button button-large"><?php _e( 'Let&#8217;s go!' ); ?></a></p>
<?php
<?php
break;
case 1:
@ -239,12 +239,12 @@ switch ( $step ) {
</table>
<?php
if ( isset( $_GET['noapi'] ) ) {
?>
?>
<input name="noapi" type="hidden" value="1" /><?php } ?>
<input type="hidden" name="language" value="<?php echo esc_attr( $language ); ?>" />
<p class="step"><input name="submit" type="submit" value="<?php echo htmlspecialchars( __( 'Submit' ), ENT_QUOTES ); ?>" class="button button-large" /></p>
</form>
<?php
<?php
break;
case 2:
@ -389,13 +389,13 @@ switch ( $step ) {
setup_config_display_header();
?>
<p>
<?php
<?php
/* translators: %s: wp-config.php */
printf( __( 'Sorry, but I can&#8217;t write the %s file.' ), '<code>wp-config.php</code>' );
?>
?>
</p>
<p>
<?php
<?php
/* translators: %s: wp-config.php */
printf( __( 'You can create the %s file manually and paste the following text into it.' ), '<code>wp-config.php</code>' );
@ -404,7 +404,7 @@ switch ( $step ) {
foreach ( $config_file as $line ) {
$config_text .= htmlentities( $line, ENT_COMPAT, 'UTF-8' );
}
?>
?>
</p>
<textarea id="wp-config" cols="98" rows="15" class="code" readonly="readonly"><?php echo $config_text; ?></textarea>
<p><?php _e( 'After you&#8217;ve done that, click &#8220;Run the installation.&#8221;' ); ?></p>
@ -418,7 +418,7 @@ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) {
}
})();
</script>
<?php
<?php
else :
/*
* If this file doesn't exist, then we are using the wp-config-sample.php
@ -437,12 +437,12 @@ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) {
fclose( $handle );
chmod( $path_to_wp_config, 0666 );
setup_config_display_header();
?>
?>
<h1 class="screen-reader-text"><?php _e( 'Successful database connection' ); ?></h1>
<p><?php _e( 'All right, sparky! You&#8217;ve made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;' ); ?></p>
<p class="step"><a href="<?php echo $install; ?>" class="button button-large"><?php _e( 'Run the installation' ); ?></a></p>
<?php
<?php
endif;
break;
}

View File

@ -177,7 +177,7 @@ if ( 'POST' === $_SERVER['REQUEST_METHOD'] ) {
if ( $file_description != $file_show ) {
$description .= ' <span>(' . esc_html( $file_show ) . ')</span>';
}
?>
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
@ -271,7 +271,7 @@ if ( $theme->errors() ) {
if ( $error ) :
echo '<div class="error"><p>' . __( 'Oops, no such file exists! Double check the name and try again, merci.' ) . '</p></div>';
else :
?>
?>
<form name="template" id="template" action="theme-editor.php" method="post">
<?php wp_nonce_field( 'edit-theme_' . $stylesheet . '_' . $relative_file, 'nonce' ); ?>
<div>
@ -314,7 +314,7 @@ else :
</div>
<?php wp_print_file_editor_templates(); ?>
</form>
<?php
<?php
endif; // $error
?>
<br class="clear" />
@ -331,7 +331,7 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
} else {
$return_url = admin_url( '/' );
}
?>
?>
<div id="file-editor-warning" class="notification-dialog-wrap file-editor-warning hide-if-no-js hidden">
<div class="notification-dialog-background"></div>
<div class="notification-dialog">
@ -356,7 +356,7 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) :
</div>
</div>
</div>
<?php
<?php
endif; // editor warning notice
include( ABSPATH . 'wp-admin/admin-footer.php' );

View File

@ -41,7 +41,9 @@ foreach ( $installed_themes as $k => $v ) {
}
wp_localize_script(
'theme', '_wpThemeSettings', array(
'theme',
'_wpThemeSettings',
array(
'themes' => false,
'settings' => array(
'isInstall' => true,

View File

@ -133,7 +133,9 @@ if ( current_user_can( 'switch_themes' ) ) {
wp_reset_vars( array( 'theme', 'search' ) );
wp_localize_script(
'theme', '_wpThemeSettings', array(
'theme',
'_wpThemeSettings',
array(
'themes' => $themes,
'settings' => array(
'canInstall' => ( ! is_multisite() && current_user_can( 'install_themes' ) ),
@ -172,9 +174,9 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<hr class="wp-header-end">
<?php
if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) :
?>
?>
<div id="message1" class="updated notice is-dismissible"><p><?php _e( 'The active theme is broken. Reverting to the default theme.' ); ?></p></div>
<?php
<?php
elseif ( isset( $_GET['activated'] ) ) :
if ( isset( $_GET['previewed'] ) ) {
?>
@ -188,7 +190,7 @@ elseif ( isset( $_GET['activated'] ) ) :
<div id="message3" class="updated notice is-dismissible"><p><?php _e( 'Theme deleted.' ); ?></p></div>
<?php elseif ( isset( $_GET['delete-active-child'] ) ) : ?>
<div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>
<?php
<?php
endif;
$ct = wp_get_theme();
@ -335,16 +337,16 @@ foreach ( $themes as $theme ) :
<?php
// List broken themes, if any.
if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes = wp_get_themes( array( 'errors' => true ) ) ) {
?>
?>
<div class="broken-themes">
<h3><?php _e( 'Broken Themes' ); ?></h3>
<p><?php _e( 'The following themes are installed but incomplete.' ); ?></p>
<?php
$can_delete = current_user_can( 'delete_themes' );
$can_install = current_user_can( 'install_themes' );
?>
<?php
$can_delete = current_user_can( 'delete_themes' );
$can_install = current_user_can( 'install_themes' );
?>
<table>
<tr>
<th><?php _ex( 'Name', 'theme name' ); ?></th>
@ -367,7 +369,8 @@ $can_install = current_user_can( 'install_themes' );
array(
'action' => 'delete',
'stylesheet' => urlencode( $stylesheet ),
), admin_url( 'themes.php' )
),
admin_url( 'themes.php' )
);
$delete_url = wp_nonce_url( $delete_url, 'delete-theme_' . $stylesheet );
?>
@ -384,7 +387,8 @@ $can_install = current_user_can( 'install_themes' );
array(
'action' => 'install-theme',
'theme' => urlencode( $parent_theme_name ),
), admin_url( 'update.php' )
),
admin_url( 'update.php' )
);
$install_url = wp_nonce_url( $install_url, 'install-theme_' . $parent_theme_name );
?>
@ -398,7 +402,7 @@ $can_install = current_user_can( 'install_themes' );
</table>
</div>
<?php
<?php
}
?>
</div><!-- .wrap -->
@ -533,7 +537,9 @@ wp_print_admin_notice_templates();
wp_print_update_row_templates();
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'totals' => wp_get_update_data(),
)
);

View File

@ -19,19 +19,21 @@ if ( $is_privacy_guide ) {
} else {
$title = __('Tools');
$title = __( 'Tools' );
get_current_screen()->add_help_tab( array(
get_current_screen()->add_help_tab(
array(
'id' => 'converter',
'title' => __('Categories and Tags Converter'),
'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
'title' => __( 'Categories and Tags Converter' ),
'content' => '<p>' . __( 'Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' .
'<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin &amp; Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>',
) );
)
);
get_current_screen()->set_help_sidebar(
'<p><strong>' . __('For more information:') . '</strong></p>' .
'<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>') . '</p>' .
'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
'<p>' . __( '<a href="https://codex.wordpress.org/Tools_Screen">Documentation on Tools</a>' ) . '</p>' .
'<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
);
}
@ -52,12 +54,13 @@ if ( $is_privacy_guide ) {
} else {
if ( current_user_can( 'import' ) ) :
$cats = get_taxonomy('category');
$tags = get_taxonomy('post_tag');
if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?>
$cats = get_taxonomy( 'category' );
$tags = get_taxonomy( 'post_tag' );
if ( current_user_can( $cats->cap->manage_terms ) || current_user_can( $tags->cap->manage_terms ) ) :
?>
<div class="card">
<h2 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h2>
<p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p>
<h2 class="title"><?php _e( 'Categories and Tags Converter' ); ?></h2>
<p><?php printf( __( 'If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.' ), 'import.php' ); ?></p>
</div>
<?php
endif;

View File

@ -249,7 +249,7 @@ function list_plugin_updates() {
<h2><?php _e( 'Plugins' ); ?></h2>
<p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click &#8220;Update Plugins&#8221;.' ); ?></p>
<form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-plugins" class="upgrade">
<?php wp_nonce_field( 'upgrade-core' ); ?>
<?php wp_nonce_field( 'upgrade-core' ); ?>
<p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e( 'Update Plugins' ); ?>" name="upgrade" /></p>
<table class="widefat updates-table" id="update-plugins-table">
<thead>
@ -260,8 +260,8 @@ function list_plugin_updates() {
</thead>
<tbody class="plugins">
<?php
foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
<?php
foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
$icon = '<span class="dashicons dashicons-admin-plugins"></span>';
@ -334,8 +334,8 @@ foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
</p></td>
</tr>
<?php
}
?>
}
?>
</tbody>
<tfoot>
@ -347,7 +347,7 @@ foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
</table>
<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php esc_attr_e( 'Update Plugins' ); ?>" name="upgrade" /></p>
</form>
<?php
<?php
}
/**
@ -362,12 +362,12 @@ function list_theme_updates() {
}
$form_action = 'update-core.php?action=do-theme-upgrade';
?>
?>
<h2><?php _e( 'Themes' ); ?></h2>
<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click &#8220;Update Themes&#8221;.' ); ?></p>
<p><?php printf( __( '<strong>Please Note:</strong> Any customizations you have made to theme files will be lost. Please consider using <a href="%s">child themes</a> for modifications.' ), __( 'https://codex.wordpress.org/Child_Themes' ) ); ?></p>
<form method="post" action="<?php echo esc_url( $form_action ); ?>" name="upgrade-themes" class="upgrade">
<?php wp_nonce_field( 'upgrade-core' ); ?>
<?php wp_nonce_field( 'upgrade-core' ); ?>
<p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e( 'Update Themes' ); ?>" name="upgrade" /></p>
<table class="widefat updates-table" id="update-themes-table">
<thead>
@ -378,8 +378,8 @@ function list_theme_updates() {
</thead>
<tbody class="plugins">
<?php
foreach ( $themes as $stylesheet => $theme ) {
<?php
foreach ( $themes as $stylesheet => $theme ) {
$checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );
?>
<tr>
@ -409,8 +409,8 @@ foreach ( $themes as $stylesheet => $theme ) {
</p></td>
</tr>
<?php
}
?>
}
?>
</tbody>
<tfoot>
@ -422,7 +422,7 @@ foreach ( $themes as $stylesheet => $theme ) {
</table>
<p><input id="upgrade-themes-2" class="button" type="submit" value="<?php esc_attr_e( 'Update Themes' ); ?>" name="upgrade" /></p>
</form>
<?php
<?php
}
/**
@ -481,52 +481,53 @@ function do_core_upgrade( $reinstall = false ) {
// that it's safe to do so. This only happens when there are no new files to create.
$allow_relaxed_file_ownership = ! $reinstall && isset( $update->new_files ) && ! $update->new_files;
?>
?>
<div class="wrap">
<h1><?php _e( 'Update WordPress' ); ?></h1>
<?php
<?php
if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ) ) ) {
if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ) ) ) {
echo '</div>';
return;
}
}
if ( ! WP_Filesystem( $credentials, ABSPATH, $allow_relaxed_file_ownership ) ) {
if ( ! WP_Filesystem( $credentials, ABSPATH, $allow_relaxed_file_ownership ) ) {
// Failed to connect, Error and request again
request_filesystem_credentials( $url, '', true, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership );
echo '</div>';
return;
}
}
if ( $wp_filesystem->errors->has_errors() ) {
if ( $wp_filesystem->errors->has_errors() ) {
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) {
show_message( $message );
}
echo '</div>';
return;
}
}
if ( $reinstall ) {
if ( $reinstall ) {
$update->response = 'reinstall';
}
}
add_filter( 'update_feedback', 'show_message' );
$upgrader = new Core_Upgrader();
$result = $upgrader->upgrade(
$update, array(
$update,
array(
'allow_relaxed_file_ownership' => $allow_relaxed_file_ownership,
)
);
if ( is_wp_error( $result ) ) {
if ( is_wp_error( $result ) ) {
show_message( $result );
if ( 'up_to_date' != $result->get_error_code() && 'locked' != $result->get_error_code() ) {
show_message( __( 'Installation Failed' ) );
}
echo '</div>';
return;
}
}
show_message( __( 'WordPress updated successfully' ) );
show_message( '<span class="hide-if-no-js">' . sprintf( __( 'Welcome to WordPress %1$s. You will be redirected to the About WordPress screen. If not, click <a href="%2$s">here</a>.' ), $result, esc_url( self_admin_url( 'about.php?updated' ) ) ) . '</span>' );
@ -668,7 +669,9 @@ if ( 'upgrade-core' == $action ) {
echo '</div>';
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'totals' => wp_get_update_data(),
)
);
@ -702,7 +705,9 @@ if ( 'upgrade-core' == $action ) {
}
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'totals' => wp_get_update_data(),
)
);
@ -738,7 +743,9 @@ if ( 'upgrade-core' == $action ) {
echo '</div>';
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'totals' => wp_get_update_data(),
)
);
@ -776,7 +783,9 @@ if ( 'upgrade-core' == $action ) {
<?php
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'totals' => wp_get_update_data(),
)
);
@ -803,7 +812,9 @@ if ( 'upgrade-core' == $action ) {
$result = $upgrader->bulk_upgrade();
wp_localize_script(
'updates', '_wpUpdatesItemCounts', array(
'updates',
'_wpUpdatesItemCounts',
array(
'totals' => wp_get_update_data(),
)
);

View File

@ -106,7 +106,8 @@ if ( isset( $_GET['action'] ) ) {
check_admin_referer( 'install-plugin_' . $plugin );
$api = plugins_api(
'plugin_information', array(
'plugin_information',
array(
'slug' => $plugin,
'fields' => array(
'sections' => false,
@ -225,7 +226,8 @@ if ( isset( $_GET['action'] ) ) {
check_admin_referer( 'install-theme_' . $theme );
$api = themes_api(
'theme_information', array(
'theme_information',
array(
'slug' => $theme,
'fields' => array(
'sections' => false,

View File

@ -78,7 +78,7 @@ if ( file_exists( WP_CONTENT_DIR . '/db.php' ) && empty( $wpdb->is_mysql ) ) {
<p><?php _e( 'Your WordPress database is already up-to-date!' ); ?></p>
<p class="step"><a class="button button-large" href="<?php echo get_option( 'home' ); ?>/"><?php _e( 'Continue' ); ?></a></p>
<?php
<?php
elseif ( ! $php_compat || ! $mysql_compat ) :
if ( ! $mysql_compat && ! $php_compat ) {
printf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version );
@ -87,8 +87,8 @@ elseif ( ! $php_compat || ! $mysql_compat ) :
} elseif ( ! $mysql_compat ) {
printf( __( 'You cannot update because <a href="https://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version );
}
?>
<?php
?>
<?php
else :
switch ( $step ) :
case 0:
@ -102,7 +102,7 @@ else :
<p><?php _e( 'WordPress has been updated! Before we send you on your way, we have to update your database to the newest version.' ); ?></p>
<p><?php _e( 'The database update process may take a little while, so please be patient.' ); ?></p>
<p class="step"><a class="button button-large button-primary" href="upgrade.php?step=1&amp;backto=<?php echo $goback; ?>"><?php _e( 'Update WordPress Database' ); ?></a></p>
<?php
<?php
break;
case 1:
wp_upgrade();
@ -117,13 +117,13 @@ else :
<!--
<pre>
<?php printf( __( '%s queries' ), $wpdb->num_queries ); ?>
<?php printf( __( '%s queries' ), $wpdb->num_queries ); ?>
<?php printf( __( '%s seconds' ), timer_stop( 0 ) ); ?>
<?php printf( __( '%s seconds' ), timer_stop( 0 ) ); ?>
</pre>
-->
<?php
<?php
break;
endswitch;
endif;

View File

@ -40,7 +40,9 @@ if ( 'grid' === $mode ) {
}
wp_localize_script(
'media-grid', '_wpMediaGridSettings', array(
'media-grid',
'_wpMediaGridSettings',
array(
'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ),
'queryVars' => (object) $vars,
)
@ -160,7 +162,8 @@ if ( $doaction ) {
array(
'trashed' => count( $post_ids ),
'ids' => join( ',', $post_ids ),
), $location
),
$location
);
break;
case 'untrash':
@ -263,7 +266,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<?php
if ( current_user_can( 'upload_files' ) ) {
?>
?>
<a href="<?php echo admin_url( 'media-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a>
<?php
}
@ -351,7 +354,7 @@ if ( ! empty( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) {
}
if ( ! empty( $message ) ) {
?>
?>
<div id="message" class="updated notice is-dismissible"><p><?php echo $message; ?></p></div>
<?php } ?>

View File

@ -189,7 +189,7 @@ switch ( $action ) {
<?php if ( ! IS_PROFILE_PAGE && is_super_admin( $profileuser->ID ) && current_user_can( 'manage_network_options' ) ) { ?>
<div class="notice notice-info"><p><strong><?php _e( 'Important:' ); ?></strong> <?php _e( 'This user has super admin privileges.' ); ?></p></div>
<?php } ?>
<?php if ( isset( $_GET['updated'] ) ) : ?>
<?php if ( isset( $_GET['updated'] ) ) : ?>
<div id="message" class="updated notice is-dismissible">
<?php if ( IS_PROFILE_PAGE ) : ?>
<p><strong><?php _e( 'Profile updated.' ); ?></strong></p>
@ -200,27 +200,27 @@ switch ( $action ) {
<p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), self_admin_url( 'users.php' ) ) ); ?>"><?php _e( '&larr; Back to Users' ); ?></a></p>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( isset( $_GET['error'] ) ) : ?>
<?php endif; ?>
<?php if ( isset( $_GET['error'] ) ) : ?>
<div class="notice notice-error">
<?php if ( 'new-email' == $_GET['error'] ) : ?>
<p><?php _e( 'Error while saving the new email address. Please try again.' ); ?></p>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
<?php endif; ?>
<?php if ( isset( $errors ) && is_wp_error( $errors ) ) : ?>
<div class="error"><p><?php echo implode( "</p>\n<p>", $errors->get_error_messages() ); ?></p></div>
<?php endif; ?>
<?php endif; ?>
<div class="wrap" id="profile-page">
<h1 class="wp-heading-inline">
<?php
echo esc_html( $title );
?>
<?php
echo esc_html( $title );
?>
</h1>
<?php
if ( ! IS_PROFILE_PAGE ) {
<?php
if ( ! IS_PROFILE_PAGE ) {
if ( current_user_can( 'create_users' ) ) {
?>
<a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
@ -228,8 +228,8 @@ if ( ! IS_PROFILE_PAGE ) {
<a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php
}
}
?>
}
?>
<hr class="wp-header-end">
@ -244,9 +244,9 @@ if ( ! IS_PROFILE_PAGE ) {
?>
>
<?php wp_nonce_field( 'update-user_' . $user_id ); ?>
<?php if ( $wp_http_referer ) : ?>
<?php if ( $wp_http_referer ) : ?>
<input type="hidden" name="wp_http_referer" value="<?php echo esc_url( $wp_http_referer ); ?>" />
<?php endif; ?>
<?php endif; ?>
<p>
<input type="hidden" name="from" value="profile" />
<input type="hidden" name="checkuser_id" value="<?php echo get_current_user_id(); ?>" />
@ -255,14 +255,14 @@ if ( ! IS_PROFILE_PAGE ) {
<h2><?php _e( 'Personal Options' ); ?></h2>
<table class="form-table">
<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>
<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>
<tr class="user-rich-editing-wrap">
<th scope="row"><?php _e( 'Visual Editor' ); ?></th>
<td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td>
</tr>
<?php endif; ?>
<?php
$show_syntax_highlighting_preference = (
<?php endif; ?>
<?php
$show_syntax_highlighting_preference = (
// For Custom HTML widget and Additional CSS in Customizer.
user_can( $profileuser, 'edit_theme_options' )
||
@ -281,11 +281,11 @@ $show_syntax_highlighting_preference = (
</td>
</tr>
<?php endif; ?>
<?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
<?php if ( count( $_wp_admin_css_colors ) > 1 && has_action( 'admin_color_scheme_picker' ) ) : ?>
<tr class="user-admin-color-wrap">
<th scope="row"><?php _e( 'Admin Color Scheme' ); ?></th>
<td>
<?php
<?php
/**
* Fires in the 'Admin Color Scheme' section of the user editing screen.
*
@ -298,13 +298,13 @@ $show_syntax_highlighting_preference = (
* @param int $user_id The user ID.
*/
do_action( 'admin_color_scheme_picker', $user_id );
?>
?>
</td>
</tr>
<?php
<?php
endif; // $_wp_admin_css_colors
if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) :
?>
?>
<tr class="user-comment-shortcuts-wrap">
<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e( 'Enable keyboard shortcuts for comment moderation.' ); ?></label> <?php _e( '<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>' ); ?></td>
@ -315,15 +315,15 @@ if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) :
<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Toolbar' ); ?></span></legend>
<label for="admin_bar_front">
<input name="admin_bar_front" type="checkbox" id="admin_bar_front" value="1"<?php checked( _get_admin_bar_pref( 'front', $profileuser->ID ) ); ?> />
<?php _e( 'Show Toolbar when viewing site' ); ?></label><br />
<?php _e( 'Show Toolbar when viewing site' ); ?></label><br />
</fieldset>
</td>
</tr>
<?php
$languages = get_available_languages();
if ( $languages ) :
?>
<?php
$languages = get_available_languages();
if ( $languages ) :
?>
<tr class="user-language-wrap">
<th scope="row">
<?php /* translators: The user language selection field label */ ?>
@ -352,24 +352,24 @@ if ( $languages ) :
?>
</td>
</tr>
<?php
<?php
endif;
?>
?>
<?php
/**
<?php
/**
* Fires at the end of the 'Personal Options' settings table on the user editing screen.
*
* @since 2.7.0
*
* @param WP_User $profileuser The current WP_User object.
*/
do_action( 'personal_options', $profileuser );
?>
do_action( 'personal_options', $profileuser );
?>
</table>
<?php
if ( IS_PROFILE_PAGE ) {
<?php
if ( IS_PROFILE_PAGE ) {
/**
* Fires after the 'Personal Options' settings table on the 'Your Profile' editing screen.
*
@ -380,8 +380,8 @@ if ( IS_PROFILE_PAGE ) {
* @param WP_User $profileuser The current WP_User object.
*/
do_action( 'profile_personal_options', $profileuser );
}
?>
}
?>
<h2><?php _e( 'Name' ); ?></h2>
@ -391,33 +391,33 @@ if ( IS_PROFILE_PAGE ) {
<td><input type="text" name="user_login" id="user_login" value="<?php echo esc_attr( $profileuser->user_login ); ?>" disabled="disabled" class="regular-text" /> <span class="description"><?php _e( 'Usernames cannot be changed.' ); ?></span></td>
</tr>
<?php if ( ! IS_PROFILE_PAGE && ! is_network_admin() && current_user_can( 'promote_user', $profileuser->ID ) ) : ?>
<?php if ( ! IS_PROFILE_PAGE && ! is_network_admin() && current_user_can( 'promote_user', $profileuser->ID ) ) : ?>
<tr class="user-role-wrap"><th><label for="role"><?php _e( 'Role' ); ?></label></th>
<td><select name="role" id="role">
<?php
// Compare user role against currently editable roles
$user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) );
$user_role = reset( $user_roles );
<?php
// Compare user role against currently editable roles
$user_roles = array_intersect( array_values( $profileuser->roles ), array_keys( get_editable_roles() ) );
$user_role = reset( $user_roles );
// print the full list of roles with the primary one selected.
wp_dropdown_roles( $user_role );
// print the full list of roles with the primary one selected.
wp_dropdown_roles( $user_role );
// print the 'no role' option. Make it selected if the user has no role yet.
if ( $user_role ) {
// print the 'no role' option. Make it selected if the user has no role yet.
if ( $user_role ) {
echo '<option value="">' . __( '&mdash; No role for this site &mdash;' ) . '</option>';
} else {
} else {
echo '<option value="" selected="selected">' . __( '&mdash; No role for this site &mdash;' ) . '</option>';
}
?>
}
?>
</select></td></tr>
<?php
<?php
endif; //!IS_PROFILE_PAGE
if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_can( 'manage_network_options' ) && ! isset( $super_admins ) ) {
?>
?>
<tr class="user-super-admin-wrap"><th><?php _e( 'Super Admin' ); ?></th>
<td>
<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) || ! is_super_admin( $profileuser->ID ) ) : ?>
<?php if ( $profileuser->user_email != get_site_option( 'admin_email' ) || ! is_super_admin( $profileuser->ID ) ) : ?>
<p><label><input type="checkbox" id="super_admin" name="super_admin"<?php checked( is_super_admin( $profileuser->ID ) ); ?> /> <?php _e( 'Grant this user super admin privileges for the Network.' ); ?></label></p>
<?php else : ?>
<p><?php _e( 'Super admin privileges cannot be removed because this user has the network admin email.' ); ?></p>
@ -558,7 +558,7 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
<p class="description"><?php _e( 'Share a little biographical information to fill out your profile. This may be shown publicly.' ); ?></p></td>
</tr>
<?php if ( get_option( 'show_avatars' ) ) : ?>
<?php if ( get_option( 'show_avatars' ) ) : ?>
<tr class="user-profile-picture">
<th><?php _e( 'Profile Picture' ); ?></th>
<td>
@ -644,11 +644,11 @@ if ( is_multisite() && is_network_admin() && ! IS_PROFILE_PAGE && current_user_c
</label>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php
if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) :
?>
<?php
if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) :
?>
<tr class="user-sessions-wrap hide-if-no-js">
<th><?php _e( 'Sessions' ); ?></th>
<td aria-live="assertive">
@ -731,31 +731,31 @@ if ( IS_PROFILE_PAGE && count( $sessions->get_all() ) === 1 ) :
<tr class="user-capabilities-wrap">
<th scope="row"><?php _e( 'Capabilities' ); ?></th>
<td>
<?php
<?php
$output = '';
foreach ( $profileuser->caps as $cap => $value ) {
foreach ( $profileuser->caps as $cap => $value ) {
if ( ! $wp_roles->is_role( $cap ) ) {
if ( '' != $output ) {
$output .= ', ';
}
$output .= $value ? $cap : sprintf( __( 'Denied: %s' ), $cap );
}
}
}
echo $output;
?>
?>
</td>
</tr>
</table>
<?php endif; ?>
<?php endif; ?>
<input type="hidden" name="action" value="update" />
<input type="hidden" name="user_id" id="user_id" value="<?php echo esc_attr( $user_id ); ?>" />
<?php submit_button( IS_PROFILE_PAGE ? __( 'Update Profile' ) : __( 'Update User' ) ); ?>
<?php submit_button( IS_PROFILE_PAGE ? __( 'Update Profile' ) : __( 'Update User' ) ); ?>
</form>
</div>
<?php
<?php
break;
}
?>

View File

@ -79,7 +79,8 @@ if ( isset( $_REQUEST['action'] ) && 'adduser' == $_REQUEST['action'] ) {
array(
'update' => 'addnoconfirmation',
'user_id' => $user_id,
), 'user-new.php'
),
'user-new.php'
);
} else {
$redirect = add_query_arg( array( 'update' => 'could_not_add' ), 'user-new.php' );
@ -87,7 +88,8 @@ if ( isset( $_REQUEST['action'] ) && 'adduser' == $_REQUEST['action'] ) {
} else {
$newuser_key = wp_generate_password( 20, false );
add_option(
'new_user_' . $newuser_key, array(
'new_user_' . $newuser_key,
array(
'user_id' => $user_id,
'email' => $user_details->user_email,
'role' => $_REQUEST['role'],
@ -176,7 +178,9 @@ Please click the following link to confirm the invite:
add_filter( 'wpmu_welcome_user_notification', '__return_false' ); // Disable welcome email
}
wpmu_signup_user(
$new_user_login, $new_user_email, array(
$new_user_login,
$new_user_email,
array(
'add_to_blog' => get_current_blog_id(),
'new_role' => $_REQUEST['role'],
)
@ -193,7 +197,8 @@ Please click the following link to confirm the invite:
array(
'update' => 'addnoconfirmation',
'user_id' => $new_user['user_id'],
), 'user-new.php'
),
'user-new.php'
);
}
} else {
@ -343,7 +348,7 @@ if ( current_user_can( 'create_users' ) ) {
?>
</ul>
</div>
<?php
<?php
endif;
if ( ! empty( $messages ) ) {
@ -378,19 +383,19 @@ if ( is_multisite() && current_user_can( 'promote_users' ) ) {
$label = __( 'Email or Username' );
$type = 'text';
}
?>
?>
<form method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"
<?php
<?php
/**
* Fires inside the adduser form tag.
*
* @since 3.0.0
*/
do_action( 'user_new_form_tag' );
?>
?>
>
<input name="action" type="hidden" value="adduser" />
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>
<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ); ?>
<table class="form-table">
<tr class="form-field form-required">
@ -404,7 +409,7 @@ if ( is_multisite() && current_user_can( 'promote_users' ) ) {
</select>
</td>
</tr>
<?php if ( current_user_can( 'manage_network_users' ) ) { ?>
<?php if ( current_user_can( 'manage_network_users' ) ) { ?>
<tr>
<th scope="row"><?php _e( 'Skip Confirmation Email' ); ?></th>
<td>
@ -414,8 +419,8 @@ if ( is_multisite() && current_user_can( 'promote_users' ) ) {
</tr>
<?php } ?>
</table>
<?php
/**
<?php
/**
* Fires at the end of the new user form.
*
* Passes a contextual string to make both types of new user forms
@ -426,41 +431,41 @@ if ( is_multisite() && current_user_can( 'promote_users' ) ) {
*
* @param string $type A contextual string specifying which type of new user form the hook follows.
*/
do_action( 'user_new_form', 'add-existing-user' );
?>
<?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>
do_action( 'user_new_form', 'add-existing-user' );
?>
<?php submit_button( __( 'Add Existing User' ), 'primary', 'adduser', true, array( 'id' => 'addusersub' ) ); ?>
</form>
<?php
<?php
} // is_multisite()
if ( current_user_can( 'create_users' ) ) {
if ( $do_both ) {
echo '<h2 id="create-new-user">' . __( 'Add New User' ) . '</h2>';
}
?>
?>
<p><?php _e( 'Create a brand new user and add them to this site.' ); ?></p>
<form method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"
<?php
<?php
/** This action is documented in wp-admin/user-new.php */
do_action( 'user_new_form_tag' );
?>
?>
>
<input name="action" type="hidden" value="createuser" />
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
<?php
// Load up the passed data, else set to a default.
$creating = isset( $_POST['createuser'] );
<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
<?php
// Load up the passed data, else set to a default.
$creating = isset( $_POST['createuser'] );
$new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';
$new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : '';
$new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : '';
$new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : '';
$new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : '';
$new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : '';
$new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true;
$new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : '';
$new_user_login = $creating && isset( $_POST['user_login'] ) ? wp_unslash( $_POST['user_login'] ) : '';
$new_user_firstname = $creating && isset( $_POST['first_name'] ) ? wp_unslash( $_POST['first_name'] ) : '';
$new_user_lastname = $creating && isset( $_POST['last_name'] ) ? wp_unslash( $_POST['last_name'] ) : '';
$new_user_email = $creating && isset( $_POST['email'] ) ? wp_unslash( $_POST['email'] ) : '';
$new_user_uri = $creating && isset( $_POST['url'] ) ? wp_unslash( $_POST['url'] ) : '';
$new_user_role = $creating && isset( $_POST['role'] ) ? wp_unslash( $_POST['role'] ) : '';
$new_user_send_notification = $creating && ! isset( $_POST['send_user_notification'] ) ? false : true;
$new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? wp_unslash( $_POST['noconfirmation'] ) : '';
?>
?>
<table class="form-table">
<tr class="form-field form-required">
<th scope="row"><label for="user_login"><?php _e( 'Username' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
@ -470,7 +475,7 @@ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? w
<th scope="row"><label for="email"><?php _e( 'Email' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
<td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td>
</tr>
<?php if ( ! is_multisite() ) { ?>
<?php if ( ! is_multisite() ) { ?>
<tr class="form-field">
<th scope="row"><label for="first_name"><?php _e( 'First Name' ); ?> </label></th>
<td><input name="first_name" type="text" id="first_name" value="<?php echo esc_attr( $new_user_firstname ); ?>" /></td>
@ -555,12 +560,12 @@ $new_user_ignore_pass = $creating && isset( $_POST['noconfirmation'] ) ? w
<?php } ?>
</table>
<?php
/** This action is documented in wp-admin/user-new.php */
do_action( 'user_new_form', 'add-new-user' );
?>
<?php
/** This action is documented in wp-admin/user-new.php */
do_action( 'user_new_form', 'add-new-user' );
?>
<?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>
<?php submit_button( __( 'Add New User' ), 'primary', 'createuser', true, array( 'id' => 'createusersub' ) ); ?>
</form>
<?php } // current_user_can('create_users') ?>

View File

@ -206,7 +206,8 @@ switch ( $wp_list_table->current_action() ) {
array(
'delete_count' => $delete_count,
'update' => $update,
), $redirect
),
$redirect
);
wp_redirect( $redirect );
exit();
@ -248,26 +249,26 @@ switch ( $wp_list_table->current_action() ) {
?>
<form method="post" name="updateusers" id="updateusers">
<?php wp_nonce_field( 'delete-users' ); ?>
<?php echo $referer; ?>
<?php echo $referer; ?>
<div class="wrap">
<h1><?php _e( 'Delete Users' ); ?></h1>
<?php if ( isset( $_REQUEST['error'] ) ) : ?>
<?php if ( isset( $_REQUEST['error'] ) ) : ?>
<div class="error">
<p><strong><?php _e( 'ERROR:' ); ?></strong> <?php _e( 'Please select an option.' ); ?></p>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ( 1 == count( $userids ) ) : ?>
<?php if ( 1 == count( $userids ) ) : ?>
<p><?php _e( 'You have specified this user for deletion:' ); ?></p>
<?php else : ?>
<?php else : ?>
<p><?php _e( 'You have specified these users for deletion:' ); ?></p>
<?php endif; ?>
<?php endif; ?>
<ul>
<?php
<?php
$go_delete = 0;
foreach ( $userids as $id ) {
foreach ( $userids as $id ) {
$user = get_userdata( $id );
if ( $id == $current_user->ID ) {
/* translators: 1: user id, 2: user login */
@ -277,7 +278,7 @@ foreach ( $userids as $id ) {
echo '<li><input type="hidden" name="users[]" value="' . esc_attr( $id ) . '" />' . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
$go_delete++;
}
}
}
?>
</ul>
<?php
@ -320,7 +321,7 @@ foreach ( $userids as $id ) {
* @param int[] $userids Array of IDs for users being deleted.
*/
do_action( 'delete_user_form', $current_user, $userids );
?>
?>
<input type="hidden" name="action" value="dodelete" />
<?php submit_button( __( 'Confirm Deletion' ), 'primary' ); ?>
<?php else : ?>
@ -390,21 +391,21 @@ foreach ( $userids as $id ) {
?>
<form method="post" name="updateusers" id="updateusers">
<?php wp_nonce_field( 'remove-users' ); ?>
<?php echo $referer; ?>
<?php echo $referer; ?>
<div class="wrap">
<h1><?php _e( 'Remove Users from Site' ); ?></h1>
<?php if ( 1 == count( $userids ) ) : ?>
<?php if ( 1 == count( $userids ) ) : ?>
<p><?php _e( 'You have specified this user for removal:' ); ?></p>
<?php else : ?>
<?php else : ?>
<p><?php _e( 'You have specified these users for removal:' ); ?></p>
<?php endif; ?>
<?php endif; ?>
<ul>
<?php
<?php
$go_remove = false;
foreach ( $userids as $id ) {
foreach ( $userids as $id ) {
$id = (int) $id;
$user = get_userdata( $id );
if ( ! current_user_can( 'remove_user', $id ) ) {
@ -415,7 +416,7 @@ foreach ( $userids as $id ) {
echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf( __( 'ID #%1$s: %2$s' ), $id, $user->user_login ) . "</li>\n";
$go_remove = true;
}
}
}
?>
</ul>
<?php if ( $go_remove ) : ?>
@ -476,7 +477,8 @@ foreach ( $userids as $id ) {
__( 'New user created. <a href="%s">Edit user</a>' ),
esc_url(
add_query_arg(
'wp_http_referer', urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
'wp_http_referer',
urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ),
self_admin_url( 'user-edit.php?user_id=' . $user_id )
)
)
@ -529,18 +531,18 @@ if ( ! empty( $messages ) ) {
<div class="wrap">
<h1 class="wp-heading-inline">
<?php
echo esc_html( $title );
?>
<?php
echo esc_html( $title );
?>
</h1>
<?php
if ( current_user_can( 'create_users' ) ) {
?>
<?php
if ( current_user_can( 'create_users' ) ) {
?>
<a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
<a href="<?php echo admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php
<?php
}
if ( strlen( $usersearch ) ) {
@ -551,22 +553,22 @@ if ( strlen( $usersearch ) ) {
<hr class="wp-header-end">
<?php $wp_list_table->views(); ?>
<?php $wp_list_table->views(); ?>
<form method="get">
<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
<?php $wp_list_table->search_box( __( 'Search Users' ), 'user' ); ?>
<?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
<?php if ( ! empty( $_REQUEST['role'] ) ) { ?>
<input type="hidden" name="role" value="<?php echo esc_attr( $_REQUEST['role'] ); ?>" />
<?php } ?>
<?php $wp_list_table->display(); ?>
<?php $wp_list_table->display(); ?>
</form>
<br class="clear" />
</div>
<?php
<?php
break;
} // end of the $doaction switch

Some files were not shown because too many files have changed in this diff Show More