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

@ -40,7 +40,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
__( 'Major Customizer Improvements, Code Error Checking, and More! %s' ),
'&#x1F389'
);
?>
?>
</h2>
<p><?php _e( 'Welcome to an improved Customizer workflow with design drafts, locking, scheduling, and preview links. What&#8217;s more, code syntax highlighting and error checking will make for a clean and smooth site building experience. Finally, if all that wasn&#8217;t pretty great, we&#8217;ve got a great new Gallery widget and improvements to theme browsing and switching.' ); ?></p>
</div>
@ -181,7 +181,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
__( 'Lend a Hand with Gutenberg %s' ),
'&#x1F91D'
);
?>
?>
</h2>
<p>
<?php
@ -190,7 +190,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
__( 'https://wordpress.org/plugins/gutenberg/' ),
'https://github.com/WordPress/gutenberg'
);
?>
?>
</p>
</div>
@ -204,7 +204,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
__( 'Developer Happiness %s' ),
'&#x1F60A'
);
?>
?>
</h2>
<div class="under-the-hood two-col">
@ -217,7 +217,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
__( 'We&#8217;ve made numerous improvements to the Customizer JS API in WordPress 4.9, eliminating many pain points and making it just as easy to work with as the PHP API. There are also new base control templates, a date/time control, and section/panel/global notifications to name a few. <a href="%s">Check out the full list.</a>' ),
'https://make.wordpress.org/core/2017/11/01/improvements-to-the-customize-js-api-in-4-9/'
);
?>
?>
</p>
</div>
<div class="col">

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

@ -110,49 +110,49 @@ switch ( $action ) {
$nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
$nonce_action .= $comment_id;
?>
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?></h1>
<?php
switch ( $action ) {
case 'spam':
$caution_msg = __( 'You are about to mark the following comment as spam:' );
$button = _x( 'Mark as Spam', 'comment' );
break;
case 'trash':
$caution_msg = __( 'You are about to move the following comment to the Trash:' );
$button = __( 'Move to Trash' );
break;
case 'delete':
$caution_msg = __( 'You are about to delete the following comment:' );
$button = __( 'Permanently Delete Comment' );
break;
default:
$caution_msg = __( 'You are about to approve the following comment:' );
$button = __( 'Approve Comment' );
break;
}
<?php
switch ( $action ) {
case 'spam':
$caution_msg = __( 'You are about to mark the following comment as spam:' );
$button = _x( 'Mark as Spam', 'comment' );
break;
case 'trash':
$caution_msg = __( 'You are about to move the following comment to the Trash:' );
$button = __( 'Move to Trash' );
break;
case 'delete':
$caution_msg = __( 'You are about to delete the following comment:' );
$button = __( 'Permanently Delete Comment' );
break;
default:
$caution_msg = __( 'You are about to approve the following comment:' );
$button = __( 'Approve Comment' );
break;
}
if ( $comment->comment_approved != '0' ) { // if not unapproved
$message = '';
switch ( $comment->comment_approved ) {
case '1':
$message = __( 'This comment is currently approved.' );
break;
case 'spam':
$message = __( 'This comment is currently marked as spam.' );
break;
case 'trash':
$message = __( 'This comment is currently in the Trash.' );
break;
}
if ( $message ) {
echo '<div id="message" class="notice notice-info"><p>' . $message . '</p></div>';
}
}
?>
if ( $comment->comment_approved != '0' ) { // if not unapproved
$message = '';
switch ( $comment->comment_approved ) {
case '1':
$message = __( 'This comment is currently approved.' );
break;
case 'spam':
$message = __( 'This comment is currently marked as spam.' );
break;
case 'trash':
$message = __( 'This comment is currently in the Trash.' );
break;
}
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>
@ -175,33 +175,33 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
<tr>
<th scope="row"><?php /* translators: column name or table row header */ _e( 'In Response To' ); ?></th>
<td>
<?php
<?php
$post_id = $comment->comment_post_ID;
if ( current_user_can( 'edit_post', $post_id ) ) {
$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
} else {
$post_link = esc_html( get_the_title( $post_id ) );
}
if ( current_user_can( 'edit_post', $post_id ) ) {
$post_link = "<a href='" . esc_url( get_edit_post_link( $post_id ) ) . "'>";
$post_link .= esc_html( get_the_title( $post_id ) ) . '</a>';
} else {
$post_link = esc_html( get_the_title( $post_id ) );
}
echo $post_link;
if ( $comment->comment_parent ) {
$parent = get_comment( $comment->comment_parent );
$parent_link = esc_url( get_comment_link( $parent ) );
$name = get_comment_author( $parent );
printf(
/* translators: %s: comment link */
' | ' . __( 'In reply to %s.' ),
'<a href="' . $parent_link . '">' . $name . '</a>'
);
}
?>
if ( $comment->comment_parent ) {
$parent = get_comment( $comment->comment_parent );
$parent_link = esc_url( get_comment_link( $parent ) );
$name = get_comment_author( $parent );
printf(
/* translators: %s: comment link */
' | ' . __( 'In reply to %s.' ),
'<a href="' . $parent_link . '">' . $name . '</a>'
);
}
?>
</td>
</tr>
<tr>
<th scope="row"><?php _e( 'Submitted on' ); ?></th>
<td>
<?php
<?php
/* translators: 1: comment date, 2: comment time */
$submitted = sprintf(
__( '%1$s at %2$s' ),
@ -209,18 +209,18 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
get_comment_date( __( 'Y/m/d' ), $comment ),
get_comment_date( __( 'g:i a' ), $comment )
);
if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>';
} else {
echo $submitted;
}
if ( 'approved' === wp_get_comment_status( $comment ) && ! empty( $comment->comment_post_ID ) ) {
echo '<a href="' . esc_url( get_comment_link( $comment ) ) . '">' . $submitted . '</a>';
} else {
echo $submitted;
}
?>
</td>
</tr>
<tr>
<th scope="row"><?php /* translators: field name in comment form */ _ex( 'Comment', 'noun' ); ?></th>
<td class="comment-content">
<?php comment_text( $comment ); ?>
<?php comment_text( $comment ); ?>
<p class="edit-comment"><a href="<?php echo admin_url( "comment.php?action=editcomment&amp;c={$comment->comment_ID}" ); ?>"><?php esc_html_e( 'Edit' ); ?></a></p>
</td>
</tr>
@ -229,18 +229,18 @@ if ( $comment->comment_approved != '0' ) { // if not unapproved
<form action="comment.php" method="get" class="comment-ays-submit">
<p>
<?php submit_button( $button, 'primary', 'submit', false ); ?>
<?php submit_button( $button, 'primary', 'submit', false ); ?>
<a href="<?php echo admin_url( 'edit-comments.php' ); ?>" class="button-cancel"><?php esc_html_e( 'Cancel' ); ?></a>
</p>
<?php wp_nonce_field( $nonce_action ); ?>
<?php wp_nonce_field( $nonce_action ); ?>
<input type="hidden" name="action" value="<?php echo esc_attr( $formaction ); ?>" />
<input type="hidden" name="c" value="<?php echo esc_attr( $comment->comment_ID ); ?>" />
<input type="hidden" name="noredir" value="1" />
</form>
</div>
<?php
<?php
break;
case 'deletecomment':
@ -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,28 +221,28 @@ 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
printf(
__( 'You can now manage and live-preview Custom Backgrounds in the <a href="%1$s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=background_image' )
);
?>
<?php
printf(
__( 'You can now manage and live-preview Custom Backgrounds in the <a href="%1$s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=background_image' )
);
?>
</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>
@ -251,34 +251,34 @@ class Custom_Background {
<tr>
<th scope="row"><?php _e( 'Preview' ); ?></th>
<td>
<?php
if ( $this->admin_image_div_callback ) {
call_user_func( $this->admin_image_div_callback );
} else {
$background_styles = '';
if ( $bgcolor = get_background_color() ) {
$background_styles .= 'background-color: #' . $bgcolor . ';';
}
<?php
if ( $this->admin_image_div_callback ) {
call_user_func( $this->admin_image_div_callback );
} else {
$background_styles = '';
if ( $bgcolor = get_background_color() ) {
$background_styles .= 'background-color: #' . $bgcolor . ';';
}
$background_image_thumb = get_background_image();
if ( $background_image_thumb ) {
$background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) );
$background_position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
$background_position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );
$background_size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );
$background_repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
$background_attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );
$background_image_thumb = get_background_image();
if ( $background_image_thumb ) {
$background_image_thumb = esc_url( set_url_scheme( get_theme_mod( 'background_image_thumb', str_replace( '%', '%%', $background_image_thumb ) ) ) );
$background_position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) );
$background_position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) );
$background_size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) );
$background_repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) );
$background_attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) );
// Background-image URL must be single quote, see below.
$background_styles .= " background-image: url('$background_image_thumb');"
// Background-image URL must be single quote, see below.
$background_styles .= " background-image: url('$background_image_thumb');"
. " background-size: $background_size;"
. " background-position: $background_position_x $background_position_y;"
. " background-repeat: $background_repeat;"
. " background-attachment: $background_attachment;";
}
?>
}
?>
<div id="custom-background-image" style="<?php echo $background_styles; ?>"><?php // must be double quote, see above ?>
<?php if ( $background_image_thumb ) { ?>
<?php if ( $background_image_thumb ) { ?>
<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" /><br />
<img class="custom-background-image" src="<?php echo $background_image_thumb; ?>" style="visibility:hidden;" alt="" />
<?php } ?>
@ -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">
@ -322,8 +322,8 @@ class Custom_Background {
<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
<input type="file" id="upload" name="import" />
<input type="hidden" name="action" value="save" />
<?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
<?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
<?php wp_nonce_field( 'custom-background-upload', '_wpnonce-custom-background-upload' ); ?>
<?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
</p>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
@ -334,7 +334,7 @@ class Custom_Background {
</form>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
</tbody>
</table>
@ -342,68 +342,68 @@ 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(
'%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' ) )
);
<?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(
array(
'left top' => array(
'label' => __( 'Top Left' ),
'icon' => 'dashicons dashicons-arrow-left-alt',
),
'center top' => array(
'label' => __( 'Top' ),
'icon' => 'dashicons dashicons-arrow-up-alt',
),
'right top' => array(
'label' => __( 'Top Right' ),
'icon' => 'dashicons dashicons-arrow-right-alt',
),
),
array(
'left center' => array(
'label' => __( 'Left' ),
'icon' => 'dashicons dashicons-arrow-left-alt',
),
'center center' => array(
'label' => __( 'Center' ),
'icon' => 'background-position-center-icon',
),
'right center' => array(
'label' => __( 'Right' ),
'icon' => 'dashicons dashicons-arrow-right-alt',
),
),
array(
'left bottom' => array(
'label' => __( 'Bottom Left' ),
'icon' => 'dashicons dashicons-arrow-left-alt',
),
'center bottom' => array(
'label' => __( 'Bottom' ),
'icon' => 'dashicons dashicons-arrow-down-alt',
),
'right bottom' => array(
'label' => __( 'Bottom Right' ),
'icon' => 'dashicons dashicons-arrow-right-alt',
),
),
);
?>
$background_position_options = array(
array(
'left top' => array(
'label' => __( 'Top Left' ),
'icon' => 'dashicons dashicons-arrow-left-alt',
),
'center top' => array(
'label' => __( 'Top' ),
'icon' => 'dashicons dashicons-arrow-up-alt',
),
'right top' => array(
'label' => __( 'Top Right' ),
'icon' => 'dashicons dashicons-arrow-right-alt',
),
),
array(
'left center' => array(
'label' => __( 'Left' ),
'icon' => 'dashicons dashicons-arrow-left-alt',
),
'center center' => array(
'label' => __( 'Center' ),
'icon' => 'background-position-center-icon',
),
'right center' => array(
'label' => __( 'Right' ),
'icon' => 'dashicons dashicons-arrow-right-alt',
),
),
array(
'left bottom' => array(
'label' => __( 'Bottom Left' ),
'icon' => 'dashicons dashicons-arrow-left-alt',
),
'center bottom' => array(
'label' => __( 'Bottom' ),
'icon' => 'dashicons dashicons-arrow-down-alt',
),
'right bottom' => array(
'label' => __( 'Bottom Right' ),
'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 ) : ?>
<?php foreach ( $group as $value => $input ) : ?>
<label>
<input class="screen-reader-text" name="background-position" type="radio" value="<?php echo esc_attr( $value ); ?>"<?php checked( $value, $background_position ); ?>>
<span class="button display-options position"><span class="<?php echo esc_attr( $input['icon'] ); ?>" aria-hidden="true"></span></span>
@ -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' ) ) {
$default_color = ' data-default-color="#' . esc_attr( get_theme_support( '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
}
/**
@ -390,7 +390,7 @@ class Custom_Image_Header {
*/
public function js_2() {
?>
?>
<script type="text/javascript">
function onEndCrop( coords ) {
jQuery( '#x1' ).val(coords.x);
@ -426,19 +426,19 @@ class Custom_Image_Header {
y2: yinit,
<?php
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
?>
?>
aspectRatio: xinit + ':' + yinit,
<?php
<?php
}
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {
?>
?>
maxHeight: <?php echo get_theme_support( 'custom-header', 'height' ); ?>,
<?php
<?php
}
if ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
?>
?>
maxWidth: <?php echo get_theme_support( 'custom-header', 'width' ); ?>,
<?php
<?php
}
?>
onInit: function () {
@ -454,7 +454,7 @@ class Custom_Image_Header {
});
});
</script>
<?php
<?php
}
/**
@ -464,153 +464,154 @@ 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
printf(
__( 'You can now manage and live-preview Custom Header in the <a href="%1$s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=header_image' )
);
?>
<?php
printf(
__( 'You can now manage and live-preview Custom Header in the <a href="%1$s">Customizer</a>.' ),
admin_url( 'customize.php?autofocus[control]=header_image' )
);
?>
</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>
<?php
if ( $this->admin_image_div_callback ) {
call_user_func( $this->admin_image_div_callback );
} else {
$custom_header = get_custom_header();
$header_image = get_header_image();
<?php
if ( $this->admin_image_div_callback ) {
call_user_func( $this->admin_image_div_callback );
} else {
$custom_header = get_custom_header();
$header_image = get_header_image();
if ( $header_image ) {
$header_image_style = 'background-image:url(' . esc_url( $header_image ) . ');';
} else {
$header_image_style = '';
}
if ( $header_image ) {
$header_image_style = 'background-image:url(' . esc_url( $header_image ) . ');';
} else {
$header_image_style = '';
}
if ( $custom_header->width ) {
$header_image_style .= 'max-width:' . $custom_header->width . 'px;';
}
if ( $custom_header->height ) {
$header_image_style .= 'height:' . $custom_header->height . 'px;';
}
?>
if ( $custom_header->width ) {
$header_image_style .= 'max-width:' . $custom_header->width . 'px;';
}
if ( $custom_header->height ) {
$header_image_style .= 'height:' . $custom_header->height . 'px;';
}
?>
<div id="headimg" style="<?php echo $header_image_style; ?>">
<?php
if ( display_header_text() ) {
$style = ' style="color:#' . get_header_textcolor() . ';"';
} else {
$style = ' style="display:none;"';
}
?>
<?php
if ( display_header_text() ) {
$style = ' style="color:#' . get_header_textcolor() . ';"';
} else {
$style = ' style="display:none;"';
}
?>
<h1><a id="name" class="displaying-header-text" <?php echo $style; ?> onclick="return false;" href="<?php bloginfo( 'url' ); ?>" tabindex="-1"><?php bloginfo( 'name' ); ?></a></h1>
<div id="desc" class="displaying-header-text" <?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
</div>
<?php } ?>
<?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>
<p><?php _e( 'You can select an image to be shown at the top of your site by uploading from your computer or choosing from your media library. After selecting an image you will be able to crop it.' ); ?><br />
<?php
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
printf( __( 'Images of exactly <strong>%1$d &times; %2$d pixels</strong> will be used as-is.' ) . '<br />', get_theme_support( 'custom-header', 'width' ), get_theme_support( 'custom-header', 'height' ) );
} elseif ( current_theme_supports( 'custom-header', 'flex-height' ) ) {
if ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Images should be at least %s wide.' ) . ' ',
sprintf(
/* translators: %d: custom header width */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'width' )
)
);
}
} elseif ( current_theme_supports( 'custom-header', 'flex-width' ) ) {
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Images should be at least %s tall.' ) . ' ',
sprintf(
/* translators: %d: custom header height */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'height' )
)
);
}
}
if ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) {
if ( current_theme_supports( 'custom-header', 'width' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Suggested width is %s.' ) . ' ',
sprintf(
/* translators: %d: custom header width */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'width' )
)
);
}
if ( current_theme_supports( 'custom-header', 'height' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Suggested height is %s.' ) . ' ',
sprintf(
/* translators: %d: custom header height */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'height' )
)
);
}
}
?>
<?php
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) && ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
printf( __( 'Images of exactly <strong>%1$d &times; %2$d pixels</strong> will be used as-is.' ) . '<br />', get_theme_support( 'custom-header', 'width' ), get_theme_support( 'custom-header', 'height' ) );
} elseif ( current_theme_supports( 'custom-header', 'flex-height' ) ) {
if ( ! current_theme_supports( 'custom-header', 'flex-width' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Images should be at least %s wide.' ) . ' ',
sprintf(
/* translators: %d: custom header width */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'width' )
)
);
}
} elseif ( current_theme_supports( 'custom-header', 'flex-width' ) ) {
if ( ! current_theme_supports( 'custom-header', 'flex-height' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Images should be at least %s tall.' ) . ' ',
sprintf(
/* translators: %d: custom header height */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'height' )
)
);
}
}
if ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) {
if ( current_theme_supports( 'custom-header', 'width' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Suggested width is %s.' ) . ' ',
sprintf(
/* translators: %d: custom header width */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'width' )
)
);
}
if ( current_theme_supports( 'custom-header', 'height' ) ) {
printf(
/* translators: %s: size in pixels */
__( 'Suggested height is %s.' ) . ' ',
sprintf(
/* translators: %d: custom header height */
'<strong>' . __( '%d pixels' ) . '</strong>',
get_theme_support( 'custom-header', 'height' )
)
);
}
}
?>
</p>
<form enctype="multipart/form-data" id="upload-form" class="wp-upload-form" method="post" action="<?php echo esc_url( add_query_arg( 'step', 2 ) ); ?>">
<p>
<label for="upload"><?php _e( 'Choose an image from your computer:' ); ?></label><br />
<input type="file" id="upload" name="import" />
<input type="hidden" name="action" value="save" />
<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
<?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
<?php wp_nonce_field( 'custom-header-upload', '_wpnonce-custom-header-upload' ); ?>
<?php submit_button( __( 'Upload' ), '', 'submit', false ); ?>
</p>
<?php
$modal_update_href = esc_url(
add_query_arg(
array(
'page' => 'custom-header',
'step' => 2,
'_wpnonce-custom-header-upload' => wp_create_nonce( 'custom-header-upload' ),
), admin_url( 'themes.php' )
)
);
?>
<?php
$modal_update_href = esc_url(
add_query_arg(
array(
'page' => 'custom-header',
'step' => 2,
'_wpnonce-custom-header-upload' => wp_create_nonce( 'custom-header-upload' ),
),
admin_url( 'themes.php' )
)
);
?>
<p>
<label for="choose-from-library-link"><?php _e( 'Or choose an image from your media library:' ); ?></label><br />
<button id="choose-from-library-link" class="button"
@ -621,36 +622,36 @@ 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() ) : ?>
<?php if ( get_uploaded_header_images() ) : ?>
<tr>
<th scope="row"><?php _e( 'Uploaded Images' ); ?></th>
<td>
<p><?php _e( 'You can choose one of your previously uploaded headers, or show a random one.' ); ?></p>
<?php
$this->show_header_selector( 'uploaded' );
?>
<?php
$this->show_header_selector( 'uploaded' );
?>
</td>
</tr>
<?php
<?php
endif;
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>
@ -703,50 +704,50 @@ if ( $default_image && get_header_image() != $default_image ) :
<th scope="row"><?php _e( 'Text Color' ); ?></th>
<td>
<p>
<?php
$default_color = '';
if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {
$default_color = get_theme_support( 'custom-header', 'default-text-color' );
if ( $default_color && false === strpos( $default_color, '#' ) ) {
$default_color = '#' . $default_color;
}
}
<?php
$default_color = '';
if ( current_theme_supports( 'custom-header', 'default-text-color' ) ) {
$default_color = get_theme_support( 'custom-header', 'default-text-color' );
if ( $default_color && false === strpos( $default_color, '#' ) ) {
$default_color = '#' . $default_color;
}
}
$default_color_attr = $default_color ? ' data-default-color="' . esc_attr( $default_color ) . '"' : '';
$default_color_attr = $default_color ? ' data-default-color="' . esc_attr( $default_color ) . '"' : '';
$header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );
if ( $header_textcolor && false === strpos( $header_textcolor, '#' ) ) {
$header_textcolor = '#' . $header_textcolor;
}
$header_textcolor = display_header_text() ? get_header_textcolor() : get_theme_support( 'custom-header', 'default-text-color' );
if ( $header_textcolor && false === strpos( $header_textcolor, '#' ) ) {
$header_textcolor = '#' . $header_textcolor;
}
echo '<input type="text" name="text-color" id="text-color" value="' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />';
if ( $default_color ) {
echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), esc_html( $default_color ) ) . '</span>';
}
?>
echo '<input type="text" name="text-color" id="text-color" value="' . esc_attr( $header_textcolor ) . '"' . $default_color_attr . ' />';
if ( $default_color ) {
echo ' <span class="description hide-if-js">' . sprintf( _x( 'Default: %s', 'color' ), esc_html( $default_color ) ) . '</span>';
}
?>
</p>
</td>
</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' );
/**
* Fires just before the submit button in the custom header options form.
*
* @since 3.1.0
*/
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
}
/**
@ -852,18 +853,18 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' );
<input type="hidden" name="height" id="height" value="<?php echo esc_attr( $height ); ?>"/>
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $attachment_id ); ?>" />
<input type="hidden" name="oitar" id="oitar" value="<?php echo esc_attr( $oitar ); ?>" />
<?php if ( empty( $_POST ) && isset( $_GET['file'] ) ) { ?>
<?php if ( empty( $_POST ) && isset( $_GET['file'] ) ) { ?>
<input type="hidden" name="create-new-attachment" value="true" />
<?php } ?>
<?php wp_nonce_field( 'custom-header-crop-image' ); ?>
<?php wp_nonce_field( 'custom-header-crop-image' ); ?>
<p class="submit">
<?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?>
<?php
if ( isset( $oitar ) && 1 == $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {
submit_button( __( 'Skip Cropping, Publish Image as Is' ), '', 'skip-cropping', false );
}
?>
<?php submit_button( __( 'Crop and Publish' ), 'primary', 'submit', false ); ?>
<?php
if ( isset( $oitar ) && 1 == $oitar && ( current_theme_supports( 'custom-header', 'flex-height' ) || current_theme_supports( 'custom-header', 'flex-width' ) ) ) {
submit_button( __( 'Skip Cropping, Publish Image as Is' ), '', 'skip-cropping', false );
}
?>
</p>
</form>
</div>

View File

@ -158,7 +158,7 @@ if ( $viewable ) {
/* translators: Publish box date format, see https://secure.php.net/date */
$scheduled_date = date_i18n( __( 'M j, Y @ H:i' ), strtotime( $post->post_date ) );
$messages['post'] = array(
$messages['post'] = array(
0 => '', // Unused. Messages start at index 1.
1 => __( 'Post updated.' ) . $view_post_link_html,
2 => __( 'Custom field updated.' ),
@ -172,7 +172,7 @@ $messages['post'] = array(
9 => sprintf( __( 'Post scheduled for: %s.' ), '<strong>' . $scheduled_date . '</strong>' ) . $scheduled_post_link_html,
10 => __( 'Post draft updated.' ) . $preview_post_link_html,
);
$messages['page'] = array(
$messages['page'] = array(
0 => '', // Unused. Messages start at index 1.
1 => __( 'Page updated.' ) . $view_page_link_html,
2 => __( 'Custom field updated.' ),
@ -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,50 +633,50 @@ 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
/**
* 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 );
?>
<?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 );
?>
<div class="inside">
<?php
if ( $viewable ) :
$sample_permalink_html = $post_type_object->public ? get_sample_permalink_html( $post->ID ) : '';
<?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.
if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) {
$shortlink = wp_get_shortlink( $post->ID, 'post' );
// As of 4.4, the Get Shortlink button is hidden by default.
if ( has_filter( 'pre_get_shortlink' ) || has_filter( 'get_shortlink' ) ) {
$shortlink = wp_get_shortlink( $post->ID, 'post' );
if ( ! empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url( '?page_id=' . $post->ID ) ) {
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>';
if ( ! empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url( '?page_id=' . $post->ID ) ) {
$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><button type="button" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val());">' . __( 'Get Shortlink' ) . '</button>';
}
}
}
if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
$has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
?>
if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && ! current_user_can( $post_type_object->cap->publish_posts ) ) ) {
$has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
?>
<div id="edit-slug-box" class="hide-if-no-js">
<?php
if ( $has_sample_permalink ) {
echo $sample_permalink_html;
}
?>
<?php
if ( $has_sample_permalink ) {
echo $sample_permalink_html;
}
?>
</div>
<?php
}
<?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,48 +692,50 @@ 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(
'_content_editor_dfw' => $_content_editor_dfw,
'drag_drop_upload' => true,
'tabfocus_elements' => 'content-html,save-post',
'editor_height' => 300,
'tinymce' => array(
'resize' => false,
'wp_autoresize_on' => $_wp_editor_expand,
'add_unload_trigger' => false,
'wp_keep_scroll_position' => ! $is_IE,
),
)
);
?>
<?php
wp_editor(
$post->post_content,
'content',
array(
'_content_editor_dfw' => $_content_editor_dfw,
'drag_drop_upload' => true,
'tabfocus_elements' => 'content-html,save-post',
'editor_height' => 300,
'tinymce' => array(
'resize' => false,
'wp_autoresize_on' => $_wp_editor_expand,
'add_unload_trigger' => false,
'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 ) {
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 */
printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
} else {
/* translators: 1: Post edited date, 2: Post edited time */
printf( __( 'Last edited on %1$s at %2$s' ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
<?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 */
printf( __( 'Last edited by %1$s on %2$s at %3$s' ), esc_html( $last_user->display_name ), mysql2date( __( 'F j, Y' ), $post->post_modified ), mysql2date( __( 'g:i a' ), $post->post_modified ) );
} else {
/* translators: 1: Post edited date, 2: Post edited time */
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>';
}
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,
@ -146,7 +148,7 @@ if ( $comment->comment_parent ) :
if ( $parent ) :
$parent_link = esc_url( get_comment_link( $parent ) );
$name = get_comment_author( $parent );
?>
?>
<div class="misc-pub-section misc-pub-reply-to">
<?php
printf(
@ -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

@ -77,7 +77,7 @@ do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
<p><a href="<?php echo esc_url( wp_validate_redirect( esc_url_raw( $wp_http_referer ), admin_url( 'term.php?taxonomy=' . $taxonomy ) ) ); ?>">
<?php
echo esc_html( $tax->labels->back_to_items );
?>
?>
</a></p>
<?php } ?>
</div>
@ -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,160 +404,160 @@ 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
/**
* 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" );
?>
<?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" );
?>
>
<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
$dropdown_args = array(
'hide_empty' => 0,
'hide_if_empty' => false,
'taxonomy' => $taxonomy,
'name' => 'parent',
'orderby' => 'name',
'hierarchical' => true,
'show_option_none' => __( 'None' ),
);
<?php
$dropdown_args = array(
'hide_empty' => 0,
'hide_if_empty' => false,
'taxonomy' => $taxonomy,
'name' => 'parent',
'orderby' => 'name',
'hierarchical' => true,
'show_option_none' => __( 'None' ),
);
/**
* Filters the taxonomy parent drop-down on the Edit Term page.
*
* @since 3.7.0
* @since 4.2.0 Added `$context` parameter.
*
* @param array $dropdown_args {
* An array of taxonomy parent drop-down arguments.
*
* @type int|bool $hide_empty Whether to hide terms not attached to any posts. Default 0|false.
* @type bool $hide_if_empty Whether to hide the drop-down if no terms exist. Default false.
* @type string $taxonomy The taxonomy slug.
* @type string $name Value of the name attribute to use for the drop-down select element.
* Default 'parent'.
* @type string $orderby The field to order by. Default 'name'.
* @type bool $hierarchical Whether the taxonomy is hierarchical. Default true.
* @type string $show_option_none Label to display if there are no terms. Default 'None'.
* }
* @param string $taxonomy The taxonomy slug.
* @param string $context Filter context. Accepts 'new' or 'edit'.
*/
$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' );
/**
* Filters the taxonomy parent drop-down on the Edit Term page.
*
* @since 3.7.0
* @since 4.2.0 Added `$context` parameter.
*
* @param array $dropdown_args {
* An array of taxonomy parent drop-down arguments.
*
* @type int|bool $hide_empty Whether to hide terms not attached to any posts. Default 0|false.
* @type bool $hide_if_empty Whether to hide the drop-down if no terms exist. Default false.
* @type string $taxonomy The taxonomy slug.
* @type string $name Value of the name attribute to use for the drop-down select element.
* Default 'parent'.
* @type string $orderby The field to order by. Default 'name'.
* @type bool $hierarchical Whether the taxonomy is hierarchical. Default true.
* @type string $show_option_none Label to display if there are no terms. Default 'None'.
* }
* @param string $taxonomy The taxonomy slug.
* @param string $context Filter context. Accepts 'new' or 'edit'.
*/
$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' );
wp_dropdown_categories( $dropdown_args );
?>
<?php if ( 'category' == $taxonomy ) : ?>
wp_dropdown_categories( $dropdown_args );
?>
<?php if ( 'category' == $taxonomy ) : ?>
<p><?php _e( 'Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.' ); ?></p>
<?php else : ?>
<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.
*
* @since 3.0.0
*
* @param string $taxonomy The taxonomy slug.
*/
do_action( 'add_tag_form_fields', $taxonomy );
}
/**
* Fires after the Add Tag form fields for non-hierarchical taxonomies.
* Fires after the Add Term form fields.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* @since 3.0.0
*
* @param string $taxonomy The taxonomy slug.
*/
do_action( 'add_tag_form_fields', $taxonomy );
}
do_action( "{$taxonomy}_add_form_fields", $taxonomy );
/**
* Fires after the Add Term form fields.
*
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* @since 3.0.0
*
* @param string $taxonomy The taxonomy slug.
*/
do_action( "{$taxonomy}_add_form_fields", $taxonomy );
submit_button( $tax->labels->add_new_item );
submit_button( $tax->labels->add_new_item );
if ( 'category' == $taxonomy ) {
/**
* Fires at the end of the Edit Category form.
*
* @since 2.1.0
* @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
*
* @param object $arg Optional arguments cast to an object.
*/
do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
} elseif ( 'link_category' == $taxonomy ) {
/**
* Fires at the end of the Edit Link form.
*
* @since 2.3.0
* @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
*
* @param object $arg Optional arguments cast to an object.
*/
do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
} else {
/**
* Fires at the end of the Add Tag form.
*
* @since 2.7.0
* @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
*
* @param string $taxonomy The taxonomy slug.
*/
do_action( 'add_tag_form', $taxonomy );
}
if ( 'category' == $taxonomy ) {
/**
* Fires at the end of the Edit Category form.
* Fires at the end of the Add Term form for all taxonomies.
*
* @since 2.1.0
* @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
* The dynamic portion of the hook name, `$taxonomy`, refers to the taxonomy slug.
*
* @param object $arg Optional arguments cast to an object.
*/
do_action( 'edit_category_form', (object) array( 'parent' => 0 ) );
} elseif ( 'link_category' == $taxonomy ) {
/**
* Fires at the end of the Edit Link form.
*
* @since 2.3.0
* @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
*
* @param object $arg Optional arguments cast to an object.
*/
do_action( 'edit_link_category_form', (object) array( 'parent' => 0 ) );
} else {
/**
* Fires at the end of the Add Tag form.
*
* @since 2.7.0
* @deprecated 3.0.0 Use {$taxonomy}_add_form instead.
* @since 3.0.0
*
* @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.
*
* @since 3.0.0
*
* @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
)
);
@ -224,7 +225,7 @@ function export_date_options( $post_type = 'post' ) {
<?php
$post_stati = get_post_stati( array( 'internal' => false ), 'objects' );
foreach ( $post_stati as $status ) :
?>
?>
<option value="<?php echo esc_attr( $status->name ); ?>"><?php echo esc_html( $status->label ); ?></option>
<?php endforeach; ?>
</select>
@ -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

@ -65,7 +65,7 @@ $parent_file = 'tools.php';
<?php
/* translators: %s: importer slug */
printf( __( 'The %s importer is invalid or is not installed.' ), '<strong>' . esc_html( $_GET['invalid'] ) . '</strong>' );
?>
?>
</p>
</div>
<?php endif; ?>
@ -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(
'action' => 'update',
'type' => 'core',
) );
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(
'action' => 'update',
'type' => 'translation',
'bulk' => true,
'translations' => $language_updates_results,
) );
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(
'action' => 'update',
'type' => 'plugin',
'bulk' => true,
'plugins' => $plugins,
) );
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

@ -152,7 +152,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
<a class="item-edit" id="edit-<?php echo $item_id; ?>" href="
<?php
echo ( isset( $_GET['edit-menu-item'] ) && $item_id == $_GET['edit-menu-item'] ) ? admin_url( 'nav-menus.php' ) : add_query_arg( 'edit-menu-item', $item_id, remove_query_arg( $removed_args, admin_url( 'nav-menus.php#menu-item-settings-' . $item_id ) ) );
?>
?>
" aria-label="<?php esc_attr_e( 'Edit menu item' ); ?>"><span class="screen-reader-text"><?php _e( 'Edit' ); ?></span></a>
</span>
</div>
@ -232,7 +232,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
),
'delete-menu_item_' . $item_id
);
?>
?>
"><?php _e( 'Remove' ); ?></a> <span class="meta-sep hide-if-no-js"> | </span> <a class="item-cancel submitcancel hide-if-no-js" id="cancel-<?php echo $item_id; ?>" href="
<?php
echo esc_url(
@ -240,10 +240,11 @@ 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' )
)
);
?>
?>
#menu-item-settings-<?php echo $item_id; ?>"><?php _e( 'Cancel' ); ?></a>
</div>

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,
@ -224,7 +225,7 @@ class WP_Comments_List_Table extends WP_List_Table {
), // singular not used
/* translators: %s: current user's comments count */
'mine' => _nx_noop(
'mine' => _nx_noop(
'Mine <span class="count">(%s)</span>',
'Mine <span class="count">(%s)</span>',
'comments'
@ -277,11 +278,13 @@ 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(
'user_id' => $current_user_id,
'count' => true,
) );
$link = add_query_arg( 'user_id', $current_user_id, $link );
$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,49 +370,50 @@ 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
/**
* Filters the comment types dropdown menu.
*
* @since 2.7.0
*
* @param string[] $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
*/
$comment_types = apply_filters(
'admin_comment_types_dropdown', array(
'comment' => __( 'Comments' ),
'pings' => __( 'Pings' ),
)
);
<?php
/**
* Filters the comment types dropdown menu.
*
* @since 2.7.0
*
* @param string[] $comment_types An array of comment types. Accepts 'Comments', 'Pings'.
*/
$comment_types = apply_filters(
'admin_comment_types_dropdown',
array(
'comment' => __( 'Comments' ),
'pings' => __( 'Pings' ),
)
);
foreach ( $comment_types as $type => $label ) {
echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
}
?>
foreach ( $comment_types as $type => $label ) {
echo "\t" . '<option value="' . esc_attr( $type ) . '"' . selected( $comment_type, $type, false ) . ">$label</option>\n";
}
?>
</select>
<?php
/**
* Fires just before the Filter submit button for comment types.
*
* @since 3.5.0
*/
do_action( 'restrict_manage_comments' );
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
<?php
/**
* Fires just before the Filter submit button for comment types.
*
* @since 3.5.0
*/
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 ) {
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 );
}
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' );
}
@ -676,10 +680,10 @@ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us
*/
public function column_cb( $comment ) {
if ( $this->user_can ) {
?>
?>
<label class="screen-reader-text" for="cb-select-<?php echo $comment->comment_ID; ?>"><?php _e( 'Select comment' ); ?></label>
<input id="cb-select-<?php echo $comment->comment_ID; ?>" type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" />
<?php
<?php
}
}
@ -709,7 +713,7 @@ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us
if ( $this->user_can ) {
/** This filter is documented in wp-admin/includes/comment.php */
$comment_content = apply_filters( 'comment_edit_pre', $comment->comment_content );
?>
?>
<div id="inline-<?php echo $comment->comment_ID; ?>" class="hidden">
<textarea class="comment" rows="1" cols="1"><?php echo esc_textarea( $comment_content ); ?></textarea>
<div class="author-email"><?php echo esc_attr( $comment->comment_author_email ); ?></div>
@ -717,7 +721,7 @@ if ( ( 'spam' === $comment_status || 'trash' === $comment_status ) && current_us
<div class="author-url"><?php echo esc_attr( $comment->comment_author_url ); ?></div>
<div class="comment_status"><?php echo $comment->comment_approved; ?></div>
</div>
<?php
<?php
}
}
@ -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

@ -180,8 +180,8 @@ final class WP_Internal_Pointers {
}
$js_args = array(
'content' => $content,
'position' => $position,
'content' => $content,
'position' => $position,
'pointerClass' => 'wp-pointer arrow-bottom',
'pointerWidth' => 420,
);

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' ) ); ?>
<?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,30 +592,30 @@ 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 ) {
if ( 0 == $arc_row->year ) {
continue;
}
<?php
foreach ( $months as $arc_row ) {
if ( 0 == $arc_row->year ) {
continue;
}
$month = zeroise( $arc_row->month, 2 );
$year = $arc_row->year;
$month = zeroise( $arc_row->month, 2 );
$year = $arc_row->year;
printf(
"<option %s value='%s'>%s</option>\n",
selected( $m, $year . $month, false ),
esc_attr( $arc_row->year . $month ),
/* translators: 1: month name, 2: 4-digit year */
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
);
}
?>
printf(
"<option %s value='%s'>%s</option>\n",
selected( $m, $year . $month, false ),
esc_attr( $arc_row->year . $month ),
/* translators: 1: month name, 2: 4-digit year */
sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
);
}
?>
</select>
<?php
<?php
}
/**
@ -623,25 +626,25 @@ 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 ) {
$classes = array( 'view-' . $mode );
if ( $current_mode === $mode ) {
$classes[] = 'current';
}
printf(
"<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
esc_url( add_query_arg( 'mode', $mode ) ),
implode( ' ', $classes ),
$title
);
}
<?php
foreach ( $this->modes as $mode => $title ) {
$classes = array( 'view-' . $mode );
if ( $current_mode === $mode ) {
$classes[] = 'current';
}
printf(
"<a href='%s' class='%s' id='view-switch-$mode'><span class='screen-reader-text'>%s</span></a>\n",
esc_url( add_query_arg( 'mode', $mode ) ),
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>
@ -1161,10 +1166,10 @@ foreach ( $this->modes as $mode => $title ) {
</thead>
<tbody id="the-list"
<?php
if ( $singular ) {
echo " data-wp-lists='list:$singular'";
}
<?php
if ( $singular ) {
echo " data-wp-lists='list:$singular'";
}
?>
>
<?php $this->display_rows_or_placeholder(); ?>
@ -1177,7 +1182,7 @@ foreach ( $this->modes as $mode => $title ) {
</tfoot>
</table>
<?php
<?php
$this->display_tablenav( 'bottom' );
}
@ -1209,7 +1214,7 @@ foreach ( $this->modes as $mode => $title ) {
<div class="alignleft actions bulkactions">
<?php $this->bulk_actions( $which ); ?>
</div>
<?php
<?php
endif;
$this->extra_tablenav( $which );
$this->pagination( $which );
@ -1217,7 +1222,7 @@ foreach ( $this->modes as $mode => $title ) {
<br class="clear" />
</div>
<?php
<?php
}
/**

View File

@ -171,26 +171,26 @@ class WP_Media_List_Table extends WP_List_Table {
if ( 'bar' !== $which ) {
return;
}
?>
?>
<div class="actions">
<?php
if ( ! is_singular() ) {
if ( ! $this->is_trash ) {
$this->months_dropdown( 'attachment' );
}
<?php
if ( ! is_singular() ) {
if ( ! $this->is_trash ) {
$this->months_dropdown( 'attachment' );
}
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
if ( $this->is_trash && current_user_can( 'edit_others_posts' ) && $this->has_items() ) {
submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
}
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,28 +252,28 @@ 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 ) ) {
echo '<ul class="filter-links">';
foreach ( $views as $class => $view ) {
echo "<li class='$class'>$view</li>";
}
echo '</ul>';
}
?>
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">
<label for="media-search-input" class="screen-reader-text"><?php esc_html_e( 'Search Media' ); ?></label>
<input type="search" placeholder="<?php esc_attr_e( 'Search media items...' ); ?>" id="media-search-input" class="search" name="s" value="<?php _admin_search_query(); ?>"></div>
</div>
<?php
<?php
}
/**
@ -354,14 +354,14 @@ if ( ! empty( $views ) ) {
*/
public function column_cb( $post ) {
if ( current_user_can( 'edit_post', $post->ID ) ) {
?>
?>
<label class="screen-reader-text" for="cb-select-<?php echo $post->ID; ?>">
<?php
echo sprintf( __( 'Select %s' ), _draft_or_post_title() );
?>
?>
</label>
<input type="checkbox" name="media[]" id="cb-select-<?php echo $post->ID; ?>" value="<?php echo $post->ID; ?>" />
<?php
<?php
}
}
@ -395,9 +395,9 @@ if ( ! empty( $views ) ) {
<?php
echo $link_start;
if ( $thumb ) :
?>
?>
<span class="media-icon <?php echo sanitize_html_class( $mime . '-icon' ); ?>"><?php echo $thumb; ?></span>
<?php
<?php
endif;
echo $title . $link_end;
_media_states( $post );
@ -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>',
@ -631,11 +632,11 @@ if ( ! empty( $views ) ) {
continue;
}
$post_owner = ( get_current_user_id() == $post->post_author ) ? 'self' : 'other';
?>
?>
<tr id="post-<?php echo $post->ID; ?>" class="<?php echo trim( ' author-' . $post_owner . ' status-' . $post->post_status ); ?>">
<?php $this->single_row_columns( $post ); ?>
</tr>
<?php
<?php
endwhile;
}

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,
@ -275,14 +276,14 @@ class WP_MS_Sites_List_Table extends WP_List_Table {
public function column_cb( $blog ) {
if ( ! is_main_site( $blog['blog_id'] ) ) :
$blogname = untrailingslashit( $blog['domain'] . $blog['path'] );
?>
?>
<label class="screen-reader-text" for="blog_<?php echo $blog['blog_id']; ?>">
<?php
printf( __( 'Select %s' ), $blogname );
?>
?>
</label>
<input type="checkbox" id="blog_<?php echo $blog['blog_id']; ?>" name="allblogs[]" value="<?php echo esc_attr( $blog['blog_id'] ); ?>" />
<?php
<?php
endif;
}
@ -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_id' => $blog['blog_id'],
'fields' => 'ID',
'number' => 1,
'count_total' => true,
) );
$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

@ -143,10 +143,10 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$installed_plugins = $this->get_installed_plugins();
$args = array(
'page' => $paged,
'per_page' => $per_page,
'page' => $paged,
'per_page' => $per_page,
// Send the locale to the API so it can provide context-sensitive results.
'locale' => get_user_locale(),
'locale' => get_user_locale(),
);
switch ( $tab ) {
@ -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(),
)
@ -273,7 +275,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
</div>
<?php } else { ?>
<div class="no-plugin-results"><?php _e( 'No plugins found. Try a different search.' ); ?></div>
<?php
<?php
}
}
@ -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
@ -321,9 +323,9 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
?>
</ul>
<?php install_search_form(); ?>
<?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
$this->screen->render_screen_reader_content( 'heading_list' );
?>
<?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' );
}
@ -365,7 +367,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
if ( 'top' === $which ) {
wp_referer_field();
?>
?>
<div class="tablenav top">
<div class="alignleft actions">
<?php
@ -385,7 +387,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
<?php $this->pagination( $which ); ?>
<br class="clear" />
</div>
<?php
<?php
}
}
@ -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() ) {
@ -621,7 +624,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$action_links = apply_filters( 'plugin_install_action_links', $action_links, $plugin );
$last_updated_timestamp = strtotime( $plugin['last_updated'] );
?>
?>
<div class="plugin-card plugin-card-<?php echo sanitize_html_class( $plugin['slug'] ); ?>">
<?php
if ( ! $compatible_php || ! $compatible_wp ) {
@ -651,7 +654,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
self_admin_url( 'update-core.php' )
);
}
} elseif ( ! $compatible_php ) {
} elseif ( ! $compatible_php ) {
_e( 'This plugin doesn&#8217;t work with your version of PHP. ' );
printf(
/* translators: %s: "Updating PHP" page URL */
@ -703,7 +706,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
<?php
if ( $plugin['active_installs'] >= 1000000 ) {
$active_installs_millions = floor( $plugin['active_installs'] / 1000000 );
$active_installs_text = sprintf(
$active_installs_text = sprintf(
_nx( '%s+ Million', '%s+ Million', $active_installs_millions, 'Active plugin installations' ),
number_format_i18n( $active_installs_millions )
);
@ -728,7 +731,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
</div>
</div>
</div>
<?php
<?php
}
// Close off the group divs of the last one

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,13 +49,13 @@ 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
if ( $singular ) {
echo " data-wp-lists='list:$singular'";
}
<?php
if ( $singular ) {
echo " data-wp-lists='list:$singular'";
}
?>
>
<?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,46 +462,46 @@ 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() ) {
ob_start();
<?php
if ( 'top' === $which && ! is_singular() ) {
ob_start();
$this->months_dropdown( $this->screen->post_type );
$this->categories_dropdown( $this->screen->post_type );
$this->months_dropdown( $this->screen->post_type );
$this->categories_dropdown( $this->screen->post_type );
/**
* Fires before the Filter button on the Posts and Pages list tables.
*
* The Filter button allows sorting by date and/or category on the
* Posts list table, and sorting by date on the Pages list table.
*
* @since 2.1.0
* @since 4.4.0 The `$post_type` parameter was added.
* @since 4.6.0 The `$which` parameter was added.
*
* @param string $post_type The post type slug.
* @param string $which The location of the extra table nav markup:
* 'top' or 'bottom' for WP_Posts_List_Table,
* 'bar' for WP_Media_List_Table.
*/
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
/**
* Fires before the Filter button on the Posts and Pages list tables.
*
* The Filter button allows sorting by date and/or category on the
* Posts list table, and sorting by date on the Pages list table.
*
* @since 2.1.0
* @since 4.4.0 The `$post_type` parameter was added.
* @since 4.6.0 The `$which` parameter was added.
*
* @param string $post_type The post type slug.
* @param string $which The location of the extra table nav markup:
* 'top' or 'bottom' for WP_Posts_List_Table,
* 'bar' for WP_Media_List_Table.
*/
do_action( 'restrict_manage_posts', $this->screen->post_type, $which );
$output = ob_get_clean();
$output = ob_get_clean();
if ( ! empty( $output ) ) {
echo $output;
submit_button( __( 'Filter' ), '', 'filter_action', false, array( 'id' => 'post-query-submit' ) );
}
}
if ( ! empty( $output ) ) {
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() ) {
submit_button( __( 'Empty Trash' ), 'apply', 'delete_all', false );
}
?>
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.
@ -850,11 +852,11 @@ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->p
*/
public function column_cb( $post ) {
if ( current_user_can( 'edit_post', $post->ID ) ) :
?>
?>
<label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>">
<?php
printf( __( 'Select %s' ), _draft_or_post_title() );
?>
?>
</label>
<input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
<div class="locked-indicator">
@ -869,7 +871,7 @@ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->p
?>
</span>
</div>
<?php
<?php
endif;
}
@ -1219,11 +1221,11 @@ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->p
} else {
$classes .= ' level-0';
}
?>
?>
<tr id="post-<?php echo $post->ID; ?>" class="<?php echo implode( ' ', get_post_class( $classes, $post->ID ) ); ?>">
<?php $this->single_row_columns( $post ); ?>
</tr>
<?php
<?php
$GLOBALS['post'] = $global_post;
}
@ -1417,7 +1419,7 @@ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->p
'author' => true,
);
?>
?>
<form method="get"><table style="display: none"><tbody id="inlineedit">
<?php
@ -1428,28 +1430,28 @@ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->p
$bulk = 0;
while ( $bulk < 2 ) {
?>
?>
<tr id="<?php echo $bulk ? 'bulk-edit' : 'inline-edit'; ?>" class="
<?php
echo $inline_edit_classes . ' ';
echo $bulk ? $bulk_edit_classes : $quick_edit_classes;
?>
?>
" style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
<fieldset class="inline-edit-col-left">
<legend class="inline-edit-legend"><?php echo $bulk ? __( 'Bulk Edit' ) : __( 'Quick Edit' ); ?></legend>
<div class="inline-edit-col">
<?php
<?php
if ( post_type_supports( $screen->post_type, 'title' ) ) :
if ( $bulk ) :
?>
if ( post_type_supports( $screen->post_type, 'title' ) ) :
if ( $bulk ) :
?>
<div id="bulk-title-div">
<div id="bulk-titles"></div>
</div>
<?php else : // $bulk ?>
<?php else : // $bulk ?>
<label>
<span class="title"><?php _e( 'Title' ); ?></span>
@ -1464,15 +1466,15 @@ if ( $this->is_trash && current_user_can( get_post_type_object( $this->screen->p
<?php
endif; // $bulk
endif; // post_type_supports title
?>
?>
<?php if ( ! $bulk ) : ?>
<?php if ( ! $bulk ) : ?>
<fieldset class="inline-edit-date">
<legend><span class="title"><?php _e( 'Date' ); ?></span></legend>
<?php touch_time( 1, 1, 0, 1 ); ?>
</fieldset>
<br class="clear" />
<?php
<?php
endif; // $bulk
if ( post_type_supports( $screen->post_type, 'author' ) ) :
@ -1531,16 +1533,16 @@ if ( ! $bulk && $can_publish ) :
</div></fieldset>
<?php if ( count( $hierarchical_taxonomies ) && ! $bulk ) : ?>
<?php if ( count( $hierarchical_taxonomies ) && ! $bulk ) : ?>
<fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
<?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
<?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
<span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
<input type="hidden" name="<?php echo ( $taxonomy->name === 'category' ) ? 'post_category[]' : 'tax_input[' . esc_attr( $taxonomy->name ) . '][]'; ?>" value="0" />
<ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist">
<?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
<?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
</ul>
<?php endforeach; //$hierarchical_taxonomies as $taxonomy ?>
@ -1551,69 +1553,69 @@ if ( ! $bulk && $can_publish ) :
<fieldset class="inline-edit-col-right"><div class="inline-edit-col">
<?php
if ( post_type_supports( $screen->post_type, 'author' ) && $bulk ) {
echo $authors_dropdown;
}
<?php
if ( post_type_supports( $screen->post_type, 'author' ) && $bulk ) {
echo $authors_dropdown;
}
if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
if ( post_type_supports( $screen->post_type, 'page-attributes' ) ) :
if ( $post_type_object->hierarchical ) :
?>
if ( $post_type_object->hierarchical ) :
?>
<label>
<span class="title"><?php _e( 'Parent' ); ?></span>
<?php
$dropdown_args = array(
'post_type' => $post_type_object->name,
'selected' => $post->post_parent,
'name' => 'post_parent',
'show_option_none' => __( 'Main Page (no parent)' ),
'option_none_value' => 0,
'sort_column' => 'menu_order, post_title',
);
<?php
$dropdown_args = array(
'post_type' => $post_type_object->name,
'selected' => $post->post_parent,
'name' => 'post_parent',
'show_option_none' => __( 'Main Page (no parent)' ),
'option_none_value' => 0,
'sort_column' => 'menu_order, post_title',
);
if ( $bulk ) {
$dropdown_args['show_option_no_change'] = __( '&mdash; No Change &mdash;' );
}
if ( $bulk ) {
$dropdown_args['show_option_no_change'] = __( '&mdash; No Change &mdash;' );
}
/**
* Filters the arguments used to generate the Quick Edit page-parent drop-down.
*
* @since 2.7.0
*
* @see wp_dropdown_pages()
*
* @param array $dropdown_args An array of arguments.
*/
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
/**
* Filters the arguments used to generate the Quick Edit page-parent drop-down.
*
* @since 2.7.0
*
* @see wp_dropdown_pages()
*
* @param array $dropdown_args An array of arguments.
*/
$dropdown_args = apply_filters( 'quick_edit_dropdown_pages_args', $dropdown_args );
wp_dropdown_pages( $dropdown_args );
?>
wp_dropdown_pages( $dropdown_args );
?>
</label>
<?php
endif; // hierarchical
<?php
endif; // hierarchical
if ( ! $bulk ) :
?>
if ( ! $bulk ) :
?>
<label>
<span class="title"><?php _e( 'Order' ); ?></span>
<span class="input-text-wrap"><input type="text" name="menu_order" class="inline-edit-menu-order-input" value="<?php echo $post->menu_order; ?>" /></span>
</label>
<?php
endif; // !$bulk
<?php
endif; // !$bulk
endif; // page-attributes
?>
?>
<?php if ( 0 < count( get_page_templates( null, $screen->post_type ) ) ) : ?>
<?php if ( 0 < count( get_page_templates( null, $screen->post_type ) ) ) : ?>
<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' );
@ -1624,31 +1626,31 @@ if ( ! $bulk && $can_publish ) :
</label>
<?php endif; ?>
<?php if ( count( $flat_taxonomies ) && ! $bulk ) : ?>
<?php if ( count( $flat_taxonomies ) && ! $bulk ) : ?>
<?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
<?php
if ( current_user_can( $taxonomy->cap->assign_terms ) ) :
$taxonomy_name = esc_attr( $taxonomy->name );
<?php foreach ( $flat_taxonomies as $taxonomy ) : ?>
<?php
if ( current_user_can( $taxonomy->cap->assign_terms ) ) :
$taxonomy_name = esc_attr( $taxonomy->name );
?>
?>
<label class="inline-edit-tags">
<span class="title"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
<textarea data-wp-taxonomy="<?php echo $taxonomy_name; ?>" cols="22" rows="1" name="tax_input[<?php echo $taxonomy_name; ?>]" class="tax_input_<?php echo $taxonomy_name; ?>"></textarea>
</label>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; //$flat_taxonomies as $taxonomy ?>
<?php endif; // count( $flat_taxonomies ) && !$bulk ?>
<?php
if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
if ( $bulk ) :
?>
<?php
if ( post_type_supports( $screen->post_type, 'comments' ) || post_type_supports( $screen->post_type, 'trackbacks' ) ) :
if ( $bulk ) :
?>
<div class="inline-edit-group wp-clearfix">
<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
<label class="alignleft">
<span class="title"><?php _e( 'Comments' ); ?></span>
<select name="comment_status">
@ -1669,7 +1671,7 @@ if ( ! $bulk && $can_publish ) :
<?php endif; ?>
</div>
<?php else : // $bulk ?>
<?php else : // $bulk ?>
<div class="inline-edit-group wp-clearfix">
<?php if ( post_type_supports( $screen->post_type, 'comments' ) ) : ?>
@ -1688,19 +1690,19 @@ if ( ! $bulk && $can_publish ) :
<?php
endif; // $bulk
endif; // post_type_supports comments or pings
?>
?>
<div class="inline-edit-group wp-clearfix">
<label class="inline-edit-status alignleft">
<span class="title"><?php _e( 'Status' ); ?></span>
<select name="_status">
<?php if ( $bulk ) : ?>
<?php if ( $bulk ) : ?>
<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
<?php endif; // $bulk ?>
<?php if ( $can_publish ) : // Contributors only get "Unpublished" and "Pending Review" ?>
<option value="publish"><?php _e( 'Published' ); ?></option>
<option value="future"><?php _e( 'Scheduled' ); ?></option>
<?php if ( $bulk ) : ?>
<?php if ( $bulk ) : ?>
<option value="private"><?php _e( 'Private' ); ?></option>
<?php endif; // $bulk ?>
<?php endif; ?>
@ -1709,9 +1711,9 @@ if ( ! $bulk && $can_publish ) :
</select>
</label>
<?php if ( 'post' === $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
<?php if ( 'post' === $screen->post_type && $can_publish && current_user_can( $post_type_object->cap->edit_others_posts ) ) : ?>
<?php if ( $bulk ) : ?>
<?php if ( $bulk ) : ?>
<label class="alignright">
<span class="title"><?php _e( 'Sticky' ); ?></span>
@ -1735,69 +1737,69 @@ if ( ! $bulk && $can_publish ) :
</div>
<?php
<?php
if ( $bulk && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) ) {
$post_formats = get_theme_support( 'post-formats' );
if ( $bulk && current_theme_supports( 'post-formats' ) && post_type_supports( $screen->post_type, 'post-formats' ) ) {
$post_formats = get_theme_support( 'post-formats' );
?>
?>
<label class="alignleft">
<span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
<select name="post_format">
<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
<option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
<?php
if ( is_array( $post_formats[0] ) ) {
foreach ( $post_formats[0] as $format ) {
?>
<?php
if ( is_array( $post_formats[0] ) ) {
foreach ( $post_formats[0] as $format ) {
?>
<option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
<?php
<?php
}
}
}
?>
?>
</select></label>
<?php
<?php
}
}
?>
?>
</div></fieldset>
<?php
list( $columns ) = $this->get_column_info();
<?php
list( $columns ) = $this->get_column_info();
foreach ( $columns as $column_name => $column_display_name ) {
if ( isset( $core_columns[ $column_name ] ) ) {
continue;
}
foreach ( $columns as $column_name => $column_display_name ) {
if ( isset( $core_columns[ $column_name ] ) ) {
continue;
}
if ( $bulk ) {
if ( $bulk ) {
/**
* Fires once for each column in Bulk Edit mode.
*
* @since 2.7.0
*
* @param string $column_name Name of the column to edit.
* @param WP_Post $post_type The post type slug.
*/
do_action( 'bulk_edit_custom_box', $column_name, $screen->post_type );
} else {
/**
* Fires once for each column in Bulk Edit mode.
*
* @since 2.7.0
*
* @param string $column_name Name of the column to edit.
* @param WP_Post $post_type The post type slug.
*/
do_action( 'bulk_edit_custom_box', $column_name, $screen->post_type );
} else {
/**
* Fires once for each column in Quick Edit mode.
*
* @since 2.7.0
*
* @param string $column_name Name of the column to edit.
* @param string $post_type The post type slug, or current screen name if this is a taxonomy list table.
* @param string taxonomy The taxonomy name, if any.
*/
do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' );
}
}
?>
/**
* Fires once for each column in Quick Edit mode.
*
* @since 2.7.0
*
* @param string $column_name Name of the column to edit.
* @param string $post_type The post type slug, or current screen name if this is a taxonomy list table.
* @param string taxonomy The taxonomy name, if any.
*/
do_action( 'quick_edit_custom_box', $column_name, $screen->post_type, '' );
}
}
?>
<div class="submit inline-edit-save">
<button type="button" class="button cancel alignleft"><?php _e( 'Cancel' ); ?></button>
<?php
@ -1806,7 +1808,7 @@ if ( ! $bulk && $can_publish ) :
?>
<button type="button" class="button button-primary save alignright"><?php _e( 'Update' ); ?></button>
<span class="spinner"></span>
<?php
<?php
} else {
submit_button( __( 'Update' ), 'primary alignright', 'bulk_edit', false );
}
@ -1822,11 +1824,11 @@ if ( ! $bulk && $can_publish ) :
</div>
</div>
</td></tr>
<?php
$bulk++;
<?php
$bulk++;
}
?>
?>
</tbody></table></form>
<?php
<?php
}
}

View File

@ -806,7 +806,7 @@ final class WP_Screen {
<?php echo esc_html( $tab['title'] ); ?>
</a>
</li>
<?php
<?php
$class = '';
endforeach;
?>
@ -837,7 +837,7 @@ final class WP_Screen {
}
?>
</div>
<?php
<?php
$classes = 'help-tab-content';
endforeach;
?>
@ -890,10 +890,10 @@ final class WP_Screen {
<div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">
<button type="button" id="contextual-help-link" class="button show-settings" aria-controls="contextual-help-wrap" aria-expanded="false"><?php _e( 'Help' ); ?></button>
</div>
<?php
<?php
endif;
if ( $this->show_screen_options() ) :
?>
?>
<div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">
<button type="button" id="show-settings-link" class="button show-settings" aria-controls="screen-options-wrap" aria-expanded="false"><?php _e( 'Screen Options' ); ?></button>
</div>
@ -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,
)
);
@ -1121,12 +1122,12 @@ if ( $this->show_screen_options() ) :
?>
<label class="columns-prefs-<?php echo $i; ?>">
<input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>'
<?php checked( $screen_layout_columns, $i ); ?> />
<?php printf( _n( '%s column', '%s columns', $i ), number_format_i18n( $i ) ); ?>
<?php checked( $screen_layout_columns, $i ); ?> />
<?php printf( _n( '%s column', '%s columns', $i ), number_format_i18n( $i ) ); ?>
</label>
<?php
<?php
endfor;
?>
?>
</fieldset>
<?php
}
@ -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' => '',
@ -385,7 +386,7 @@ class WP_Terms_List_Table extends WP_List_Table {
urlencode( wp_unslash( $uri ) ),
$edit_link
);
$name = sprintf(
$name = sprintf(
'<a class="row-title" href="%s" aria-label="%s">%s</a>',
esc_url( $edit_link ),
/* translators: %s: taxonomy term name */
@ -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">
@ -619,14 +620,14 @@ class WP_Terms_List_Table extends WP_List_Table {
<span class="title"><?php _ex( 'Name', 'term name' ); ?></span>
<span class="input-text-wrap"><input type="text" name="name" class="ptitle" value="" /></span>
</label>
<?php if ( ! global_terms_enabled() ) { ?>
<?php if ( ! global_terms_enabled() ) { ?>
<label>
<span class="title"><?php _e( 'Slug' ); ?></span>
<span class="input-text-wrap"><input type="text" name="slug" class="ptitle" value="" /></span>
</label>
<?php } ?>
</div></fieldset>
<?php
<?php
$core_columns = array(
'cb' => true,
@ -638,16 +639,16 @@ class WP_Terms_List_Table extends WP_List_Table {
list( $columns ) = $this->get_column_info();
foreach ( $columns as $column_name => $column_display_name ) {
if ( isset( $core_columns[ $column_name ] ) ) {
continue;
foreach ( $columns as $column_name => $column_display_name ) {
if ( isset( $core_columns[ $column_name ] ) ) {
continue;
}
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
}
/** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
}
?>
?>
<div class="inline-edit-save submit">
<button type="button" class="cancel button alignleft"><?php _e( 'Cancel' ); ?></button>
@ -663,6 +664,6 @@ class WP_Terms_List_Table extends WP_List_Table {
</div>
</td></tr>
</tbody></table></form>
<?php
<?php
}
}

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
@ -219,13 +219,13 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
public function display_rows() {
$themes = $this->items;
foreach ( $themes as $theme ) {
?>
?>
<div class="available-theme installable-theme">
<?php
$this->single_row( $theme );
?>
</div>
<?php
<?php
} // end foreach $theme_names
$this->theme_installer();
@ -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 );
@ -472,12 +479,14 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
);
break;
}
?>
?>
<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
}
/**
@ -250,7 +250,7 @@ class WP_Themes_List_Table extends WP_List_Table {
</div>
</div>
<?php
<?php
endforeach;
}

View File

@ -264,7 +264,7 @@ class WP_Users_List_Table extends WP_List_Table {
protected function extra_tablenav( $which ) {
$id = 'bottom' === $which ? 'new_role2' : 'new_role';
$button_id = 'bottom' === $which ? 'changeit2' : 'changeit';
?>
?>
<div class="alignleft actions">
<?php if ( current_user_can( 'promote_users' ) && $this->has_items() ) : ?>
<label class="screen-reader-text" for="<?php echo $id; ?>"><?php _e( 'Change role to&hellip;' ); ?></label>
@ -272,7 +272,7 @@ class WP_Users_List_Table extends WP_List_Table {
<option value=""><?php _e( 'Change role to&hellip;' ); ?></option>
<?php wp_dropdown_roles(); ?>
</select>
<?php
<?php
submit_button( __( 'Change' ), '', $button_id, false );
endif;
@ -286,9 +286,9 @@ 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
<?php
/**
* Fires immediately following the closing "actions" div in the tablenav for the users
* list table.

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
@ -388,11 +388,11 @@ function wp_dashboard_right_now() {
$actions = ob_get_clean();
if ( ! empty( $actions ) ) :
?>
?>
<div class="sub">
<?php echo $actions; ?>
</div>
<?php
<?php
endif;
}
@ -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 ); ?>>
@ -702,28 +702,28 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
<div class="dashboard-comment-wrap has-row-actions">
<p class="comment-meta">
<?php
<?php
// Comments might not have a post they relate to, e.g. programmatically created ones.
if ( $comment_post_link ) {
printf(
/* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */
__( 'From %1$s on %2$s %3$s' ),
'<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
$comment_post_link,
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
} else {
printf(
/* translators: 1: comment author, 2: notification if the comment is pending */
__( 'From %1$s %2$s' ),
'<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
}
?>
if ( $comment_post_link ) {
printf(
/* translators: 1: comment author, 2: post link, 3: notification if the comment is pending */
__( 'From %1$s on %2$s %3$s' ),
'<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
$comment_post_link,
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
} else {
printf(
/* translators: 1: comment author, 2: notification if the comment is pending */
__( 'From %1$s %2$s' ),
'<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
}
?>
</p>
<?php
<?php
else :
switch ( $comment->comment_type ) {
case 'pingback':
@ -736,28 +736,28 @@ function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
$type = ucwords( $comment->comment_type );
}
$type = esc_html( $type );
?>
?>
<div class="dashboard-comment-wrap has-row-actions">
<p class="comment-meta">
<?php
<?php
// Pingbacks, Trackbacks or custom comment types might not have a post they relate to, e.g. programmatically created ones.
if ( $comment_post_link ) {
printf(
/* translators: 1: type of comment, 2: post link, 3: notification if the comment is pending */
_x( '%1$s on %2$s %3$s', 'dashboard' ),
"<strong>$type</strong>",
$comment_post_link,
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
} else {
printf(
/* translators: 1: type of comment, 2: notification if the comment is pending */
_x( '%1$s %2$s', 'dashboard' ),
"<strong>$type</strong>",
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
}
?>
if ( $comment_post_link ) {
printf(
/* translators: 1: type of comment, 2: post link, 3: notification if the comment is pending */
_x( '%1$s on %2$s %3$s', 'dashboard' ),
"<strong>$type</strong>",
$comment_post_link,
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
} else {
printf(
/* translators: 1: type of comment, 2: notification if the comment is pending */
_x( '%1$s %2$s', 'dashboard' ),
"<strong>$type</strong>",
'<span class="approve">' . __( '[Pending]' ) . '</span>'
);
}
?>
</p>
<p class="comment-author"><?php comment_author_link( $comment ); ?></p>
@ -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,43 +501,43 @@ function export_wp( $args = array() ) {
wxr_term_meta( $t );
?>
</wp:term>
<?php endforeach; ?>
<?php
if ( 'all' == $args['content'] ) {
wxr_nav_menu_terms();}
?>
<?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 ) {
/**
* @global WP_Query $wp_query
*/
global $wp_query;
<?php
if ( $post_ids ) {
/**
* @global WP_Query $wp_query
*/
global $wp_query;
// Fake being in the loop.
$wp_query->in_the_loop = true;
// Fake being in the loop.
$wp_query->in_the_loop = true;
// Fetch 20 posts at a time rather than loading the entire table into memory.
while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
$where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
$posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
// Fetch 20 posts at a time rather than loading the entire table into memory.
while ( $next_posts = array_splice( $post_ids, 0, 20 ) ) {
$where = 'WHERE ID IN (' . join( ',', $next_posts ) . ')';
$posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
// Begin Loop.
foreach ( $posts as $post ) {
setup_postdata( $post );
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
?>
// Begin Loop.
foreach ( $posts as $post ) {
setup_postdata( $post );
$is_sticky = is_sticky( $post->ID ) ? 1 : 0;
?>
<item>
<title>
<?php
/** This filter is documented in wp-includes/feed.php */
echo apply_filters( 'the_title_rss', $post->post_title );
?>
<?php
/** This filter is documented in wp-includes/feed.php */
echo apply_filters( 'the_title_rss', $post->post_title );
?>
</title>
<link><?php the_permalink_rss(); ?></link>
<pubDate><?php echo mysql2date( 'D, d M Y H:i:s +0000', get_post_time( 'Y-m-d H:i:s', true ), false ); ?></pubDate>
@ -545,28 +545,28 @@ if ( $post_ids ) {
<guid isPermaLink="false"><?php the_guid(); ?></guid>
<description></description>
<content:encoded>
<?php
/**
* Filters the post content used for WXR exports.
*
* @since 2.5.0
*
* @param string $post_content Content of the current post.
*/
echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
?>
<?php
/**
* Filters the post content used for WXR exports.
*
* @since 2.5.0
*
* @param string $post_content Content of the current post.
*/
echo wxr_cdata( apply_filters( 'the_content_export', $post->post_content ) );
?>
</content:encoded>
<excerpt:encoded>
<?php
/**
* Filters the post excerpt used for WXR exports.
*
* @since 2.6.0
*
* @param string $post_excerpt Excerpt for the current post.
*/
echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
?>
<?php
/**
* Filters the post excerpt used for WXR exports.
*
* @since 2.6.0
*
* @param string $post_excerpt Excerpt for the current post.
*/
echo wxr_cdata( apply_filters( 'the_excerpt_export', $post->post_excerpt ) );
?>
</excerpt:encoded>
<wp:post_id><?php echo intval( $post->ID ); ?></wp:post_id>
<wp:post_date><?php echo wxr_cdata( $post->post_date ); ?></wp:post_date>
@ -580,40 +580,40 @@ if ( $post_ids ) {
<wp:post_type><?php echo wxr_cdata( $post->post_type ); ?></wp:post_type>
<wp:post_password><?php echo wxr_cdata( $post->post_password ); ?></wp:post_password>
<wp:is_sticky><?php echo intval( $is_sticky ); ?></wp:is_sticky>
<?php if ( $post->post_type == 'attachment' ) : ?>
<?php if ( $post->post_type == 'attachment' ) : ?>
<wp:attachment_url><?php echo wxr_cdata( wp_get_attachment_url( $post->ID ) ); ?></wp:attachment_url>
<?php endif; ?>
<?php wxr_post_taxonomy(); ?>
<?php
$postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
foreach ( $postmeta as $meta ) :
/**
* Filters whether to selectively skip post meta used for WXR exports.
*
* Returning a truthy value to the filter will skip the current meta
* object from being exported.
*
* @since 3.3.0
*
* @param bool $skip Whether to skip the current post meta. Default false.
* @param string $meta_key Current meta key.
* @param object $meta Current meta object.
*/
if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
continue;
}
?>
<?php wxr_post_taxonomy(); ?>
<?php
$postmeta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->postmeta WHERE post_id = %d", $post->ID ) );
foreach ( $postmeta as $meta ) :
/**
* Filters whether to selectively skip post meta used for WXR exports.
*
* Returning a truthy value to the filter will skip the current meta
* object from being exported.
*
* @since 3.3.0
*
* @param bool $skip Whether to skip the current post meta. Default false.
* @param string $meta_key Current meta key.
* @param object $meta Current meta object.
*/
if ( apply_filters( 'wxr_export_skip_postmeta', false, $meta->meta_key, $meta ) ) {
continue;
}
?>
<wp:postmeta>
<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 );
foreach ( $comments as $c ) :
?>
$_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 );
foreach ( $comments as $c ) :
?>
<wp:comment>
<wp:comment_id><?php echo intval( $c->comment_ID ); ?></wp:comment_id>
<wp:comment_author><?php echo wxr_cdata( $c->comment_author ); ?></wp:comment_author>
@ -627,39 +627,39 @@ 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
$c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
foreach ( $c_meta as $meta ) :
/**
* Filters whether to selectively skip comment meta used for WXR exports.
*
* Returning a truthy value to the filter will skip the current meta
* object from being exported.
*
* @since 4.0.0
*
* @param bool $skip Whether to skip the current comment meta. Default false.
* @param string $meta_key Current meta key.
* @param object $meta Current meta object.
*/
if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
continue;
}
?>
<?php
$c_meta = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->commentmeta WHERE comment_id = %d", $c->comment_ID ) );
foreach ( $c_meta as $meta ) :
/**
* Filters whether to selectively skip comment meta used for WXR exports.
*
* Returning a truthy value to the filter will skip the current meta
* object from being exported.
*
* @since 4.0.0
*
* @param bool $skip Whether to skip the current comment meta. Default false.
* @param string $meta_key Current meta key.
* @param object $meta Current meta object.
*/
if ( apply_filters( 'wxr_export_skip_commentmeta', false, $meta->meta_key, $meta ) ) {
continue;
}
?>
<wp:commentmeta>
<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
<?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,35 +1790,35 @@ 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 ) {
$heading_tag = 'h1';
}
echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connection Information' ) . "</$heading_tag>";
?>
<?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>";
?>
<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['ssh'] ) ) {
_e( 'Please enter your FTP or SSH credentials to proceed.' );
$label_user = __( 'FTP/SSH Username' );
$label_pass = __( 'FTP/SSH Password' );
} else {
_e( 'Please enter your FTP credentials to proceed.' );
$label_user = __( 'FTP Username' );
$label_pass = __( 'FTP Password' );
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' );
$label_pass = __( 'FTP/SSH Password' );
} else {
_e( 'Please enter your FTP credentials to proceed.' );
$label_user = __( 'FTP Username' );
$label_pass = __( 'FTP Password' );
}
echo ' ';
}
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'] ) ) {
$hidden_class = '';
if ( 'ssh' != $connection_type || empty( $connection_type ) ) {
$hidden_class = ' class="hidden"';
}
?>
<?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
}
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 ] ) . '" />';
<?php
}
}
?>
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;
}
@ -1953,11 +1957,11 @@ function wp_print_request_filesystem_credentials_modal() {
*/
function wp_privacy_generate_personal_data_export_group_html( $group_data ) {
$allowed_tags = array(
'a' => array(
'a' => array(
'href' => array(),
'target' => array()
'target' => array(),
),
'br' => array()
'br' => array(),
);
$allowed_protocols = array( 'http', 'https' );
$group_html = '';
@ -2041,7 +2045,7 @@ function wp_privacy_generate_personal_data_export_file( $request_id ) {
$file_basename = 'wp-personal-data-file-' . $stripped_email . '-' . $obscura;
$html_report_filename = $file_basename . '.html';
$html_report_pathname = wp_normalize_path( $exports_dir . $html_report_filename );
$file = fopen( $html_report_pathname, 'w' );
$file = fopen( $html_report_pathname, 'w' );
if ( false === $file ) {
wp_send_json_error( __( 'Unable to open export file (HTML report) for writing.' ) );
}
@ -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.
@ -2229,10 +2233,10 @@ All at ###SITENAME###
*/
$content = apply_filters( 'wp_privacy_personal_data_email_content', $email_text, $request_id );
$email_address = $request->email;
$email_address = $request->email;
$export_file_url = get_post_meta( $request_id, '_export_file_url', true );
$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$site_url = home_url();
$site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$site_url = home_url();
$content = str_replace( '###EXPIRATION###', $expiration_date, $content );
$content = str_replace( '###LINK###', esc_url_raw( $export_file_url ), $content );
@ -2313,9 +2317,9 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde
// If we are not yet on the last page of the last exporter, return now.
/** This filter is documented in wp-admin/includes/ajax-actions.php */
$exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
$exporters = apply_filters( 'wp_privacy_personal_data_exporters', array() );
$is_last_exporter = $exporter_index === count( $exporters );
$exporter_done = $response['done'];
$exporter_done = $response['done'];
if ( ! $is_last_exporter || ! $exporter_done ) {
return $response;
}
@ -2339,8 +2343,8 @@ function wp_privacy_process_personal_data_export_page( $response, $exporter_inde
$groups[ $group_id ]['items'][ $item_id ] = array();
}
$old_item_data = $groups[ $group_id ]['items'][ $item_id ];
$merged_item_data = array_merge( $export_datum['data'], $old_item_data );
$old_item_data = $groups[ $group_id ]['items'][ $item_id ];
$merged_item_data = array_merge( $export_datum['data'], $old_item_data );
$groups[ $group_id ]['items'][ $item_id ] = $merged_item_data;
}

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">
@ -152,7 +152,7 @@ function wp_image_editor( $post_id, $msg = false ) {
<?php
if ( $thumb && $sub_sizes ) {
$thumb_img = wp_constrain_dimensions( $thumb['width'], $thumb['height'], 160, 120 );
?>
?>
<div class="imgedit-group imgedit-applyto">
<div class="imgedit-group-top">
@ -203,13 +203,13 @@ function wp_image_editor( $post_id, $msg = false ) {
)
) ) {
$note_no_rotate = '';
?>
?>
<button type="button" class="imgedit-rleft button" onclick="imageEdit.rotate( 90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate counter-clockwise' ); ?></span></button>
<button type="button" class="imgedit-rright button" onclick="imageEdit.rotate(-90, <?php echo "$post_id, '$nonce'"; ?>, this)"><span class="screen-reader-text"><?php esc_html_e( 'Rotate clockwise' ); ?></span></button>
<?php
<?php
} else {
$note_no_rotate = '<p class="note-no-rotate"><em>' . __( 'Image rotation is not supported by your web host.' ) . '</em></p>';
?>
?>
<button type="button" class="imgedit-rleft button disabled" disabled></button>
<button type="button" class="imgedit-rright button disabled" disabled></button>
<?php } ?>
@ -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

@ -437,7 +437,7 @@ function wp_read_image_metadata( $file ) {
}
}
$exif = array();
$exif = array();
/**
* Filters the image types to check for exif data.

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;
}
@ -368,7 +368,7 @@ function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrid
$content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] );
}
// Use image exif/iptc data for title and caption defaults if possible.
// Use image exif/iptc data for title and caption defaults if possible.
} elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) {
if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) {
$title = $image_meta['title'];
@ -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( 'deprecated-media' );
}
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,43 +538,43 @@ 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 ) ) {
/**
* Fires in the admin header for each specific form tab in the legacy
* (pre-3.5.0) media upload popup.
*
* The dynamic portion of the hook, `$content_func`, refers to the form
* callback for the media upload type. Possible values include
* 'media_upload_type_form', 'media_upload_type_url_form', and
* 'media_upload_library_form'.
*
* @since 2.5.0
*/
do_action( "admin_head_{$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.
*
* The dynamic portion of the hook, `$content_func`, refers to the form
* callback for the media upload type. Possible values include
* 'media_upload_type_form', 'media_upload_type_url_form', and
* 'media_upload_library_form'.
*
* @since 2.5.0
*/
do_action( "admin_head_{$content_func}" );
}
$body_id_attr = '';
if ( isset( $GLOBALS['body_id'] ) ) {
$body_id_attr = ' id="' . $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
}
/**
@ -754,7 +756,7 @@ function media_upload_form_handler() {
}
if ( isset( $_POST['insert-gallery'] ) || isset( $_POST['update-gallery'] ) ) {
?>
?>
<script type="text/javascript">
var win = window.dialogArguments || opener || parent || top;
win.tb_remove();
@ -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,123 +1952,123 @@ 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'] ) ) {
echo $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'] ) ) {
echo $errors['upload_error']->get_error_message();
}
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.
*
* @since 3.5.0
*/
do_action( 'upload_ui_over_quota' );
return;
}
/**
* Fires when an upload will exceed the defined upload space quota for a network site.
* Fires just before the legacy (pre-3.5.0) upload interface is loaded.
*
* @since 3.5.0
* @since 2.6.0
*/
do_action( 'upload_ui_over_quota' );
return;
}
do_action( 'pre-upload-ui' );
/**
* Fires just before the legacy (pre-3.5.0) upload interface is loaded.
*
* @since 2.6.0
*/
do_action( 'pre-upload-ui' );
$post_params = array(
'post_id' => $post_id,
'_wpnonce' => wp_create_nonce( 'media-form' ),
'type' => $_type,
'tab' => $_tab,
'short' => '1',
);
$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'
* @since 3.3.0
*
* @param array $post_params An array of media upload parameters used by Plupload.
*/
$post_params = apply_filters( 'upload_post_params', $post_params );
/**
* Filters the media upload post parameters.
*
* @since 3.1.0 As 'swfupload_post_params'
* @since 3.3.0
*
* @param array $post_params An array of media upload parameters used by Plupload.
*/
$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(
'browse_button' => 'plupload-browse-button',
'container' => 'plupload-upload-ui',
'drop_element' => 'drag-drop-area',
'file_data_name' => 'async-upload',
'url' => $upload_action_url,
'filters' => array(
'max_file_size' => $max_upload_size . 'b',
),
'multipart_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(
'browse_button' => 'plupload-browse-button',
'container' => 'plupload-upload-ui',
'drop_element' => 'drag-drop-area',
'file_data_name' => 'async-upload',
'url' => $upload_action_url,
'filters' => 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;
}
$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 );
/**
* 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 );
?>
?>
<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 ) {
$large_size_h = 1024;
}
$large_size_w = absint( get_option( 'large_size_w' ) );
if ( ! $large_size_w ) {
$large_size_w = 1024;
}
?>
<?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 = 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
/**
* 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' );
?>
<?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' );
?>
<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
/**
* 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' );
?>
<?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' );
?>
</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
/**
* Fires after the upload button in the media upload interface.
*
* @since 2.6.0
*/
do_action( 'post-html-upload-ui' );
?>
<?php
/**
* Fires after the upload button in the media upload interface.
*
* @since 2.6.0
*/
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,25 +2178,25 @@ jQuery(function($){
});
</script>
<div id="media-items">
<?php
<?php
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 );
} else {
echo '<div id="media-upload-error">' . esc_html( $id->get_error_message() ) . '</div></div>';
exit;
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 );
} else {
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,10 +2249,10 @@ 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');
caption = caption.replace(/<[a-zA-Z0-9]+( [^<>]+)?>/g, function(a){
@ -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
/**
* 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 ) );
?>
<?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 ) );
?>
</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(
'id' => 'save-all',
'style' => 'display: none;',
)
);
?>
<?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,127 +2563,127 @@ 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 ) {
foreach ( $reals as $real ) {
if ( isset( $num_posts[ $_type ] ) ) {
$num_posts[ $_type ] += $_num_posts[ $real ];
} else {
$num_posts[ $_type ] = $_num_posts[ $real ];
<?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 ];
} else {
$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 ] ) ) {
$_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' ) {
$class = ' class="current"';
} else {
$class = '';
}
$type_links[] = '<li><a href="' . esc_url(
add_query_arg(
array(
'post_mime_type' => 'all',
'paged' => false,
'm' => false,
)
)
) . '"' . $class . '>' . __( 'All Types' ) . '</a>';
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';
if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {
continue;
// 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 ( isset( $_GET['post_mime_type'] ) && wp_match_mime_types( $mime_type, $_GET['post_mime_type'] ) ) {
if ( empty( $_GET['post_mime_type'] ) || $_GET['post_mime_type'] == 'all' ) {
$class = ' class="current"';
} else {
$class = '';
}
$type_links[] = '<li><a href="' . esc_url(
add_query_arg(
array(
'post_mime_type' => $mime_type,
'post_mime_type' => 'all',
'paged' => false,
'm' => false,
)
)
) . '"' . $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.
*
* @since 3.1.0
*
* @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 );
?>
) . '"' . $class . '>' . __( 'All Types' ) . '</a>';
foreach ( $post_mime_types as $mime_type => $label ) {
$class = '';
if ( ! wp_match_mime_types( $mime_type, $avail_post_mime_types ) ) {
continue;
}
if ( isset( $_GET['post_mime_type'] ) && wp_match_mime_types( $mime_type, $_GET['post_mime_type'] ) ) {
$class = ' class="current"';
}
$type_links[] = '<li><a href="' . esc_url(
add_query_arg(
array(
'post_mime_type' => $mime_type,
'paged' => false,
)
)
) . '"' . $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.
*
* @since 3.1.0
*
* @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 );
?>
</ul>
<div class="tablenav">
<?php
$page_links = paginate_links(
array(
'base' => add_query_arg( 'paged', '%#%' ),
'format' => '',
'prev_text' => __( '&laquo;' ),
'next_text' => __( '&raquo;' ),
'total' => ceil( $wp_query->found_posts / 10 ),
'current' => $q['paged'],
)
);
<?php
$page_links = paginate_links(
array(
'base' => add_query_arg( 'paged', '%#%' ),
'format' => '',
'prev_text' => __( '&laquo;' ),
'next_text' => __( '&raquo;' ),
'total' => ceil( $wp_query->found_posts / 10 ),
'current' => $q['paged'],
)
);
if ( $page_links ) {
echo "<div class='tablenav-pages'>$page_links</div>";
}
?>
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 ) {
if ( $arc_row->yyear == 0 ) {
continue;
}
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
<?php
foreach ( $arc_result as $arc_row ) {
if ( $arc_row->yyear == 0 ) {
continue;
}
$arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
if ( $arc_row->yyear . $arc_row->mmonth == $selected_month ) {
$default = ' selected="selected"';
} else {
$default = '';
}
if ( $arc_row->yyear . $arc_row->mmonth == $selected_month ) {
$default = ' selected="selected"';
} else {
$default = '';
}
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";
}
?>
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
}
/**
@ -2925,7 +2938,7 @@ function edit_form_image_editor( $post ) {
} else {
$not_open_style = ' style="display:none"';
}
?>
?>
<div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div>
@ -2937,9 +2950,9 @@ function edit_form_image_editor( $post ) {
<?php
if ( $open ) {
wp_image_editor( $attachment_id );}
?>
?>
</div>
<?php
<?php
elseif ( $attachment_id && wp_attachment_is( 'audio', $post ) ) :
wp_maybe_generate_attachment_metadata( $post );
@ -3024,7 +3037,7 @@ function edit_form_image_editor( $post ) {
if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
echo ': ' . __( 'Displayed on attachment pages.' );
}
?>
?>
</label>
<?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?>
@ -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 ); ?>" />
@ -3077,7 +3090,7 @@ function attachment_submitbox_metadata() {
} else {
echo strtoupper( str_replace( 'image/', '', $post->post_mime_type ) );
}
?>
?>
</strong>
</div>
@ -3122,7 +3135,7 @@ function attachment_submitbox_metadata() {
if ( empty( $meta[ $key ] ) ) {
continue;
}
?>
?>
<div class="misc-pub-section misc-pub-mime-meta misc-pub-<?php echo sanitize_html_class( $key ); ?>">
<?php echo $label; ?> <strong>
<?php
@ -3137,10 +3150,10 @@ function attachment_submitbox_metadata() {
echo esc_html( $meta[ $key ] );
break;
}
?>
?>
</strong>
</div>
<?php
<?php
}
$fields = array(
@ -3166,20 +3179,20 @@ function attachment_submitbox_metadata() {
if ( empty( $meta['audio'][ $key ] ) ) {
continue;
}
?>
?>
<div class="misc-pub-section misc-pub-audio misc-pub-<?php echo sanitize_html_class( $key ); ?>">
<?php echo $label; ?> <strong><?php echo esc_html( $meta['audio'][ $key ] ); ?></strong>
</div>
<?php
<?php
}
}
if ( $media_dims ) :
?>
?>
<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 ) {
$private_style = '';
if ( 'private' == $post->post_status ) {
$private_style = 'style="display:none"';
}
?>
<?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 ) {
$preview_button_text = __( 'Preview Changes' );
} else {
$preview_button_text = __( 'Preview' );
}
<?php
$preview_link = esc_url( get_preview_post_link( $post ) );
if ( 'publish' == $post->post_status ) {
$preview_button_text = __( 'Preview Changes' );
} else {
$preview_button_text = __( 'Preview' );
}
$preview_button = sprintf(
'%1$s<span class="screen-reader-text"> %2$s</span>',
$preview_button_text,
/* translators: accessibility text */
__( '(opens in a new tab)' )
);
?>
$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
/**
* 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 );
?>
<?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 );
?>
<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 ) {
$private_style = '';
if ( 'private' == $post->post_status ) {
$private_style = 'style="display:none"';
}
?>
<?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,57 +193,57 @@ 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 ) {
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>' );
} elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
/* translators: Post date information. %s: Date on which the post was published */
$stamp = __( 'Published on: <b>%s</b>' );
} elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
$stamp = __( 'Publish <b>immediately</b>' );
} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
/* translators: Post date information. %s: Date on which the post is to be published */
$stamp = __( 'Schedule for: <b>%s</b>' );
} else { // draft, 1 or more saves, date specified
/* translators: Post date information. %s: Date on which the post is to be published */
$stamp = __( 'Publish on: <b>%s</b>' );
}
$date = date_i18n( $datef, strtotime( $post->post_date ) );
} 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'] ) ) :
?>
<div class="misc-pub-section misc-pub-revisions">
<?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>' );
} elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
/* translators: Post date information. %s: Date on which the post was published */
$stamp = __( 'Published on: <b>%s</b>' );
} elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
$stamp = __( 'Publish <b>immediately</b>' );
} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
/* translators: Post date information. %s: Date on which the post is to be published */
$stamp = __( 'Schedule for: <b>%s</b>' );
} else { // draft, 1 or more saves, date specified
/* translators: Post date information. %s: Date on which the post is to be published */
$stamp = __( 'Publish on: <b>%s</b>' );
}
$date = date_i18n( $datef, strtotime( $post->post_date ) );
} 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'] ) ) :
?>
<div class="misc-pub-section misc-pub-revisions">
<?php
/* translators: Post revisions heading. %s: The number of available revisions */
printf( __( 'Revisions: %s' ), '<b>' . number_format_i18n( $args['args']['revisions_count'] ) . '</b>' );
?>
?>
<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>
<?php printf( $stamp, $date ); ?></span>
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit date and time' ); ?></span></a>
<fieldset id="timestampdiv" class="hide-if-js">
<legend class="screen-reader-text"><?php _e( 'Date and time' ); ?></legend>
<?php touch_time( ( $action === 'edit' ), 1 ); ?>
<?php touch_time( ( $action === 'edit' ), 1 ); ?>
</fieldset>
</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,84 +261,84 @@ if ( $can_publish ) : // Contributors don't get to choose the date of publish
?>
</p>
</div>
<?php endif; ?>
<?php endif; ?>
<?php
/**
* Fires after the post time/date setting in the Publish meta box.
*
* @since 2.9.0
* @since 4.4.0 Added the `$post` parameter.
*
* @param WP_Post $post WP_Post object for the current post.
*/
do_action( 'post_submitbox_misc_actions', $post );
?>
<?php
/**
* Fires after the post time/date setting in the Publish meta box.
*
* @since 2.9.0
* @since 4.4.0 Added the `$post` parameter.
*
* @param WP_Post $post WP_Post object for the current post.
*/
do_action( 'post_submitbox_misc_actions', $post );
?>
</div>
<div class="clear"></div>
</div>
<div id="major-publishing-actions">
<?php
/**
* Fires at the beginning of the publishing actions section of the Publish meta box.
*
* @since 2.7.0
* @since 4.9.0 Added the `$post` parameter.
*
* @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 );
?>
<div id="delete-action">
<?php
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( ! EMPTY_TRASH_DAYS ) {
$delete_text = __( 'Delete Permanently' );
} else {
$delete_text = __( 'Move to Trash' );
}
<?php
/**
* Fires at the beginning of the publishing actions section of the Publish meta box.
*
* @since 2.7.0
* @since 4.9.0 Added the `$post` parameter.
*
* @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 );
?>
<div id="delete-action">
<?php
if ( current_user_can( 'delete_post', $post->ID ) ) {
if ( ! EMPTY_TRASH_DAYS ) {
$delete_text = __( 'Delete Permanently' );
} else {
$delete_text = __( 'Move to Trash' );
}
?>
<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 ) {
if ( $can_publish ) :
if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :
?>
<?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 submit_button( _x( 'Schedule', 'post action/button label' ), 'primary large', 'publish', false ); ?>
<?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
endif;
} else {
?>
<?php
endif;
} 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
}
/**
@ -449,7 +449,7 @@ function post_format_meta_box( $post, $box ) {
if ( $post_format && ! in_array( $post_format, $post_formats[0] ) ) {
$post_formats[0][] = $post_format;
}
?>
?>
<div id="post-formats-select">
<fieldset>
<legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
@ -459,7 +459,7 @@ function post_format_meta_box( $post, $box ) {
<?php endforeach; ?>
</fieldset>
</div>
<?php
<?php
endif;
endif;
}
@ -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 ) ) {
echo $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 ) {
if ( is_protected_meta( $metadata[ $key ]['meta_key'], 'post' ) || ! current_user_can( 'edit_post_meta', $post->ID, $metadata[ $key ]['meta_key'] ) ) {
unset( $metadata[ $key ] );
<?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,53 +931,53 @@ 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
/**
* Fires immediately after the label inside the 'Template' section
* of the 'Page Attributes' meta box.
*
* @since 4.4.0
*
* @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 );
?>
<?php
/**
* Fires immediately after the label inside the 'Template' section
* of the 'Page Attributes' meta box.
*
* @since 4.4.0
*
* @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 );
?>
</p>
<select name="page_template" id="page_template">
<?php
/**
* Filters the title of the default page template displayed in the drop-down.
*
* @since 4.1.0
*
* @param string $label The display value for the default page template title.
* @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' );
?>
<?php
/**
* Filters the title of the default page template displayed in the drop-down.
*
* @since 4.1.0
*
* @param string $label The display value for the default page template title.
* @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' );
?>
<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
/**
* 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() ) : ?>
<?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() ) : ?>
<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
/**
* Fires at the end of the Publish box in the Link editing screen.
*
* @since 2.5.0
*/
do_action( 'submitlink_box' );
?>
<?php
/**
* Fires at the end of the Publish box in the Link editing screen.
*
* @since 2.5.0
*/
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
}
/**
@ -1354,11 +1355,11 @@ function attachment_id3_data_meta_box( $post ) {
if ( ! empty( $meta[ $key ] ) ) {
$value = $meta[ $key ];
}
?>
?>
<p>
<label for="title"><?php echo $label; ?></label><br />
<input type="text" name="id3_<?php echo esc_attr( $key ); ?>" id="id3_<?php echo esc_attr( $key ); ?>" class="large-text" value="<?php echo esc_attr( $value ); ?>" />
</p>
<?php
<?php
endforeach;
}

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
)
);
}
@ -897,7 +899,7 @@ function admin_color_scheme_picker( $user_id ) {
endforeach;
?>
?>
</fieldset>
<?php
}
@ -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
}
@ -1453,8 +1457,8 @@ final class WP_Privacy_Policy_Content {
}
// Remove updated|removed status.
$old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
$done = array();
$old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
$done = array();
$update_cache = false;
foreach ( $old as $old_key => $old_data ) {
@ -1466,7 +1470,7 @@ final class WP_Privacy_Policy_Content {
if ( ! empty( $old_data['updated'] ) ) {
// 'updated' is now 'added'.
$done[] = array(
$done[] = array(
'plugin_name' => $old_data['plugin_name'],
'policy_text' => $old_data['policy_text'],
'added' => $old_data['updated'],
@ -1497,11 +1501,11 @@ final class WP_Privacy_Policy_Content {
*/
public static function get_suggested_policy_text() {
$policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' );
$checked = array();
$time = time();
$update_cache = false;
$new = self::$policy_content;
$old = array();
$checked = array();
$time = time();
$update_cache = false;
$new = self::$policy_content;
$old = array();
if ( $policy_page_id ) {
$old = (array) get_post_meta( $policy_page_id, '_wp_suggested_privacy_policy_content' );
@ -1516,18 +1520,18 @@ final class WP_Privacy_Policy_Content {
// Use the new plugin name in case it was changed, translated, etc.
if ( $old_data['plugin_name'] !== $new_data['plugin_name'] ) {
$old_data['plugin_name'] = $new_data['plugin_name'];
$update_cache = true;
$update_cache = true;
}
// A plugin was re-activated.
if ( ! empty( $old_data['removed'] ) ) {
unset( $old_data['removed'] );
$old_data['added'] = $time;
$update_cache = true;
$update_cache = true;
}
$checked[] = $old_data;
$found = true;
$found = true;
} elseif ( $new_data['plugin_name'] === $old_data['plugin_name'] ) {
// The info for the policy was updated.
$checked[] = array(
@ -1535,7 +1539,7 @@ final class WP_Privacy_Policy_Content {
'policy_text' => $new_data['policy_text'],
'updated' => $time,
);
$found = $update_cache = true;
$found = $update_cache = true;
}
if ( $found ) {
@ -1636,10 +1640,10 @@ final class WP_Privacy_Policy_Content {
$content_array = self::get_suggested_policy_text();
$content = '';
$toc = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
$date_format = __( 'F j, Y' );
$copy = __( 'Copy' );
$content = '';
$toc = array( '<li><a href="#wp-privacy-policy-guide-introduction">' . __( 'Introduction' ) . '</a></li>' );
$date_format = __( 'F j, Y' );
$copy = __( 'Copy' );
$return_to_top = '<a href="#" class="return-to-top">' . __( '&uarr; Return to Top' ) . '</a>';
foreach ( $content_array as $section ) {
@ -1647,14 +1651,14 @@ final class WP_Privacy_Policy_Content {
if ( ! empty( $section['removed'] ) ) {
$class = ' text-removed';
$date = date_i18n( $date_format, $section['removed'] );
$date = date_i18n( $date_format, $section['removed'] );
$meta = sprintf( __( 'Removed %s.' ), $date );
$removed = __( 'You deactivated this plugin on %s and may no longer need this policy.' );
$removed = '<div class="error inline"><p>' . sprintf( $removed, $date ) . '</p></div>';
} elseif ( ! empty( $section['updated'] ) ) {
$class = ' text-updated';
$date = date_i18n( $date_format, $section['updated'] );
$date = date_i18n( $date_format, $section['updated'] );
$meta = sprintf( __( 'Updated %s.' ), $date );
}
@ -1663,8 +1667,8 @@ final class WP_Privacy_Policy_Content {
}
$plugin_name = esc_html( $section['plugin_name'] );
$toc_id = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
$toc[] = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
$toc_id = 'wp-privacy-policy-guide-' . sanitize_title( $plugin_name );
$toc[] = sprintf( '<li><a href="#%1$s">%2$s</a>' . $meta . '</li>', $toc_id, $plugin_name );
$content .= '<div class="privacy-text-section' . $class . '">';
$content .= '<a id="' . $toc_id . '">&nbsp;</a>';
@ -1676,12 +1680,12 @@ final class WP_Privacy_Policy_Content {
$content .= $return_to_top;
if ( empty( $section['removed'] ) ) {
$content .= '<div class="privacy-text-actions">';
$content .= '<button type="button" class="privacy-text-copy button">';
$content .= '<div class="privacy-text-actions">';
$content .= '<button type="button" class="privacy-text-copy button">';
$content .= $copy;
$content .= '<span class="screen-reader-text">' . sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name ) . '</span>';
$content .= '</button>';
$content .= '</div>';
$content .= '</button>';
$content .= '</div>';
}
$content .= "</div>\n"; // End of .privacy-text-section.
@ -1727,17 +1731,17 @@ final class WP_Privacy_Policy_Content {
*/
public static function get_default_content( $descr = false ) {
$suggested_text = $descr ? '<strong class="privacy-policy-tutorial">' . __( 'Suggested text:' ) . ' </strong>' : '';
$content = '';
$content = '';
// Start of the suggested privacy policy text.
$descr && $content .=
'<div class="wp-suggested-text">';
$content .=
$content .=
'<h2>' . __( 'Who we are' ) . '</h2>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should note your site URL, as well as the name of the company, organization, or individual behind it, and some accurate contact information.' ) . '</p>' .
'<p class="privacy-policy-tutorial">' . __( 'The amount of information you may be required to show will vary depending on your local or national business regulations. You may, for example, be required to display a physical address, a registered address, or your company registration number.' ) . '</p>';
$content .=
$content .=
/* translators: %s Site URL */
'<p>' . $suggested_text . sprintf( __( 'Our website address is: %s.' ), get_bloginfo( 'url', 'display' ) ) . '</p>' .
@ -1749,29 +1753,29 @@ final class WP_Privacy_Policy_Content {
'<p class="privacy-policy-tutorial">' . __( 'Personal data is not just created by a user&#8217;s interactions with your site. Personal data is also generated from technical processes such as contact forms, comments, cookies, analytics, and third party embeds.' ) . '</p>' .
'<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any personal data about visitors, and only collects the data shown on the User Profile screen from registered users. However some of your plugins may collect personal data. You should add the relevant information below.' ) . '</p>';
$content .=
$content .=
'<h3>' . __( 'Comments' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information is captured through comments. We have noted the data which WordPress collects by default.' ) . '</p>';
$content .=
$content .=
'<p>' . $suggested_text . __( 'When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor&#8217;s IP address and browser user agent string to help spam detection.' ) . '</p>' .
'<p>' . __( 'An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.' ) . '</p>' .
'<h3>' . __( 'Media' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what information may be disclosed by users who can upload media files. All uploaded files are usually publicly accessible.' ) . '</p>';
$content .=
$content .=
'<p>' . $suggested_text . __( 'If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.' ) . '</p>' .
'<h3>' . __( 'Contact forms' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'By default, WordPress does not include a contact form. If you use a contact form plugin, use this subsection to note what personal data is captured when someone submits a contact form, and how long you keep it. For example, you may note that you keep contact form submissions for a certain period for customer service purposes, but you do not use the information submitted through them for marketing purposes.' ) . '</p>';
$content .=
$content .=
'<h3>' . __( 'Cookies' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this subsection you should list the cookies your web site uses, including those set by your plugins, social media, and analytics. We have provided the cookies which WordPress installs by default.' ) . '</p>';
$content .=
$content .=
'<p>' . $suggested_text . __( 'If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year.' ) . '</p>' .
'<p>' . __( 'If you have an account and you log in to this site, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser.' ) . '</p>' .
'<p>' . __( 'When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select &quot;Remember Me&quot;, your login will persist for two weeks. If you log out of your account, the login cookies will be removed.' ) . '</p>' .
@ -1786,63 +1790,63 @@ final class WP_Privacy_Policy_Content {
'<p class="privacy-policy-tutorial">' . __( 'In this subsection you should note what analytics package you use, how users can opt out of analytics tracking, and a link to your analytics provider&#8217;s privacy policy, if any.' ) . '</p>' .
'<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not collect any analytics data. However, many web hosting accounts collect some anonymous analytics data. You may also have installed a WordPress plugin that provides analytics services. In that case, add information from that plugin here.' ) . '</p>';
$content .=
$content .=
'<h2>' . __( 'Who we share your data with' ) . '</h2>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should name and list all third party providers with whom you share site data, including partners, cloud-based services, payment processors, and third party service providers, and note what data you share with them and why. Link to their own privacy policies if possible.' ) . '</p>' .
'<p class="privacy-policy-tutorial">' . __( 'By default WordPress does not share any personal data with anyone.' ) . '</p>';
$content .=
$content .=
'<h2>' . __( 'How long we retain your data' ) . '</h2>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should explain how long you retain personal data collected or processed by the web site. While it is your responsibility to come up with the schedule of how long you keep each dataset for and why you keep it, that information does need to be listed here. For example, you may want to say that you keep contact form entries for six months, analytics records for a year, and customer purchase records for ten years.' ) . '</p>';
$content .=
$content .=
'<p>' . $suggested_text . __( 'If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue.' ) . '</p>' .
'<p>' . __( 'For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.' ) . '</p>' .
'<h2>' . __( 'What rights you have over your data' ) . '</h2>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what rights your users have over their data and how they can invoke those rights.' ) . '</p>';
$content .=
$content .=
'<p>' . $suggested_text . __( 'If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.' ) . '</p>' .
'<h2>' . __( 'Where we send your data' ) . '</h2>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should list all transfers of your site data outside the European Union and describe the means by which that data is safeguarded to European data protection standards. This could include your web hosting, cloud storage, or other third party services.' ) . '</p>' .
'<p class="privacy-policy-tutorial">' . __( 'European data protection law requires data about European residents which is transferred outside the European Union to be safeguarded to the same standards as if the data was in Europe. So in addition to listing where data goes, you should describe how you ensure that these standards are met either by yourself or by your third party providers, whether that is through an agreement such as Privacy Shield, model clauses in your contracts, or binding corporate rules.' ) . '</p>';
$content .=
$content .=
'<p>' . $suggested_text . __( 'Visitor comments may be checked through an automated spam detection service.' ) . '</p>' .
'<h2>' . __( 'Your contact information' ) . '</h2>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should provide a contact method for privacy-specific concerns. If you are required to have a Data Protection Officer, list their name and full contact details here as well.' ) . '</p>';
$content .=
$content .=
'<h2>' . __( 'Additional information' ) . '</h2>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'If you use your site for commercial purposes and you engage in more complex collection or processing of personal data, you should note the following information in your privacy policy in addition to the information we have already discussed.' ) . '</p>';
$content .=
$content .=
'<h3>' . __( 'How we protect your data' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what measures you have taken to protect your users&#8217; data. This could include technical measures such as encryption; security measures such as two factor authentication; and measures such as staff training in data protection. If you have carried out a Privacy Impact Assessment, you can mention it here too.' ) . '</p>';
$content .=
$content .=
'<h3>' . __( 'What data breach procedures we have in place' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'In this section you should explain what procedures you have in place to deal with data breaches, either potential or real, such as internal reporting systems, contact mechanisms, or bug bounties.' ) . '</p>';
$content .=
$content .=
'<h3>' . __( 'What third parties we receive data from' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'If your web site receives data about users from third parties, including advertisers, this information must be included within the section of your privacy policy dealing with third party data.' ) . '</p>';
$content .=
$content .=
'<h3>' . __( 'What automated decision making and/or profiling we do with user data' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'If your web site provides a service which includes automated decision making - for example, allowing customers to apply for credit, or aggregating their data into an advertising profile - you must note that this is taking place, and include information about how that information is used, what decisions are made with that aggregated data, and what rights users have over decisions made without human intervention.' ) . '</p>';
$content .=
$content .=
'<h3>' . __( 'Industry regulatory disclosure requirements' ) . '</h3>';
$descr && $content .=
'<p class="privacy-policy-tutorial">' . __( 'If you are a member of a regulated industry, or if you are subject to additional privacy laws, you may be required to disclose that information here.' ) . '</p>' .

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
}
/**
@ -1065,7 +1065,7 @@ function confirm_delete_users( $users ) {
<td><fieldset><p><legend><?php _e( 'User has no sites or content and will be deleted.' ); ?></legend></p>
<?php } ?>
</tr>
<?php
<?php
}
}
@ -1076,7 +1076,7 @@ function confirm_delete_users( $users ) {
do_action( 'delete_user_form', $current_user, $allusers );
if ( 1 == count( $users ) ) :
?>
?>
<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, the user will be permanently removed.' ); ?></p>
<?php else : ?>
<p><?php _e( 'Once you hit &#8220;Confirm Deletion&#8221;, these users will be permanently removed.' ); ?></p>
@ -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

@ -217,7 +217,7 @@ function network_step1( $errors = false ) {
}
if ( allow_subdomain_install() && allow_subdirectory_install() ) :
?>
?>
<h3><?php esc_html_e( 'Addresses of Sites in your Network' ); ?></h3>
<p><?php _e( 'Please choose whether you would like sites in your WordPress network to use sub-domains or sub-directories.' ); ?>
<strong><?php _e( 'You cannot change this later.' ); ?></strong></p>
@ -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() ) ) {
@ -282,7 +282,7 @@ function network_step1( $errors = false ) {
__( 'The internet address of your network will be %s.' ),
'<code>' . $hostname . '</code>'
);
?>
?>
</td>
</tr>
</table>
@ -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,58 +498,58 @@ define('BLOG_ID_CURRENT_SITE', 1);
'LOGGED_IN_SALT' => '',
'NONCE_SALT' => '',
);
foreach ( $keys_salts as $c => $v ) {
if ( defined( $c ) ) {
unset( $keys_salts[ $c ] );
foreach ( $keys_salts as $c => $v ) {
if ( defined( $c ) ) {
unset( $keys_salts[ $c ] );
}
}
}
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 ) ) {
foreach ( $keys_salts as $c => $v ) {
$keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";
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 ) ) {
foreach ( $keys_salts as $c => $v ) {
$keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";
}
} else {
$from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );
foreach ( $keys_salts as $c => $v ) {
$keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";
}
}
} else {
$from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );
foreach ( $keys_salts as $c => $v ) {
$keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";
}
}
$num_keys_salts = count( $keys_salts );
?>
$num_keys_salts = count( $keys_salts );
?>
<p>
<?php
if ( 1 == $num_keys_salts ) {
printf(
/* translators: %s: wp-config.php */
__( 'This unique authentication key is also missing from your %s file.' ),
'<code>wp-config.php</code>'
);
} else {
printf(
/* translators: %s: wp-config.php */
__( 'These unique authentication keys are also missing from your %s file.' ),
'<code>wp-config.php</code>'
);
}
<?php
if ( 1 == $num_keys_salts ) {
printf(
/* translators: %s: wp-config.php */
__( 'This unique authentication key is also missing from your %s file.' ),
'<code>wp-config.php</code>'
);
} else {
printf(
/* translators: %s: wp-config.php */
__( 'These unique authentication keys are also missing from your %s file.' ),
'<code>wp-config.php</code>'
);
}
?>
<?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() ) :
// 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;
$iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';
<?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;
$iis_subdir_replacement = $subdomain_install ? '' : '{R:1}';
$web_config_file = '<?xml version="1.0" encoding="UTF-8"?>
$web_config_file = '<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
@ -558,13 +558,13 @@ if ( iis7_supports_permalinks() ) :
<match url="^index\.php$" ignoreCase="false" />
<action type="None" />
</rule>';
if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
$web_config_file .= '
if ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) {
$web_config_file .= '
<rule name="WordPress Rule for Files" stopProcessing="true">
<match url="^' . $iis_subdir_match . 'files/(.+)" ignoreCase="false" />
<action type="Rewrite" url="' . $iis_rewrite_base . WPINC . '/ms-files.php?file={R:1}" appendQueryString="false" />
</rule>';
}
}
$web_config_file .= '
<rule name="WordPress Rule 2" stopProcessing="true">
<match url="^' . $iis_subdir_match . 'wp-admin$" ignoreCase="false" />
@ -603,16 +603,16 @@ if ( iis7_supports_permalinks() ) :
'<code>web.config</code>',
'<code>' . $home_path . '</code>'
);
echo '</p>';
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) {
echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
}
?>
echo '</p>';
if ( ! $subdomain_install && WP_CONTENT_DIR != ABSPATH . 'wp-content' ) {
echo '<p><strong>' . __( 'Warning:' ) . ' ' . __( 'Subdirectory networks may not be fully compatible with custom wp-content directories.' ) . '</strong></p>';
}
?>
<textarea class="code" readonly="readonly" cols="100" rows="20"><?php echo esc_textarea( $web_config_file ); ?>
</textarea></li>
</ol>
<?php
<?php
else : // end iis7_supports_permalinks(). construct an htaccess file instead:
$ms_files_rewriting = '';
@ -651,15 +651,15 @@ 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
<?php
endif; // end IIS/Apache code branches.
if ( ! is_multisite() ) {
?>
<p><?php _e( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.' ); ?> <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log In' ); ?></a></p>
<?php
<?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,8 +502,9 @@ function install_plugin_information() {
}
$api = plugins_api(
'plugin_information', array(
'slug' => wp_unslash( $_REQUEST['plugin'] ),
'plugin_information',
array(
'slug' => wp_unslash( $_REQUEST['plugin'] ),
)
);
@ -690,13 +692,13 @@ 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
<?php
}
if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
?>
?>
<h3><?php _e( 'Reviews' ); ?></h3>
<p class="fyi-description"><?php _e( 'Read all reviews on WordPress.org or write your own!' ); ?></p>
<?php
@ -726,7 +728,7 @@ if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
}
}
if ( ! empty( $api->contributors ) ) {
?>
?>
<h3><?php _e( 'Contributors' ); ?></h3>
<ul class="contributors">
<?php
@ -738,7 +740,7 @@ if ( ! empty( $api->contributors ) ) {
$contrib_name = esc_html( $contrib_name );
$contrib_profile = esc_url( $contrib_details['profile'] );
$contrib_avatar = esc_url( add_query_arg( 's', '36', $contrib_details['avatar'] ) );
$contrib_avatar = esc_url( add_query_arg( 's', '36', $contrib_details['avatar'] ) );
echo "<li><a href='{$contrib_profile}' target='_blank'><img src='{$contrib_avatar}' width='18' height='18' alt='' />{$contrib_name}</a></li>";
}

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
);
}
@ -1701,7 +1704,7 @@ function _admin_notice_post_locked() {
<a class="button" href="<?php echo esc_url( $sendback ); ?>"><?php echo $sendback_text; ?></a>
<?php if ( $preview_link ) { ?>
<a class="button<?php echo $tab_last; ?>" href="<?php echo esc_url( $preview_link ); ?>"><?php _e( 'Preview' ); ?></a>
<?php
<?php
}
// Allow plugins to prevent some users overriding the post lock
@ -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

@ -110,7 +110,7 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
if ( ! $diff && 'post_title' === $field ) {
// It's a better user experience to still show the Title, even if it didn't change.
// No, you didn't see this.
$diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
$diff = '<table class="diff"><colgroup><col class="content diffsplit left"><col class="content diffsplit middle"><col class="content diffsplit right"></colgroup><tbody><tr>';
// In split screen mode, show the title before/after side by side.
if ( true === $args['show_split_view'] ) {
@ -124,7 +124,7 @@ function wp_get_revision_ui_diff( $post, $compare_from, $compare_to ) {
}
}
$diff .= '</tr></tbody>';
$diff .= '</tr></tbody>';
$diff .= '</table>';
}
@ -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,
@ -394,7 +397,7 @@ function wp_print_revision_templates() {
__( 'Autosave by %s' ),
'<span class="author-name">{{ data.attributes.author.name }}</span>'
);
?>
?>
</span>
<# } else if ( data.attributes.current ) { #>
<span class="byline">
@ -403,7 +406,7 @@ function wp_print_revision_templates() {
__( 'Current Revision by %s' ),
'<span class="author-name">{{ data.attributes.author.name }}</span>'
);
?>
?>
</span>
<# } else { #>
<span class="byline">
@ -412,7 +415,7 @@ function wp_print_revision_templates() {
__( 'Revision by %s' ),
'<span class="author-name">{{ data.attributes.author.name }}</span>'
);
?>
?>
</span>
<# } #>
<span class="time-ago">{{ data.attributes.timeAgo }}</span>

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,
@ -1082,7 +1084,7 @@ We hope you enjoy your new site. Thanks!
--The Team @ SITE_NAME'
);
$misc_exts = array(
$misc_exts = array(
// Images.
'jpg',
'jpeg',
@ -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 ) {
echo _list_meta_row( $entry, $count );
}
?>
<?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 ) {
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>';
}
?>
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(
'id' => 'newmeta-submit',
'data-wp-lists' => 'add:the-list:newmeta',
)
);
?>
<?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;
}
@ -1243,7 +1256,7 @@ function do_accordion_sections( $screen, $context, $object ) {
$page = $screen->id;
$hidden = get_hidden_meta_boxes( $screen );
$hidden = get_hidden_meta_boxes( $screen );
?>
<div id="side-sortables" class="accordion-container">
<ul class="outer-border">
@ -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() ) {
$admin_body_class .= ' 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
/**
* @global string $body_id
*/
if ( isset( $GLOBALS['body_id'] ) ) {
echo ' id="' . $GLOBALS['body_id'] . '"';
}
?>
<?php
/**
* @global string $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

@ -104,19 +104,19 @@ function install_theme_search_form( $type_selector = true ) {
<option value="tag" <?php selected( 'tag', $type ); ?>><?php _ex( 'Tag', 'Theme Installer' ); ?></option>
</select>
<label class="screen-reader-text" for="s">
<?php
switch ( $type ) {
case 'term':
_e( 'Search by keyword' );
break;
case 'author':
_e( 'Search by author' );
break;
case 'tag':
_e( 'Search by tag' );
break;
}
?>
<?php
switch ( $type ) {
case 'term':
_e( 'Search by keyword' );
break;
case 'author':
_e( 'Search by author' );
break;
case 'tag':
_e( 'Search by tag' );
break;
}
?>
</label>
<?php else : ?>
<label class="screen-reader-text" for="s"><?php _e( 'Search by keyword' ); ?></label>
@ -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(
'ID' => $request_id,
'post_status' => 'request-completed',
) );
$request = wp_update_post(
array(
'ID' => $request_id,
'post_status' => 'request-completed',
)
);
return $request;
}
@ -753,29 +758,33 @@ function _wp_personal_data_handle_actions() {
*/
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 );
$expires = (int) apply_filters( 'user_request_key_expiration', DAY_IN_SECONDS );
$requests_query = new WP_Query( array(
'post_type' => 'user_request',
'posts_per_page' => -1,
'post_status' => 'request-pending',
'fields' => 'ids',
'date_query' => array(
array(
'column' => 'post_modified_gmt',
'before' => $expires . ' seconds ago',
$requests_query = new WP_Query(
array(
'post_type' => 'user_request',
'posts_per_page' => -1,
'post_status' => 'request-pending',
'fields' => 'ids',
'date_query' => array(
array(
'column' => 'post_modified_gmt',
'before' => $expires . ' seconds ago',
),
),
),
) );
)
);
$request_ids = $requests_query->posts;
foreach ( $request_ids as $request_id ) {
wp_update_post( array(
'ID' => $request_id,
'post_status' => 'request-failed',
'post_password' => '',
) );
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(
'plural' => 'privacy_requests',
'singular' => 'privacy_request',
) );
$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(
'plural' => 'privacy_requests',
'singular' => 'privacy_request',
) );
$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();
@ -1013,7 +1026,7 @@ function _wp_privacy_hook_requests_page() {
*/
function _wp_privacy_requests_screen_options() {
$args = array(
'option' => str_replace( 'tools_page_', '', get_current_screen()->id ) . '_requests_per_page',
'option' => str_replace( 'tools_page_', '', get_current_screen()->id ) . '_requests_per_page',
);
add_screen_option( 'per_page', $args );
}
@ -1175,8 +1188,8 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table {
public function process_bulk_action() {
$action = $this->current_action();
$request_ids = isset( $_REQUEST['request_id'] ) ? wp_parse_id_list( wp_unslash( $_REQUEST['request_id'] ) ) : array();
$count = 0;
$count = 0;
if ( $request_ids ) {
check_admin_referer( 'bulk-privacy_requests' );
@ -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(
'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>';
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>';
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(
'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>';
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>';
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

@ -124,7 +124,7 @@ if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) )
if ( $hide ) {
$classes .= ' hidden';
}
?>
?>
<div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
<?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>

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 } ?>
@ -129,7 +129,7 @@ function display_setup_form( $error = null ) {
?>
<input name="user_name" type="text" id="user_login" size="25" value="<?php echo esc_attr( sanitize_user( $user_name, true ) ); ?>" />
<p><?php _e( 'Usernames can have only alphanumeric characters, spaces, underscores, hyphens, periods, and the @ symbol.' ); ?></p>
<?php
<?php
}
?>
</td>
@ -189,7 +189,7 @@ function display_setup_form( $error = null ) {
<legend class="screen-reader-text"><span><?php has_action( 'blog_privacy_selector' ) ? _e( 'Site Visibility' ) : _e( 'Search Engine Visibility' ); ?> </span></legend>
<?php
if ( has_action( 'blog_privacy_selector' ) ) {
?>
?>
<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked( 1, $blog_public ); ?> />
<label for="blog-public"><?php _e( 'Allow search engines to index this site' ); ?></label><br/>
<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked( 0, $blog_public ); ?> />
@ -199,7 +199,7 @@ function display_setup_form( $error = null ) {
/** This action is documented in wp-admin/options-reading.php */
do_action( 'blog_privacy_selector' );
} else {
?>
?>
<label for="blog_public"><input name="blog_public" type="checkbox" id="blog_public" value="0" <?php checked( 0, $blog_public ); ?> />
<?php _e( 'Discourage search engines from indexing this site' ); ?></label>
<p class="description"><?php _e( 'It is up to search engines to honor this request.' ); ?></p>
@ -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>
@ -390,9 +390,9 @@ switch ( $step ) {
<tr>
<th><?php _e( 'Password' ); ?></th>
<td>
<?php
if ( ! empty( $result['password'] ) && empty( $admin_password_check ) ) :
?>
<?php
if ( ! empty( $result['password'] ) && empty( $admin_password_check ) ) :
?>
<code><?php echo esc_html( $result['password'] ); ?></code><br />
<?php endif ?>
<p><?php echo $result['password_message']; ?></p>
@ -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

@ -113,18 +113,18 @@ switch ( $action ) {
echo "<div id='message' class='$class'><p>$message</p></div>\n";
}
?>
?>
<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 } ?>
@ -132,39 +132,40 @@ if ( current_user_can( 'upload_files' ) ) {
<form method="post" class="media-upload-form" id="media-single-form">
<p class="submit" style="padding-bottom: 0;">
<?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?>
<?php submit_button( __( 'Update Media' ), 'primary', 'save', false ); ?>
</p>
<div class="media-single">
<div id="media-item-<?php echo $att_id; ?>" class="media-item">
<?php
echo get_media_item(
$att_id, array(
'toggle' => false,
'send' => false,
'delete' => false,
'show_title' => false,
'errors' => ! empty( $errors[ $att_id ] ) ? $errors[ $att_id ] : null,
)
);
?>
<?php
echo get_media_item(
$att_id,
array(
'toggle' => false,
'send' => false,
'delete' => false,
'show_title' => false,
'errors' => ! empty( $errors[ $att_id ] ) ? $errors[ $att_id ] : null,
)
);
?>
</div>
</div>
<?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?>
<?php submit_button( __( 'Update Media' ), 'primary', 'save' ); ?>
<input type="hidden" name="post_id" id="post_id" value="<?php echo isset( $post_id ) ? esc_attr( $post_id ) : ''; ?>" />
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr( $att_id ); ?>" />
<input type="hidden" name="action" value="editattachment" />
<?php wp_original_referer_field( true, 'previous' ); ?>
<?php wp_nonce_field( 'media-form' ); ?>
<?php wp_original_referer_field( true, 'previous' ); ?>
<?php wp_nonce_field( 'media-form' ); ?>
</form>
</div>
<?php
<?php
require( ABSPATH . 'wp-admin/admin-footer.php' );
require( ABSPATH . 'wp-admin/admin-footer.php' );
exit;

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' )
@ -652,7 +653,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
} else {
echo '<p>' . sprintf( _n( 'Your theme supports %s menu. Select which menu appears in each location.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n( $num_locations ) ) . '</p>';
}
?>
?>
<div id="menu-locations-wrap">
<form method="post" action="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>">
<table class="widefat fixed" id="menu-locations-table">
@ -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' )
)
);
?>
@ -729,30 +732,32 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<input type="hidden" name="menu" id="nav-menu-meta-object-id" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" />
</form>
</div><!-- #menu-locations-wrap -->
<?php
/**
* Fires after the menu locations table is displayed.
*
* @since 3.6.0
*/
do_action( 'after_menu_locations_table' );
?>
<?php
/**
* Fires after the menu locations table is displayed.
*
* @since 3.6.0
*/
do_action( 'after_menu_locations_table' );
?>
<?php else : ?>
<div class="manage-menus">
<?php if ( $menu_count < 2 ) : ?>
<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'] ) {
$metabox_holder_disabled_class = ' metabox-holder-disabled';
}
?>
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; ?>">
@ -843,9 +850,9 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<form id="update-nav-menu" method="post" enctype="multipart/form-data">
<?php
$new_screen_class = '';
if ( $add_new_screen ) {
$new_screen_class = 'blank-slate';
}
if ( $add_new_screen ) {
$new_screen_class = 'blank-slate';
}
?>
<h2><?php _e( 'Menu structure' ); ?></h2>
<div class="menu-edit <?php echo $new_screen_class; ?>">
@ -859,9 +866,9 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
if ( $one_theme_location_no_menus ) {
$menu_name_val = 'value="' . esc_attr( 'Menu 1' ) . '"';
?>
?>
<input type="hidden" name="zero-menu-state" value="true" />
<?php
<?php
} else {
$menu_name_val = 'value="' . esc_attr( $nav_menu_selected_title ) . '"';
}
@ -880,37 +887,37 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<div id="post-body">
<div id="post-body-content" class="wp-clearfix">
<?php if ( ! $add_new_screen ) : ?>
<?php
<?php
$hide_style = '';
if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
$hide_style = 'style="display: none;"';
}
if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
$hide_style = 'style="display: none;"';
}
$starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' );
?>
?>
<div class="drag-instructions post-body-plain" <?php echo $hide_style; ?>>
<p><?php echo $starter_copy; ?></p>
</div>
<?php
if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) {
echo $edit_markup;
} else {
?>
<?php
if ( isset( $edit_markup ) && ! is_wp_error( $edit_markup ) ) {
echo $edit_markup;
} else {
?>
<ul class="menu" id="menu-to-edit"></ul>
<?php } ?>
<?php } ?>
<?php endif; ?>
<?php if ( $add_new_screen ) : ?>
<p class="post-body-plain" id="menu-name-desc"><?php _e( 'Give your menu a name, then click Create Menu.' ); ?></p>
<?php if ( isset( $_GET['use-location'] ) ) : ?>
<input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
<?php endif; ?>
<?php
<?php
endif;
$no_menus_style = '';
if ( $one_theme_location_no_menus ) {
$no_menus_style = 'style="display: none;"';
}
?>
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

@ -166,7 +166,7 @@ if ( isset( $_GET['updated'] ) ) {
<?php
$new_admin_email = get_site_option( 'new_admin_email' );
if ( $new_admin_email && $new_admin_email != get_site_option( 'admin_email' ) ) :
?>
?>
<div class="updated inline">
<p>
<?php
@ -388,7 +388,7 @@ if ( isset( $_GET['updated'] ) ) {
__( '%s KB' ),
'<input name="fileupload_maxk" type="number" min="0" style="width: 100px" id="fileupload_maxk" aria-describedby="fileupload-maxk-desc" value="' . esc_attr( get_site_option( 'fileupload_maxk', 300 ) ) . '" />'
);
?>
?>
<p class="screen-reader-text" id="fileupload-maxk-desc">
<?php _e( 'Size in kilobytes' ); ?>
</p>

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;
@ -155,15 +156,15 @@ if ( ! empty( $messages ) ) {
<?php
// The main site of the network should not be updated on this page.
if ( $is_main_site ) :
?>
?>
<tr class="form-field">
<th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
<td><?php echo esc_url( $parsed_scheme . '://' . $details->domain . $details->path ); ?></td>
</tr>
<?php
// For any other site, the scheme, domain, and path can all be changed.
<?php
// For any other site, the scheme, domain, and path can all be changed.
else :
?>
?>
<tr class="form-field form-required">
<th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
<td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>

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">
@ -227,15 +230,15 @@ printf(
<td>
<?php if ( is_subdomain_install() ) { ?>
<input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
<?php
<?php
} else {
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;
@ -138,14 +139,14 @@ if ( ! empty( $messages ) ) {
}
}
if ( strpos( $option->option_value, "\n" ) !== false ) {
?>
?>
<tr class="form-field">
<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>"><?php echo ucwords( str_replace( '_', ' ', $option->option_name ) ); ?></label></th>
<td><textarea class="<?php echo $class; ?>" rows="5" cols="40" name="option[<?php echo esc_attr( $option->option_name ); ?>]" id="<?php echo esc_attr( $option->option_name ); ?>"<?php disabled( $disabled ); ?>><?php echo esc_textarea( $option->option_value ); ?></textarea></td>
</tr>
<?php
<?php
} else {
?>
?>
<tr class="form-field">
<th scope="row"><label for="<?php echo esc_attr( $option->option_name ); ?>"><?php echo esc_html( ucwords( str_replace( '_', ' ', $option->option_name ) ) ); ?></label></th>
<?php if ( $is_main_site && in_array( $option->option_name, array( 'siteurl', 'home' ) ) ) { ?>
@ -154,7 +155,7 @@ if ( ! empty( $messages ) ) {
<td><input class="<?php echo $class; ?>" name="option[<?php echo esc_attr( $option->option_name ); ?>]" type="text" id="<?php echo esc_attr( $option->option_name ); ?>" value="<?php echo esc_attr( $option->option_value ); ?>" size="40" <?php disabled( $disabled ); ?> /></td>
<?php } ?>
</tr>
<?php
<?php
}
} // End foreach
/**

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,
@ -131,7 +132,7 @@ switch ( $action ) {
case 'show':
default:
if ( get_site_option( 'wpmu_upgrade_site' ) != $GLOBALS['wp_db_version'] ) :
?>
?>
<h2><?php _e( 'Database Update Required' ); ?></h2>
<p><?php _e( 'WordPress has been updated! Before we send you on your way, we need to individually upgrade the sites in your network.' ); ?></p>
<?php endif; ?>

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,13 +247,13 @@ 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>
<?php
if ( current_user_can( 'create_users' ) ) :
?>
?>
<a href="<?php echo network_admin_url( 'user-new.php' ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<?php
endif;

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
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' )
);
?>
<?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();
@ -241,7 +241,7 @@ if ( empty( $tzstring ) ) { // Create a UTC+- zone if no timezone string exists
'<abbr>' . __( 'UTC' ) . '</abbr>',
'<code>' . date_i18n( $timezone_format, false, true ) . '</code>'
);
?>
?>
</span>
<?php if ( get_option( 'timezone_string' ) || ! empty( $current_offset ) ) : ?>
<span id="local-time">

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
/* translators: %s: wp-content/uploads */
printf( __( 'Default is %s' ), '<code>wp-content/uploads</code>' );
?>
<?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

@ -176,7 +176,7 @@ require( ABSPATH . 'wp-admin/admin-header.php' );
__( 'WordPress offers you the ability to create a custom URL structure for your permalinks and archives. Custom URL structures can improve the aesthetics, usability, and forward-compatibility of your links. A <a href="%s">number of tags are available</a>, and here are some examples to get you started.' ),
__( 'https://codex.wordpress.org/Using_Permalinks' )
);
?>
?>
</p>
<?php
@ -317,39 +317,39 @@ 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 ) :
if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
if ( file_exists( $home_path . 'web.config' ) ) :
?>
<?php
if ( $iis7_permalinks ) :
if ( isset( $_POST['submit'] ) && $permalink_structure && ! $using_index_permalinks && ! $writable ) :
if ( file_exists( $home_path . 'web.config' ) ) :
?>
<p>
<?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.' ),
'<code>web.config</code>',
__( 'https://codex.wordpress.org/Changing_File_Permissions' ),
'<kbd>CTRL + a</kbd>',
'<code>/&lt;configuration&gt;/&lt;system.webServer&gt;/&lt;rewrite&gt;/&lt;rules&gt;</code>'
);
?>
<?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.' ),
'<code>web.config</code>',
__( 'https://codex.wordpress.org/Changing_File_Permissions' ),
'<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
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>'
);
?>
<?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,42 +357,42 @@ 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
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.' ),
'<code>.htaccess</code>',
__( 'https://codex.wordpress.org/Changing_File_Permissions' ),
'<kbd>CTRL + a</kbd>'
);
?>
<?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.' ),
'<code>.htaccess</code>',
__( '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,16 +62,16 @@ 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' ) ) :
update_option( 'show_on_front', 'posts' );
<?php
if ( 'posts' != get_option( 'show_on_front' ) ) :
update_option( 'show_on_front', 'posts' );
endif;
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,22 +107,22 @@ 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(
array(
'hide_empty' => 0,
'name' => 'default_link_category',
'orderby' => 'name',
'selected' => get_option( 'default_link_category' ),
'hierarchical' => true,
'taxonomy' => 'link_category',
)
);
?>
<?php
wp_dropdown_categories(
array(
'hide_empty' => 0,
'name' => 'default_link_category',
'orderby' => 'name',
'selected' => get_option( 'default_link_category' ),
'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(
/* 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 ) )
);
?>
<?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,20 +171,20 @@ printf(
<tr>
<th scope="row"><label for="default_email_category"><?php _e( 'Default Mail Category' ); ?></label></th>
<td>
<?php
wp_dropdown_categories(
array(
'hide_empty' => 0,
'name' => 'default_email_category',
'orderby' => 'name',
'selected' => get_option( 'default_email_category' ),
'hierarchical' => true,
)
);
?>
<?php
wp_dropdown_categories(
array(
'hide_empty' => 0,
'name' => 'default_email_category',
'orderby' => 'name',
'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,37 +197,37 @@ 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
<?php
printf(
/* translators: %s: Codex URL */
__( 'When you publish a new post, WordPress automatically notifies the following site update services. For more about this, see <a href="%s">Update Services</a> on the Codex. Separate multiple service URLs with line breaks.' ),
__( 'https://codex.wordpress.org/Update_Services' )
);
?>
?>
</label></p>
<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
<?php
printf(
/* translators: 1: Codex URL, 2: Reading Settings URL */
__( 'WordPress is not notifying any <a href="%1$s">Update Services</a> because of your site&#8217;s <a href="%2$s">visibility settings</a>.' ),
__( 'https://codex.wordpress.org/Update_Services' ),
'options-reading.php'
);
?>
?>
</p>
<?php endif; ?>
<?php endif; ?>
<?php } // enable_update_services_configuration ?>
<?php do_settings_sections( 'writing' ); ?>

View File

@ -80,8 +80,8 @@ if ( is_multisite() && ! current_user_can( 'manage_network_options' ) && 'update
);
}
$whitelist_options = array(
'general' => array(
$whitelist_options = array(
'general' => array(
'blogname',
'blogdescription',
'gmt_offset',
@ -118,7 +118,7 @@ $whitelist_options = array(
'comment_registration',
'show_comments_cookies_opt_in',
),
'media' => array(
'media' => array(
'thumbnail_size_w',
'thumbnail_size_h',
'thumbnail_crop',
@ -130,7 +130,7 @@ $whitelist_options = array(
'image_default_align',
'image_default_link_type',
),
'reading' => array(
'reading' => array(
'posts_per_page',
'posts_per_rss',
'rss_use_excerpt',
@ -139,7 +139,7 @@ $whitelist_options = array(
'page_for_posts',
'blog_public',
),
'writing' => array(
'writing' => array(
'default_category',
'default_email_category',
'default_link_category',
@ -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,15 +492,16 @@ 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>
<?php
<?php
}
?>
</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

@ -58,7 +58,7 @@ if ( ! empty( $action ) ) {
}
$privacy_policy_page_content = WP_Privacy_Policy_Content::get_default_content();
$privacy_policy_page_id = wp_insert_post(
$privacy_policy_page_id = wp_insert_post(
array(
'post_title' => __( 'Privacy Policy' ),
'post_status' => 'draft',
@ -195,16 +195,19 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
</th>
<td>
<?php
$has_pages = (bool) get_posts( array(
'post_type' => 'page',
'posts_per_page' => 1,
'post_status' => array(
'publish',
'draft',
),
) );
$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,35 +165,35 @@ switch ( $step ) {
<li><?php _e( 'Table prefix (if you want to run more than one WordPress in a single database)' ); ?></li>
</ol>
<p>
<?php
/* translators: %s: wp-config.php */
printf(
__( 'We&#8217;re going to use this information to create a %s file.' ),
'<code>wp-config.php</code>'
);
?>
<?php
/* translators: %s: wp-config.php */
printf(
__( 'We&#8217;re going to use this information to create a %s file.' ),
'<code>wp-config.php</code>'
);
?>
<strong>
<?php
<?php
/* translators: 1: wp-config-sample.php, 2: wp-config.php */
printf(
__( 'If for any reason this automatic file creation doesn&#8217;t work, don&#8217;t worry. All this does is fill in the database information to a configuration file. You may also simply open %1$s in a text editor, fill in your information, and save it as %2$s.' ),
'<code>wp-config-sample.php</code>',
'<code>wp-config.php</code>'
);
?>
?>
</strong>
<?php
/* translators: %s: Codex URL */
printf(
__( 'Need more help? <a href="%s">We got it</a>.' ),
__( 'https://codex.wordpress.org/Editing_wp-config.php' )
);
?>
<?php
/* translators: %s: Codex URL */
printf(
__( '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:
@ -201,7 +201,7 @@ switch ( $step ) {
$GLOBALS['wp_locale'] = new WP_Locale();
setup_config_display_header();
?>
?>
<h1 class="screen-reader-text"><?php _e( 'Set up your database connection' ); ?></h1>
<form method="post" action="setup-config.php?step=2">
<p><?php _e( 'Below you should enter your database connection details. If you&#8217;re not sure about these, contact your host.' ); ?></p>
@ -237,14 +237,14 @@ switch ( $step ) {
<td><?php _e( 'If you want to run multiple WordPress installations in a single database, change this.' ); ?></td>
</tr>
</table>
<?php
if ( isset( $_GET['noapi'] ) ) {
?>
<?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:
@ -387,24 +387,24 @@ switch ( $step ) {
if ( ! is_writable( ABSPATH ) ) :
setup_config_display_header();
?>
?>
<p>
<?php
/* translators: %s: wp-config.php */
printf( __( 'Sorry, but I can&#8217;t write the %s file.' ), '<code>wp-config.php</code>' );
?>
<?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
/* 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>' );
<?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>' );
$config_text = '';
$config_text = '';
foreach ( $config_file as $line ) {
$config_text .= htmlentities( $line, ENT_COMPAT, 'UTF-8' );
}
?>
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>
@ -296,7 +296,7 @@ else :
<p>
<?php
if ( is_writeable( $file ) ) {
?>
?>
<strong><?php _e( 'Caution:' ); ?></strong><?php } ?>
<?php _e( 'This is a file in your current parent theme.' ); ?>
</p>
@ -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'] ) ) {
?>
@ -184,11 +186,11 @@ elseif ( isset( $_GET['activated'] ) ) :
<?php
}
elseif ( isset( $_GET['deleted'] ) ) :
?>
?>
<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(
'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>' .
'<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()->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>' .
'<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,14 +54,15 @@ 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
<?php
endif;
endif;

View File

@ -136,7 +136,7 @@ function dismissed_updates() {
$show_text = esc_js( __( 'Show hidden updates' ) );
$hide_text = esc_js( __( 'Hide hidden updates' ) );
?>
?>
<script type="text/javascript">
jQuery(function( $ ) {
$( 'dismissed-updates' ).show();
@ -144,14 +144,14 @@ function dismissed_updates() {
$( '#show-dismissed' ).click( function() { $( '#dismissed-updates' ).toggle( 'fast' ); } );
});
</script>
<?php
<?php
echo '<p class="hide-if-no-js"><button type="button" class="button" id="show-dismissed" aria-expanded="false">' . __( 'Show hidden updates' ) . '</button></p>';
echo '<ul id="dismissed-updates" class="core-updates dismissed">';
foreach ( (array) $dismissed as $update ) {
echo '<li>';
list_core_update( $update );
echo '</li>';
}
foreach ( (array) $dismissed as $update ) {
echo '<li>';
list_core_update( $update );
echo '</li>';
}
echo '</ul>';
}
}
@ -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,52 +260,52 @@ function list_plugin_updates() {
</thead>
<tbody class="plugins">
<?php
foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
$plugin_data = (object) _get_plugin_data_markup_translate( $plugin_file, (array) $plugin_data, false, true );
<?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>';
$preferred_icons = array( 'svg', '2x', '1x', 'default' );
foreach ( $preferred_icons as $preferred_icon ) {
if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {
$icon = '<img src="' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '" alt="" />';
break;
$icon = '<span class="dashicons dashicons-admin-plugins"></span>';
$preferred_icons = array( 'svg', '2x', '1x', 'default' );
foreach ( $preferred_icons as $preferred_icon ) {
if ( ! empty( $plugin_data->update->icons[ $preferred_icon ] ) ) {
$icon = '<img src="' . esc_url( $plugin_data->update->icons[ $preferred_icon ] ) . '" alt="" />';
break;
}
}
}
// Get plugin compat for running version of WordPress.
if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $cur_wp_version, '>=' ) ) {
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $cur_wp_version );
} else {
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $cur_wp_version );
}
// Get plugin compat for updated version of WordPress.
if ( $core_update_version ) {
if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) {
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $core_update_version );
// Get plugin compat for running version of WordPress.
if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $cur_wp_version, '>=' ) ) {
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $cur_wp_version );
} else {
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $core_update_version );
$compat = '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $cur_wp_version );
}
// Get plugin compat for updated version of WordPress.
if ( $core_update_version ) {
if ( isset( $plugin_data->update->tested ) && version_compare( $plugin_data->update->tested, $core_update_version, '>=' ) ) {
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: 100%% (according to its author)' ), $core_update_version );
} else {
$compat .= '<br />' . sprintf( __( 'Compatibility with WordPress %1$s: Unknown' ), $core_update_version );
}
}
// Get the upgrade notice for the new plugin version.
if ( isset( $plugin_data->update->upgrade_notice ) ) {
$upgrade_notice = '<br />' . strip_tags( $plugin_data->update->upgrade_notice );
} else {
$upgrade_notice = '';
}
}
// Get the upgrade notice for the new plugin version.
if ( isset( $plugin_data->update->upgrade_notice ) ) {
$upgrade_notice = '<br />' . strip_tags( $plugin_data->update->upgrade_notice );
} else {
$upgrade_notice = '';
}
$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&section=changelog&TB_iframe=true&width=640&height=662' );
$details = sprintf(
'<a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">%3$s</a>',
esc_url( $details_url ),
/* translators: 1: plugin name, 2: version number */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_data->Name, $plugin_data->update->new_version ) ),
/* translators: %s: plugin version */
sprintf( __( 'View version %s details.' ), $plugin_data->update->new_version )
);
$details_url = self_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data->update->slug . '&section=changelog&TB_iframe=true&width=640&height=662' );
$details = sprintf(
'<a href="%1$s" class="thickbox open-plugin-details-modal" aria-label="%2$s">%3$s</a>',
esc_url( $details_url ),
/* translators: 1: plugin name, 2: version number */
esc_attr( sprintf( __( 'View %1$s version %2$s details' ), $plugin_data->Name, $plugin_data->update->new_version ) ),
/* translators: %s: plugin version */
sprintf( __( 'View version %s details.' ), $plugin_data->update->new_version )
);
$checkbox_id = 'checkbox_' . md5( $plugin_data->Name );
?>
$checkbox_id = 'checkbox_' . md5( $plugin_data->Name );
?>
<tr>
<td class="check-column">
<input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $plugin_file ); ?>" />
@ -320,7 +320,7 @@ foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
</label>
</td>
<td class="plugin-title"><p>
<?php echo $icon; ?>
<?php echo $icon; ?>
<strong><?php echo $plugin_data->Name; ?></strong>
<?php
/* translators: 1: plugin version, 2: new version */
@ -329,13 +329,13 @@ foreach ( (array) $plugins as $plugin_file => $plugin_data ) {
$plugin_data->Version,
$plugin_data->update->new_version
);
echo ' ' . $details . $compat . $upgrade_notice;
?>
echo ' ' . $details . $compat . $upgrade_notice;
?>
</p></td>
</tr>
<?php
}
?>
<?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,10 +378,10 @@ function list_theme_updates() {
</thead>
<tbody class="plugins">
<?php
foreach ( $themes as $stylesheet => $theme ) {
$checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );
?>
<?php
foreach ( $themes as $stylesheet => $theme ) {
$checkbox_id = 'checkbox_' . md5( $theme->get( 'Name' ) );
?>
<tr>
<td class="check-column">
<input type="checkbox" name="checked[]" id="<?php echo $checkbox_id; ?>" value="<?php echo esc_attr( $stylesheet ); ?>" />
@ -405,12 +405,12 @@ foreach ( $themes as $stylesheet => $theme ) {
$theme->display( 'Version' ),
$theme->update['new_version']
);
?>
?>
</p></td>
</tr>
<?php
}
?>
<?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 ) ) ) {
echo '</div>';
return;
}
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() ) {
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) {
show_message( $message );
if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ) ) ) {
echo '</div>';
return;
}
echo '</div>';
return;
}
if ( $reinstall ) {
$update->response = 'reinstall';
}
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() ) {
foreach ( $wp_filesystem->errors->get_error_messages() as $message ) {
show_message( $message );
}
echo '</div>';
return;
}
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 ) ) {
show_message( $result );
if ( 'up_to_date' != $result->get_error_code() && 'locked' != $result->get_error_code() ) {
show_message( __( 'Installation Failed' ) );
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;
}
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,

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