The keyword `elseif` should be used instead of `else if` so that all control keywords look like single words.
This was a mess, is now standardized across the codebase, except for a few 3rd-party libs. See #30799. Built from https://develop.svn.wordpress.org/trunk@31090 git-svn-id: http://core.svn.wordpress.org/trunk@31071 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
a4ed093250
commit
60b0cd7943
|
@ -167,12 +167,13 @@ if ( isset($plugin_page) ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$hook_suffix = '';
|
$hook_suffix = '';
|
||||||
if ( isset($page_hook) )
|
if ( isset( $page_hook ) ) {
|
||||||
$hook_suffix = $page_hook;
|
$hook_suffix = $page_hook;
|
||||||
else if ( isset($plugin_page) )
|
} elseif ( isset( $plugin_page ) ) {
|
||||||
$hook_suffix = $plugin_page;
|
$hook_suffix = $plugin_page;
|
||||||
else if ( isset($pagenow) )
|
} elseif ( isset( $pagenow ) ) {
|
||||||
$hook_suffix = $pagenow;
|
$hook_suffix = $pagenow;
|
||||||
|
}
|
||||||
|
|
||||||
set_current_screen();
|
set_current_screen();
|
||||||
|
|
||||||
|
@ -243,7 +244,7 @@ if ( isset($plugin_page) ) {
|
||||||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||||
|
|
||||||
exit();
|
exit();
|
||||||
} else if (isset($_GET['import'])) {
|
} elseif ( isset( $_GET['import'] ) ) {
|
||||||
|
|
||||||
$importer = $_GET['import'];
|
$importer = $_GET['import'];
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ $title = $tax->labels->name;
|
||||||
if ( 'post' != $post_type ) {
|
if ( 'post' != $post_type ) {
|
||||||
$parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
|
$parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type";
|
||||||
$submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type";
|
$submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type";
|
||||||
} else if ( 'link_category' == $tax->name ) {
|
} elseif ( 'link_category' == $tax->name ) {
|
||||||
$parent_file = 'link-manager.php';
|
$parent_file = 'link-manager.php';
|
||||||
$submenu_file = 'edit-tags.php?taxonomy=link_category';
|
$submenu_file = 'edit-tags.php?taxonomy=link_category';
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -60,7 +60,7 @@ if ( isset( $_GET['download'] ) ) {
|
||||||
|
|
||||||
if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
|
if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
|
||||||
$args['content'] = 'all';
|
$args['content'] = 'all';
|
||||||
} else if ( 'posts' == $_GET['content'] ) {
|
} elseif ( 'posts' == $_GET['content'] ) {
|
||||||
$args['content'] = 'post';
|
$args['content'] = 'post';
|
||||||
|
|
||||||
if ( $_GET['cat'] )
|
if ( $_GET['cat'] )
|
||||||
|
@ -76,7 +76,7 @@ if ( isset( $_GET['download'] ) ) {
|
||||||
|
|
||||||
if ( $_GET['post_status'] )
|
if ( $_GET['post_status'] )
|
||||||
$args['status'] = $_GET['post_status'];
|
$args['status'] = $_GET['post_status'];
|
||||||
} else if ( 'pages' == $_GET['content'] ) {
|
} elseif ( 'pages' == $_GET['content'] ) {
|
||||||
$args['content'] = 'page';
|
$args['content'] = 'page';
|
||||||
|
|
||||||
if ( $_GET['page_author'] )
|
if ( $_GET['page_author'] )
|
||||||
|
|
|
@ -422,10 +422,11 @@ function _wp_ajax_add_hierarchical_term() {
|
||||||
continue;
|
continue;
|
||||||
if ( !$cat_id = term_exists( $cat_name, $taxonomy->name, $parent ) )
|
if ( !$cat_id = term_exists( $cat_name, $taxonomy->name, $parent ) )
|
||||||
$cat_id = wp_insert_term( $cat_name, $taxonomy->name, array( 'parent' => $parent ) );
|
$cat_id = wp_insert_term( $cat_name, $taxonomy->name, array( 'parent' => $parent ) );
|
||||||
if ( is_wp_error( $cat_id ) )
|
if ( is_wp_error( $cat_id ) ) {
|
||||||
continue;
|
continue;
|
||||||
else if ( is_array( $cat_id ) )
|
} elseif ( is_array( $cat_id ) ) {
|
||||||
$cat_id = $cat_id['term_id'];
|
$cat_id = $cat_id['term_id'];
|
||||||
|
}
|
||||||
$checked_categories[] = $cat_id;
|
$checked_categories[] = $cat_id;
|
||||||
if ( $parent ) // Do these all at once in a second
|
if ( $parent ) // Do these all at once in a second
|
||||||
continue;
|
continue;
|
||||||
|
@ -741,10 +742,11 @@ function wp_ajax_add_link_category( $action ) {
|
||||||
continue;
|
continue;
|
||||||
if ( !$cat_id = term_exists( $cat_name, 'link_category' ) )
|
if ( !$cat_id = term_exists( $cat_name, 'link_category' ) )
|
||||||
$cat_id = wp_insert_term( $cat_name, 'link_category' );
|
$cat_id = wp_insert_term( $cat_name, 'link_category' );
|
||||||
if ( is_wp_error( $cat_id ) )
|
if ( is_wp_error( $cat_id ) ) {
|
||||||
continue;
|
continue;
|
||||||
else if ( is_array( $cat_id ) )
|
} elseif ( is_array( $cat_id ) ) {
|
||||||
$cat_id = $cat_id['term_id'];
|
$cat_id = $cat_id['term_id'];
|
||||||
|
}
|
||||||
$cat_name = esc_html( $cat_name );
|
$cat_name = esc_html( $cat_name );
|
||||||
$x->add( array(
|
$x->add( array(
|
||||||
'what' => 'link-category',
|
'what' => 'link-category',
|
||||||
|
@ -1174,7 +1176,7 @@ function wp_ajax_add_meta() {
|
||||||
} else {
|
} else {
|
||||||
wp_die( 0 );
|
wp_die( 0 );
|
||||||
}
|
}
|
||||||
} else if ( !$mid = add_meta( $pid ) ) {
|
} elseif ( ! $mid = add_meta( $pid ) ) {
|
||||||
wp_die( __( 'Please provide a custom field value.' ) );
|
wp_die( __( 'Please provide a custom field value.' ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -447,10 +447,11 @@ class WP_Comments_List_Table extends WP_List_Table {
|
||||||
|
|
||||||
// Not looking at all comments.
|
// Not looking at all comments.
|
||||||
if ( $comment_status && 'all' != $comment_status ) {
|
if ( $comment_status && 'all' != $comment_status ) {
|
||||||
if ( 'approved' == $the_comment_status )
|
if ( 'approved' == $the_comment_status ) {
|
||||||
$actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
$actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||||
else if ( 'unapproved' == $the_comment_status )
|
} elseif ( 'unapproved' == $the_comment_status ) {
|
||||||
$actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
$actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
$actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>';
|
||||||
$actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
$actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>';
|
||||||
|
|
|
@ -273,14 +273,14 @@ function get_cli_args( $param, $required = false ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_arg = $key;
|
$last_arg = $key;
|
||||||
} else if ( (bool) preg_match( "/^-([a-zA-Z0-9]+)/", $args[$i], $match ) ) {
|
} elseif ( (bool) preg_match( "/^-([a-zA-Z0-9]+)/", $args[$i], $match ) ) {
|
||||||
for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) {
|
for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) {
|
||||||
$key = $match[1]{$j};
|
$key = $match[1]{$j};
|
||||||
$out[$key] = true;
|
$out[$key] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$last_arg = $key;
|
$last_arg = $key;
|
||||||
} else if ( $last_arg !== null ) {
|
} elseif ( $last_arg !== null ) {
|
||||||
$out[$last_arg] = $args[$i];
|
$out[$last_arg] = $args[$i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -447,12 +447,13 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
|
||||||
unset( $install_actions['activate_plugin'] );
|
unset( $install_actions['activate_plugin'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 'import' == $from )
|
if ( 'import' == $from ) {
|
||||||
$install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>';
|
$install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>';
|
||||||
else if ( $this->type == 'web' )
|
} elseif ( $this->type == 'web' ) {
|
||||||
$install_actions['plugins_page'] = '<a href="' . self_admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
|
$install_actions['plugins_page'] = '<a href="' . self_admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>';
|
||||||
else
|
} else {
|
||||||
$install_actions['plugins_page'] = '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
|
$install_actions['plugins_page'] = '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>';
|
||||||
|
}
|
||||||
|
|
||||||
if ( ! $this->result || is_wp_error($this->result) ) {
|
if ( ! $this->result || is_wp_error($this->result) ) {
|
||||||
unset( $install_actions['activate_plugin'], $install_actions['network_activate'] );
|
unset( $install_actions['activate_plugin'], $install_actions['network_activate'] );
|
||||||
|
@ -731,13 +732,13 @@ class Automatic_Upgrader_Skin extends WP_Upgrader_Skin {
|
||||||
* @param string|array|WP_Error $data
|
* @param string|array|WP_Error $data
|
||||||
*/
|
*/
|
||||||
public function feedback( $data ) {
|
public function feedback( $data ) {
|
||||||
if ( is_wp_error( $data ) )
|
if ( is_wp_error( $data ) ) {
|
||||||
$string = $data->get_error_message();
|
$string = $data->get_error_message();
|
||||||
else if ( is_array( $data ) )
|
} elseif ( is_array( $data ) ) {
|
||||||
return;
|
return;
|
||||||
else
|
} else {
|
||||||
$string = $data;
|
$string = $data;
|
||||||
|
}
|
||||||
if ( ! empty( $this->upgrader->strings[ $string ] ) )
|
if ( ! empty( $this->upgrader->strings[ $string ] ) )
|
||||||
$string = $this->upgrader->strings[ $string ];
|
$string = $this->upgrader->strings[ $string ];
|
||||||
|
|
||||||
|
|
|
@ -431,7 +431,7 @@ class WP_Upgrader {
|
||||||
|
|
||||||
if ( is_wp_error($removed) ) {
|
if ( is_wp_error($removed) ) {
|
||||||
return $removed;
|
return $removed;
|
||||||
} else if ( ! $removed ) {
|
} elseif ( ! $removed ) {
|
||||||
return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
|
return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
|
||||||
}
|
}
|
||||||
} elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists($remote_destination) ) {
|
} elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists($remote_destination) ) {
|
||||||
|
@ -637,7 +637,7 @@ class WP_Upgrader {
|
||||||
$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
|
$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
|
||||||
$wp_filesystem->delete($file);
|
$wp_filesystem->delete($file);
|
||||||
$wp_filesystem->put_contents($file, $maintenance_string, FS_CHMOD_FILE);
|
$wp_filesystem->put_contents($file, $maintenance_string, FS_CHMOD_FILE);
|
||||||
} else if ( !$enable && $wp_filesystem->exists($file) ) {
|
} elseif ( ! $enable && $wp_filesystem->exists( $file ) ) {
|
||||||
$this->skin->feedback('maintenance_end');
|
$this->skin->feedback('maintenance_end');
|
||||||
$wp_filesystem->delete($file);
|
$wp_filesystem->delete($file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ function export_wp( $args = array() ) {
|
||||||
$cat = get_term( $term['term_id'], 'category' );
|
$cat = get_term( $term['term_id'], 'category' );
|
||||||
$cats = array( $cat->term_id => $cat );
|
$cats = array( $cat->term_id => $cat );
|
||||||
unset( $term, $cat );
|
unset( $term, $cat );
|
||||||
} else if ( 'all' == $args['content'] ) {
|
} elseif ( 'all' == $args['content'] ) {
|
||||||
$categories = (array) get_categories( array( 'get' => 'all' ) );
|
$categories = (array) get_categories( array( 'get' => 'all' ) );
|
||||||
$tags = (array) get_tags( array( 'get' => 'all' ) );
|
$tags = (array) get_tags( array( 'get' => 'all' ) );
|
||||||
|
|
||||||
|
|
|
@ -929,7 +929,7 @@ function get_filesystem_method( $args = array(), $context = false, $allow_relaxe
|
||||||
// this means it's safe to modify & create new files via PHP.
|
// this means it's safe to modify & create new files via PHP.
|
||||||
$method = 'direct';
|
$method = 'direct';
|
||||||
$GLOBALS['_wp_filesystem_direct_method'] = 'file_owner';
|
$GLOBALS['_wp_filesystem_direct_method'] = 'file_owner';
|
||||||
} else if ( $allow_relaxed_file_ownership ) {
|
} elseif ( $allow_relaxed_file_ownership ) {
|
||||||
// The $context directory is writable, and $allow_relaxed_file_ownership is set, this means we can modify files
|
// The $context directory is writable, and $allow_relaxed_file_ownership is set, this means we can modify files
|
||||||
// safely in this directory. This mode doesn't create new files, only alter existing ones.
|
// safely in this directory. This mode doesn't create new files, only alter existing ones.
|
||||||
$method = 'direct';
|
$method = 'direct';
|
||||||
|
@ -1038,15 +1038,15 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
||||||
unset($credentials['port']);
|
unset($credentials['port']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( defined('FTP_SSH') && FTP_SSH ) || ( defined('FS_METHOD') && 'ssh2' == FS_METHOD ) )
|
if ( ( defined( 'FTP_SSH' ) && FTP_SSH ) || ( defined( 'FS_METHOD' ) && 'ssh2' == FS_METHOD ) ) {
|
||||||
$credentials['connection_type'] = 'ssh';
|
$credentials['connection_type'] = 'ssh';
|
||||||
else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type ) //Only the FTP Extension understands SSL
|
} elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) { //Only the FTP Extension understands SSL
|
||||||
$credentials['connection_type'] = 'ftps';
|
$credentials['connection_type'] = 'ftps';
|
||||||
else if ( !empty($_POST['connection_type']) )
|
} elseif ( ! empty( $_POST['connection_type'] ) ) {
|
||||||
$credentials['connection_type'] = wp_unslash( $_POST['connection_type'] );
|
$credentials['connection_type'] = wp_unslash( $_POST['connection_type'] );
|
||||||
else if ( !isset($credentials['connection_type']) ) //All else fails (And it's not defaulted to something else saved), Default to FTP
|
} elseif ( ! isset( $credentials['connection_type'] ) ) { //All else fails (And it's not defaulted to something else saved), Default to FTP
|
||||||
$credentials['connection_type'] = 'ftp';
|
$credentials['connection_type'] = 'ftp';
|
||||||
|
}
|
||||||
if ( ! $error &&
|
if ( ! $error &&
|
||||||
(
|
(
|
||||||
( !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) ||
|
( !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) ||
|
||||||
|
|
|
@ -293,17 +293,17 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||||
if ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) {
|
if ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) {
|
||||||
/* translators: 1: audio track title, 2: album title, 3: artist name */
|
/* translators: 1: audio track title, 2: album title, 3: artist name */
|
||||||
$content .= sprintf( __( '"%1$s" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] );
|
$content .= sprintf( __( '"%1$s" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] );
|
||||||
} else if ( ! empty( $meta['album'] ) ) {
|
} elseif ( ! empty( $meta['album'] ) ) {
|
||||||
/* translators: 1: audio track title, 2: album title */
|
/* translators: 1: audio track title, 2: album title */
|
||||||
$content .= sprintf( __( '"%1$s" from %2$s.' ), $title, $meta['album'] );
|
$content .= sprintf( __( '"%1$s" from %2$s.' ), $title, $meta['album'] );
|
||||||
} else if ( ! empty( $meta['artist'] ) ) {
|
} elseif ( ! empty( $meta['artist'] ) ) {
|
||||||
/* translators: 1: audio track title, 2: artist name */
|
/* translators: 1: audio track title, 2: artist name */
|
||||||
$content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
|
$content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
|
||||||
} else {
|
} else {
|
||||||
$content .= sprintf( __( '"%s".' ), $title );
|
$content .= sprintf( __( '"%s".' ), $title );
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( ! empty( $meta['album'] ) ) {
|
} elseif ( ! empty( $meta['album'] ) ) {
|
||||||
|
|
||||||
if ( ! empty( $meta['artist'] ) ) {
|
if ( ! empty( $meta['artist'] ) ) {
|
||||||
/* translators: 1: audio album title, 2: artist name */
|
/* translators: 1: audio album title, 2: artist name */
|
||||||
|
@ -312,7 +312,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
|
||||||
$content .= $meta['album'] . '.';
|
$content .= $meta['album'] . '.';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( ! empty( $meta['artist'] ) ) {
|
} elseif ( ! empty( $meta['artist'] ) ) {
|
||||||
|
|
||||||
$content .= $meta['artist'] . '.';
|
$content .= $meta['artist'] . '.';
|
||||||
|
|
||||||
|
|
|
@ -166,11 +166,11 @@ $datef = __( 'M j, Y @ G:i' );
|
||||||
if ( 0 != $post->ID ) {
|
if ( 0 != $post->ID ) {
|
||||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||||
$stamp = __('Scheduled for: <b>%1$s</b>');
|
$stamp = __('Scheduled for: <b>%1$s</b>');
|
||||||
} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
|
} elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
|
||||||
$stamp = __('Published on: <b>%1$s</b>');
|
$stamp = __('Published on: <b>%1$s</b>');
|
||||||
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
|
} elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
|
||||||
$stamp = __('Publish <b>immediately</b>');
|
$stamp = __('Publish <b>immediately</b>');
|
||||||
} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
|
} elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
|
||||||
$stamp = __('Schedule for: <b>%1$s</b>');
|
$stamp = __('Schedule for: <b>%1$s</b>');
|
||||||
} else { // draft, 1 or more saves, date specified
|
} else { // draft, 1 or more saves, date specified
|
||||||
$stamp = __('Publish on: <b>%1$s</b>');
|
$stamp = __('Publish on: <b>%1$s</b>');
|
||||||
|
|
|
@ -145,10 +145,11 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
|
||||||
if ( $file == '.' || $file == '..' )
|
if ( $file == '.' || $file == '..' )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) )
|
if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) ) {
|
||||||
$stack[] = $dir . DIRECTORY_SEPARATOR . $file;
|
$stack[] = $dir . DIRECTORY_SEPARATOR . $file;
|
||||||
else if ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) )
|
} elseif ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) ) {
|
||||||
@unlink( $dir . DIRECTORY_SEPARATOR . $file );
|
@unlink( $dir . DIRECTORY_SEPARATOR . $file );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@closedir( $dh );
|
@closedir( $dh );
|
||||||
}
|
}
|
||||||
|
|
|
@ -517,7 +517,7 @@ function install_plugin_information() {
|
||||||
<?php
|
<?php
|
||||||
if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
|
if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
|
||||||
echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
|
echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
|
||||||
} else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
|
} elseif ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
|
||||||
echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
|
echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1652,7 +1652,7 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
|
||||||
else
|
else
|
||||||
if ( isset( $admin_page_hooks[$parent] ))
|
if ( isset( $admin_page_hooks[$parent] ))
|
||||||
$page_type = $admin_page_hooks[$parent];
|
$page_type = $admin_page_hooks[$parent];
|
||||||
} else if ( isset( $admin_page_hooks[$parent] ) ) {
|
} elseif ( isset( $admin_page_hooks[$parent] ) ) {
|
||||||
$page_type = $admin_page_hooks[$parent];
|
$page_type = $admin_page_hooks[$parent];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1713,7 +1713,7 @@ function user_can_access_admin_page() {
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
} else if ( $submenu_array[2] == $pagenow ) {
|
} elseif ( $submenu_array[2] == $pagenow ) {
|
||||||
if ( current_user_can( $submenu_array[1] ))
|
if ( current_user_can( $submenu_array[1] ))
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
|
|
|
@ -66,12 +66,12 @@ function wp_create_category( $cat_name, $parent = 0 ) {
|
||||||
*/
|
*/
|
||||||
function wp_create_categories( $categories, $post_id = '' ) {
|
function wp_create_categories( $categories, $post_id = '' ) {
|
||||||
$cat_ids = array ();
|
$cat_ids = array ();
|
||||||
foreach ($categories as $category) {
|
foreach ( $categories as $category ) {
|
||||||
if ($id = category_exists($category))
|
if ( $id = category_exists( $category ) ) {
|
||||||
$cat_ids[] = $id;
|
$cat_ids[] = $id;
|
||||||
else
|
} elseif ( $id = wp_create_category( $category ) ) {
|
||||||
if ($id = wp_create_category($category))
|
$cat_ids[] = $id;
|
||||||
$cat_ids[] = $id;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $post_id )
|
if ( $post_id )
|
||||||
|
|
|
@ -1848,7 +1848,7 @@ function get_submit_button( $text = null, $type = 'primary large', $name = 'subm
|
||||||
foreach ( $other_attributes as $attribute => $value ) {
|
foreach ( $other_attributes as $attribute => $value ) {
|
||||||
$attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important
|
$attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important
|
||||||
}
|
}
|
||||||
} else if ( !empty( $other_attributes ) ) { // Attributes provided as a string
|
} elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string
|
||||||
$attributes = $other_attributes;
|
$attributes = $other_attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ function get_theme_update_available( $theme ) {
|
||||||
if ( ! current_user_can('update_themes') ) {
|
if ( ! current_user_can('update_themes') ) {
|
||||||
$html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.' ) . '</strong></p>',
|
$html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.' ) . '</strong></p>',
|
||||||
$theme_name, esc_url( $details_url ), esc_attr( $theme['Name'] ), $update['new_version'] );
|
$theme_name, esc_url( $details_url ), esc_attr( $theme['Name'] ), $update['new_version'] );
|
||||||
} else if ( empty( $update['package'] ) ) {
|
} elseif ( empty( $update['package'] ) ) {
|
||||||
$html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
|
$html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>',
|
||||||
$theme_name, esc_url( $details_url ), esc_attr( $theme['Name'] ), $update['new_version'] );
|
$theme_name, esc_url( $details_url ), esc_attr( $theme['Name'] ), $update['new_version'] );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -278,13 +278,13 @@ function wp_plugin_update_row( $file, $plugin_data ) {
|
||||||
if ( is_network_admin() || !is_multisite() ) {
|
if ( is_network_admin() || !is_multisite() ) {
|
||||||
echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
|
echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
|
||||||
|
|
||||||
if ( ! current_user_can('update_plugins') )
|
if ( ! current_user_can( 'update_plugins' ) ) {
|
||||||
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
|
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
|
||||||
else if ( empty($r->package) )
|
} elseif ( empty($r->package) ) {
|
||||||
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
|
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version );
|
||||||
else
|
} else {
|
||||||
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) );
|
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) );
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Fires at the end of the update message container in each
|
* Fires at the end of the update message container in each
|
||||||
* row of the plugins list table.
|
* row of the plugins list table.
|
||||||
|
@ -367,13 +367,13 @@ function wp_theme_update_row( $theme_key, $theme ) {
|
||||||
$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
|
$wp_list_table = _get_list_table('WP_MS_Themes_List_Table');
|
||||||
|
|
||||||
echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
|
echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
|
||||||
if ( ! current_user_can('update_themes') )
|
if ( ! current_user_can('update_themes') ) {
|
||||||
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r->new_version );
|
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r->new_version );
|
||||||
else if ( empty( $r['package'] ) )
|
} elseif ( empty( $r['package'] ) ) {
|
||||||
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'] );
|
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'] );
|
||||||
else
|
} else {
|
||||||
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) );
|
printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) );
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Fires at the end of the update message container in each
|
* Fires at the end of the update message container in each
|
||||||
* row of the themes list table.
|
* row of the themes list table.
|
||||||
|
|
|
@ -74,7 +74,7 @@ function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated
|
||||||
$user_id = wp_create_user($user_name, $user_password, $user_email);
|
$user_id = wp_create_user($user_name, $user_password, $user_email);
|
||||||
update_user_option($user_id, 'default_password_nag', true, true);
|
update_user_option($user_id, 'default_password_nag', true, true);
|
||||||
$email_password = true;
|
$email_password = true;
|
||||||
} else if ( !$user_id ) {
|
} elseif ( ! $user_id ) {
|
||||||
// Password has been provided
|
// Password has been provided
|
||||||
$message = '<em>'.__('Your chosen password.').'</em>';
|
$message = '<em>'.__('Your chosen password.').'</em>';
|
||||||
$user_id = wp_create_user($user_name, $user_password, $user_email);
|
$user_id = wp_create_user($user_name, $user_password, $user_email);
|
||||||
|
@ -840,7 +840,7 @@ function upgrade_210() {
|
||||||
if ( 'static' == $status ) {
|
if ( 'static' == $status ) {
|
||||||
$status = 'publish';
|
$status = 'publish';
|
||||||
$type = 'page';
|
$type = 'page';
|
||||||
} else if ( 'attachment' == $status ) {
|
} elseif ( 'attachment' == $status ) {
|
||||||
$status = 'inherit';
|
$status = 'inherit';
|
||||||
$type = 'attachment';
|
$type = 'attachment';
|
||||||
}
|
}
|
||||||
|
@ -1716,14 +1716,14 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||||
|
|
||||||
// Create a tablename index for an array ($cqueries) of queries
|
// Create a tablename index for an array ($cqueries) of queries
|
||||||
foreach($queries as $qry) {
|
foreach($queries as $qry) {
|
||||||
if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {
|
if ( preg_match( "|CREATE TABLE ([^ ]*)|", $qry, $matches ) ) {
|
||||||
$cqueries[ trim( $matches[1], '`' ) ] = $qry;
|
$cqueries[ trim( $matches[1], '`' ) ] = $qry;
|
||||||
$for_update[$matches[1]] = 'Created table '.$matches[1];
|
$for_update[$matches[1]] = 'Created table '.$matches[1];
|
||||||
} else if (preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {
|
} elseif ( preg_match( "|CREATE DATABASE ([^ ]*)|", $qry, $matches ) ) {
|
||||||
array_unshift($cqueries, $qry);
|
array_unshift( $cqueries, $qry );
|
||||||
} else if (preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {
|
} elseif ( preg_match( "|INSERT INTO ([^ ]*)|", $qry, $matches ) ) {
|
||||||
$iqueries[] = $qry;
|
$iqueries[] = $qry;
|
||||||
} else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {
|
} elseif ( preg_match( "|UPDATE ([^ ]*)|", $qry, $matches ) ) {
|
||||||
$iqueries[] = $qry;
|
$iqueries[] = $qry;
|
||||||
} else {
|
} else {
|
||||||
// Unrecognized query type
|
// Unrecognized query type
|
||||||
|
@ -1875,7 +1875,7 @@ function dbDelta( $queries = '', $execute = true ) {
|
||||||
$index_string = '';
|
$index_string = '';
|
||||||
if ($index_name == 'PRIMARY') {
|
if ($index_name == 'PRIMARY') {
|
||||||
$index_string .= 'PRIMARY ';
|
$index_string .= 'PRIMARY ';
|
||||||
} else if($index_data['unique']) {
|
} elseif ( $index_data['unique'] ) {
|
||||||
$index_string .= 'UNIQUE ';
|
$index_string .= 'UNIQUE ';
|
||||||
}
|
}
|
||||||
$index_string .= 'KEY ';
|
$index_string .= 'KEY ';
|
||||||
|
|
|
@ -254,7 +254,7 @@ switch($step) {
|
||||||
// TODO: poka-yoke
|
// TODO: poka-yoke
|
||||||
display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
|
display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
|
||||||
$error = true;
|
$error = true;
|
||||||
} else if ( empty( $admin_email ) ) {
|
} elseif ( empty( $admin_email ) ) {
|
||||||
// TODO: poka-yoke
|
// TODO: poka-yoke
|
||||||
display_setup_form( __( 'You must provide an email address.' ) );
|
display_setup_form( __( 'You must provide an email address.' ) );
|
||||||
$error = true;
|
$error = true;
|
||||||
|
|
|
@ -174,7 +174,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
||||||
$class[] = 'current';
|
$class[] = 'current';
|
||||||
// If plugin_page is set the parent must either match the current page or not physically exist.
|
// If plugin_page is set the parent must either match the current page or not physically exist.
|
||||||
// This allows plugin pages with the same hook to exist under different parents.
|
// This allows plugin pages with the same hook to exist under different parents.
|
||||||
} else if (
|
} elseif (
|
||||||
( ! isset( $plugin_page ) && $self == $sub_item[2] ) ||
|
( ! isset( $plugin_page ) && $self == $sub_item[2] ) ||
|
||||||
( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) )
|
( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) )
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -151,12 +151,13 @@ if ( ! empty( $_GET['settings-updated'] ) ) : ?>
|
||||||
<div id="message" class="updated"><p><?php
|
<div id="message" class="updated"><p><?php
|
||||||
if ( ! is_multisite() ) {
|
if ( ! is_multisite() ) {
|
||||||
if ( $iis7_permalinks ) {
|
if ( $iis7_permalinks ) {
|
||||||
if ( $permalink_structure && ! $usingpi && ! $writable )
|
if ( $permalink_structure && ! $usingpi && ! $writable ) {
|
||||||
_e('You should update your web.config now.');
|
_e('You should update your web.config now.');
|
||||||
else if ( $permalink_structure && ! $usingpi && $writable )
|
} elseif ( $permalink_structure && ! $usingpi && $writable ) {
|
||||||
_e('Permalink structure updated. Remove write access on web.config file now!');
|
_e('Permalink structure updated. Remove write access on web.config file now!');
|
||||||
else
|
} else {
|
||||||
_e('Permalink structure updated.');
|
_e('Permalink structure updated.');
|
||||||
|
}
|
||||||
} elseif ( $is_nginx ) {
|
} elseif ( $is_nginx ) {
|
||||||
_e('Permalink structure updated.');
|
_e('Permalink structure updated.');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -121,7 +121,7 @@ $comment_type = '';
|
||||||
if ( get_option('require_name_email') && !$user->exists() ) {
|
if ( get_option('require_name_email') && !$user->exists() ) {
|
||||||
if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) {
|
if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) {
|
||||||
wp_die( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 );
|
wp_die( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 );
|
||||||
} else if ( ! is_email( $comment_author_email ) ) {
|
} elseif ( ! is_email( $comment_author_email ) ) {
|
||||||
wp_die( __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 );
|
wp_die( __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -386,17 +386,18 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
|
||||||
} else {
|
} else {
|
||||||
$value = esc_attr($value);
|
$value = esc_attr($value);
|
||||||
}
|
}
|
||||||
} else if ( 'db' == $context ) {
|
} elseif ( 'db' == $context ) {
|
||||||
/** This filter is documented in wp-includes/post.php */
|
/** This filter is documented in wp-includes/post.php */
|
||||||
$value = apply_filters( "pre_$field", $value );
|
$value = apply_filters( "pre_$field", $value );
|
||||||
} else {
|
} else {
|
||||||
/** This filter is documented in wp-includes/post.php */
|
/** This filter is documented in wp-includes/post.php */
|
||||||
$value = apply_filters( $field, $value, $bookmark_id, $context );
|
$value = apply_filters( $field, $value, $bookmark_id, $context );
|
||||||
|
|
||||||
if ( 'attribute' == $context )
|
if ( 'attribute' == $context ) {
|
||||||
$value = esc_attr($value);
|
$value = esc_attr( $value );
|
||||||
else if ( 'js' == $context )
|
} elseif ( 'js' == $context ) {
|
||||||
$value = esc_js($value);
|
$value = esc_js( $value );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
|
|
@ -893,12 +893,12 @@ class WP_Http_Streams {
|
||||||
|
|
||||||
$r = wp_parse_args( $args, $defaults );
|
$r = wp_parse_args( $args, $defaults );
|
||||||
|
|
||||||
if ( isset($r['headers']['User-Agent']) ) {
|
if ( isset( $r['headers']['User-Agent'] ) ) {
|
||||||
$r['user-agent'] = $r['headers']['User-Agent'];
|
$r['user-agent'] = $r['headers']['User-Agent'];
|
||||||
unset($r['headers']['User-Agent']);
|
unset( $r['headers']['User-Agent'] );
|
||||||
} else if ( isset($r['headers']['user-agent']) ) {
|
} elseif ( isset( $r['headers']['user-agent'] ) ) {
|
||||||
$r['user-agent'] = $r['headers']['user-agent'];
|
$r['user-agent'] = $r['headers']['user-agent'];
|
||||||
unset($r['headers']['user-agent']);
|
unset( $r['headers']['user-agent'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct Cookie: header if any cookies are set.
|
// Construct Cookie: header if any cookies are set.
|
||||||
|
@ -1358,12 +1358,12 @@ class WP_Http_Curl {
|
||||||
|
|
||||||
$r = wp_parse_args( $args, $defaults );
|
$r = wp_parse_args( $args, $defaults );
|
||||||
|
|
||||||
if ( isset($r['headers']['User-Agent']) ) {
|
if ( isset( $r['headers']['User-Agent'] ) ) {
|
||||||
$r['user-agent'] = $r['headers']['User-Agent'];
|
$r['user-agent'] = $r['headers']['User-Agent'];
|
||||||
unset($r['headers']['User-Agent']);
|
unset( $r['headers']['User-Agent'] );
|
||||||
} else if ( isset($r['headers']['user-agent']) ) {
|
} elseif ( isset( $r['headers']['user-agent'] ) ) {
|
||||||
$r['user-agent'] = $r['headers']['user-agent'];
|
$r['user-agent'] = $r['headers']['user-agent'];
|
||||||
unset($r['headers']['user-agent']);
|
unset( $r['headers']['user-agent'] );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct Cookie: header if any cookies are set.
|
// Construct Cookie: header if any cookies are set.
|
||||||
|
@ -2244,7 +2244,7 @@ class WP_Http_Encoding {
|
||||||
if ( is_array( $headers ) ) {
|
if ( is_array( $headers ) ) {
|
||||||
if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
|
if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
|
||||||
return true;
|
return true;
|
||||||
} else if ( is_string( $headers ) ) {
|
} elseif ( is_string( $headers ) ) {
|
||||||
return ( stripos($headers, 'content-encoding:') !== false );
|
return ( stripos($headers, 'content-encoding:') !== false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3211,10 +3211,11 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
if ( !$user ) {
|
if ( !$user ) {
|
||||||
$logged_in = false;
|
$logged_in = false;
|
||||||
if ( $allow_anon && get_option('comment_registration') )
|
if ( $allow_anon && get_option('comment_registration') ) {
|
||||||
return new IXR_Error( 403, __( 'You must be registered to comment' ) );
|
return new IXR_Error( 403, __( 'You must be registered to comment' ) );
|
||||||
else if ( !$allow_anon )
|
} elseif ( ! $allow_anon ) {
|
||||||
return $this->error;
|
return $this->error;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$logged_in = true;
|
$logged_in = true;
|
||||||
}
|
}
|
||||||
|
@ -4873,10 +4874,11 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
|
$tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null;
|
||||||
|
|
||||||
if ( ('publish' == $post_status) ) {
|
if ( ('publish' == $post_status) ) {
|
||||||
if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') )
|
if ( ( 'page' == $post_type ) && ! current_user_can( 'publish_pages' ) ) {
|
||||||
return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.'));
|
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) );
|
||||||
else if ( !current_user_can('publish_posts') )
|
} elseif ( ! current_user_can( 'publish_posts' ) ) {
|
||||||
return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
|
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $post_more )
|
if ( $post_more )
|
||||||
|
|
|
@ -135,11 +135,11 @@ class WP {
|
||||||
$this->query_vars = array();
|
$this->query_vars = array();
|
||||||
$post_type_query_vars = array();
|
$post_type_query_vars = array();
|
||||||
|
|
||||||
if ( is_array($extra_query_vars) )
|
if ( is_array( $extra_query_vars ) ) {
|
||||||
$this->extra_query_vars = & $extra_query_vars;
|
$this->extra_query_vars = & $extra_query_vars;
|
||||||
else if (! empty($extra_query_vars))
|
} elseif ( ! empty( $extra_query_vars ) ) {
|
||||||
parse_str($extra_query_vars, $this->extra_query_vars);
|
parse_str( $extra_query_vars, $this->extra_query_vars );
|
||||||
|
}
|
||||||
// Process PATH_INFO, REQUEST_URI, and 404 for permalinks.
|
// Process PATH_INFO, REQUEST_URI, and 404 for permalinks.
|
||||||
|
|
||||||
// Fetch the rewrite rules.
|
// Fetch the rewrite rules.
|
||||||
|
@ -357,7 +357,7 @@ class WP {
|
||||||
} elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) {
|
} elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) {
|
||||||
$exit_required = true;
|
$exit_required = true;
|
||||||
}
|
}
|
||||||
} else if ( empty($this->query_vars['feed']) ) {
|
} elseif ( empty( $this->query_vars['feed'] ) ) {
|
||||||
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
|
$headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset');
|
||||||
} else {
|
} else {
|
||||||
// We're showing a feed, so WP is indeed the only thing that last changed
|
// We're showing a feed, so WP is indeed the only thing that last changed
|
||||||
|
|
|
@ -1168,7 +1168,7 @@ function comments_template( $file = '/comments.php', $separate_comments = false
|
||||||
|
|
||||||
if ( $user_ID ) {
|
if ( $user_ID ) {
|
||||||
$comment_args['include_unapproved'] = array( $user_ID );
|
$comment_args['include_unapproved'] = array( $user_ID );
|
||||||
} else if ( ! empty( $comment_author_email ) ) {
|
} elseif ( ! empty( $comment_author_email ) ) {
|
||||||
$comment_args['include_unapproved'] = array( $comment_author_email );
|
$comment_args['include_unapproved'] = array( $comment_author_email );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -506,7 +506,7 @@ class WP_Comment_Query {
|
||||||
// Disable ORDER BY with 'none', an empty array, or boolean false.
|
// Disable ORDER BY with 'none', an empty array, or boolean false.
|
||||||
if ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) {
|
if ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) {
|
||||||
$orderby = '';
|
$orderby = '';
|
||||||
} else if ( ! empty( $this->query_vars['orderby'] ) ) {
|
} elseif ( ! empty( $this->query_vars['orderby'] ) ) {
|
||||||
$ordersby = is_array( $this->query_vars['orderby'] ) ?
|
$ordersby = is_array( $this->query_vars['orderby'] ) ?
|
||||||
$this->query_vars['orderby'] :
|
$this->query_vars['orderby'] :
|
||||||
preg_split( '/[,\s]/', $this->query_vars['orderby'] );
|
preg_split( '/[,\s]/', $this->query_vars['orderby'] );
|
||||||
|
@ -2228,9 +2228,9 @@ function wp_update_comment($commentarr) {
|
||||||
|
|
||||||
if ( ! isset( $data['comment_approved'] ) ) {
|
if ( ! isset( $data['comment_approved'] ) ) {
|
||||||
$data['comment_approved'] = 1;
|
$data['comment_approved'] = 1;
|
||||||
} else if ( 'hold' == $data['comment_approved'] ) {
|
} elseif ( 'hold' == $data['comment_approved'] ) {
|
||||||
$data['comment_approved'] = 0;
|
$data['comment_approved'] = 0;
|
||||||
} else if ( 'approve' == $data['comment_approved'] ) {
|
} elseif ( 'approve' == $data['comment_approved'] ) {
|
||||||
$data['comment_approved'] = 1;
|
$data['comment_approved'] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -425,7 +425,7 @@ class WP_Date_Query {
|
||||||
$valid = false;
|
$valid = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if ( $day_exists && $month_exists ) {
|
} elseif ( $day_exists && $month_exists ) {
|
||||||
/*
|
/*
|
||||||
* 2. checking day, month combination
|
* 2. checking day, month combination
|
||||||
* We use 2012 because, as a leap year, it's the most permissive.
|
* We use 2012 because, as a leap year, it's the most permissive.
|
||||||
|
@ -607,7 +607,7 @@ class WP_Date_Query {
|
||||||
foreach ( $query as $key => $clause ) {
|
foreach ( $query as $key => $clause ) {
|
||||||
if ( 'relation' === $key ) {
|
if ( 'relation' === $key ) {
|
||||||
$relation = $query['relation'];
|
$relation = $query['relation'];
|
||||||
} else if ( is_array( $clause ) ) {
|
} elseif ( is_array( $clause ) ) {
|
||||||
|
|
||||||
// This is a first-order clause.
|
// This is a first-order clause.
|
||||||
if ( $this->is_first_order_clause( $clause ) ) {
|
if ( $this->is_first_order_clause( $clause ) ) {
|
||||||
|
@ -616,7 +616,7 @@ class WP_Date_Query {
|
||||||
$where_count = count( $clause_sql['where'] );
|
$where_count = count( $clause_sql['where'] );
|
||||||
if ( ! $where_count ) {
|
if ( ! $where_count ) {
|
||||||
$sql_chunks['where'][] = '';
|
$sql_chunks['where'][] = '';
|
||||||
} else if ( 1 === $where_count ) {
|
} elseif ( 1 === $where_count ) {
|
||||||
$sql_chunks['where'][] = $clause_sql['where'][0];
|
$sql_chunks['where'][] = $clause_sql['where'][0];
|
||||||
} else {
|
} else {
|
||||||
$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
|
$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
|
||||||
|
@ -725,16 +725,16 @@ class WP_Date_Query {
|
||||||
if ( isset( $query['year'] ) && $value = $this->build_value( $compare, $query['year'] ) )
|
if ( isset( $query['year'] ) && $value = $this->build_value( $compare, $query['year'] ) )
|
||||||
$where_parts[] = "YEAR( $column ) $compare $value";
|
$where_parts[] = "YEAR( $column ) $compare $value";
|
||||||
|
|
||||||
if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) )
|
if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) ) {
|
||||||
$where_parts[] = "MONTH( $column ) $compare $value";
|
$where_parts[] = "MONTH( $column ) $compare $value";
|
||||||
else if ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) )
|
} elseif ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) ) {
|
||||||
$where_parts[] = "MONTH( $column ) $compare $value";
|
$where_parts[] = "MONTH( $column ) $compare $value";
|
||||||
|
}
|
||||||
if ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) )
|
if ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) ) {
|
||||||
$where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
|
$where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
|
||||||
else if ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) )
|
} elseif ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) ) {
|
||||||
$where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
|
$where_parts[] = _wp_mysql_week( $column ) . " $compare $value";
|
||||||
|
}
|
||||||
if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )
|
if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )
|
||||||
$where_parts[] = "DAYOFYEAR( $column ) $compare $value";
|
$where_parts[] = "DAYOFYEAR( $column ) $compare $value";
|
||||||
|
|
||||||
|
@ -858,14 +858,14 @@ class WP_Date_Query {
|
||||||
'year' => intval( $matches[1] ),
|
'year' => intval( $matches[1] ),
|
||||||
);
|
);
|
||||||
|
|
||||||
} else if ( preg_match( '/^(\d{4})\-(\d{2})$/', $datetime, $matches ) ) {
|
} elseif ( preg_match( '/^(\d{4})\-(\d{2})$/', $datetime, $matches ) ) {
|
||||||
// Y-m
|
// Y-m
|
||||||
$datetime = array(
|
$datetime = array(
|
||||||
'year' => intval( $matches[1] ),
|
'year' => intval( $matches[1] ),
|
||||||
'month' => intval( $matches[2] ),
|
'month' => intval( $matches[2] ),
|
||||||
);
|
);
|
||||||
|
|
||||||
} else if ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2})$/', $datetime, $matches ) ) {
|
} elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2})$/', $datetime, $matches ) ) {
|
||||||
// Y-m-d
|
// Y-m-d
|
||||||
$datetime = array(
|
$datetime = array(
|
||||||
'year' => intval( $matches[1] ),
|
'year' => intval( $matches[1] ),
|
||||||
|
@ -873,7 +873,7 @@ class WP_Date_Query {
|
||||||
'day' => intval( $matches[3] ),
|
'day' => intval( $matches[3] ),
|
||||||
);
|
);
|
||||||
|
|
||||||
} else if ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})$/', $datetime, $matches ) ) {
|
} elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})$/', $datetime, $matches ) ) {
|
||||||
// Y-m-d H:i
|
// Y-m-d H:i
|
||||||
$datetime = array(
|
$datetime = array(
|
||||||
'year' => intval( $matches[1] ),
|
'year' => intval( $matches[1] ),
|
||||||
|
|
|
@ -2396,7 +2396,7 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
|
||||||
|
|
||||||
if ( !$cur )
|
if ( !$cur )
|
||||||
$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );
|
$wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') );
|
||||||
else if ( $cur->meta_value != $meta_value )
|
elseif ( $cur->meta_value != $meta_value )
|
||||||
$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') );
|
$wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') );
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1502,7 +1502,7 @@ function force_balance_tags( $text ) {
|
||||||
// or close to be safe $tag = '/' . $tag;
|
// or close to be safe $tag = '/' . $tag;
|
||||||
}
|
}
|
||||||
// if stacktop value = tag close value then pop
|
// if stacktop value = tag close value then pop
|
||||||
else if ( $tagstack[$stacksize - 1] == $tag ) { // found closing tag
|
elseif ( $tagstack[$stacksize - 1] == $tag ) { // found closing tag
|
||||||
$tag = '</' . $tag . '>'; // Close Tag
|
$tag = '</' . $tag . '>'; // Close Tag
|
||||||
// Pop
|
// Pop
|
||||||
array_pop( $tagstack );
|
array_pop( $tagstack );
|
||||||
|
@ -2337,7 +2337,7 @@ function iso8601_to_datetime($date_string, $timezone = 'user') {
|
||||||
|
|
||||||
return gmdate('Y-m-d H:i:s', $timestamp);
|
return gmdate('Y-m-d H:i:s', $timestamp);
|
||||||
|
|
||||||
} else if ($timezone == 'user') {
|
} elseif ($timezone == 'user') {
|
||||||
return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string);
|
return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1437,7 +1437,7 @@ function wp_get_referer() {
|
||||||
$ref = false;
|
$ref = false;
|
||||||
if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
|
if ( ! empty( $_REQUEST['_wp_http_referer'] ) )
|
||||||
$ref = wp_unslash( $_REQUEST['_wp_http_referer'] );
|
$ref = wp_unslash( $_REQUEST['_wp_http_referer'] );
|
||||||
else if ( ! empty( $_SERVER['HTTP_REFERER'] ) )
|
elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) )
|
||||||
$ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
|
$ref = wp_unslash( $_SERVER['HTTP_REFERER'] );
|
||||||
|
|
||||||
if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) )
|
if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) )
|
||||||
|
@ -1670,11 +1670,11 @@ function wp_is_writable( $path ) {
|
||||||
*/
|
*/
|
||||||
function win_is_writable( $path ) {
|
function win_is_writable( $path ) {
|
||||||
|
|
||||||
if ( $path[strlen( $path ) - 1] == '/' ) // if it looks like a directory, check a random file within the directory
|
if ( $path[strlen( $path ) - 1] == '/' ) { // if it looks like a directory, check a random file within the directory
|
||||||
return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp');
|
return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp');
|
||||||
else if ( is_dir( $path ) ) // If it's a directory (and not a file) check a random file within the directory
|
} elseif ( is_dir( $path ) ) { // If it's a directory (and not a file) check a random file within the directory
|
||||||
return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
|
return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' );
|
||||||
|
}
|
||||||
// check tmp file for read/write capabilities
|
// check tmp file for read/write capabilities
|
||||||
$should_delete_tmp_file = !file_exists( $path );
|
$should_delete_tmp_file = !file_exists( $path );
|
||||||
$f = @fopen( $path, 'a' );
|
$f = @fopen( $path, 'a' );
|
||||||
|
|
|
@ -594,7 +594,7 @@ function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path
|
||||||
|
|
||||||
if ( false !== $plugin_rel_path ) {
|
if ( false !== $plugin_rel_path ) {
|
||||||
$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
|
$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
|
||||||
} else if ( false !== $deprecated ) {
|
} elseif ( false !== $deprecated ) {
|
||||||
_deprecated_argument( __FUNCTION__, '2.7' );
|
_deprecated_argument( __FUNCTION__, '2.7' );
|
||||||
$path = ABSPATH . trim( $deprecated, '/' );
|
$path = ABSPATH . trim( $deprecated, '/' );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -59,7 +59,7 @@ function wp_fix_server_vars() {
|
||||||
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
|
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
|
||||||
}
|
}
|
||||||
// IIS Isapi_Rewrite
|
// IIS Isapi_Rewrite
|
||||||
else if ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {
|
elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) {
|
||||||
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
|
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
|
||||||
} else {
|
} else {
|
||||||
// Use ORIG_PATH_INFO if there is no PATH_INFO
|
// Use ORIG_PATH_INFO if there is no PATH_INFO
|
||||||
|
@ -427,7 +427,7 @@ function wp_start_object_cache() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$first_init = true;
|
$first_init = true;
|
||||||
} else if ( ! wp_using_ext_object_cache() && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
|
} elseif ( ! wp_using_ext_object_cache() && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) {
|
||||||
/*
|
/*
|
||||||
* Sometimes advanced-cache.php can load object-cache.php before
|
* Sometimes advanced-cache.php can load object-cache.php before
|
||||||
* it is loaded here. This breaks the function_exists check above
|
* it is loaded here. This breaks the function_exists check above
|
||||||
|
|
|
@ -1984,11 +1984,11 @@ function adjacent_image_link($prev = true, $size = 'thumbnail', $text = false) {
|
||||||
* @return array Empty array on failure. List of taxonomies on success.
|
* @return array Empty array on failure. List of taxonomies on success.
|
||||||
*/
|
*/
|
||||||
function get_attachment_taxonomies($attachment) {
|
function get_attachment_taxonomies($attachment) {
|
||||||
if ( is_int( $attachment ) )
|
if ( is_int( $attachment ) ) {
|
||||||
$attachment = get_post($attachment);
|
$attachment = get_post( $attachment );
|
||||||
else if ( is_array($attachment) )
|
} elseif ( is_array( $attachment ) ) {
|
||||||
$attachment = (object) $attachment;
|
$attachment = (object) $attachment;
|
||||||
|
}
|
||||||
if ( ! is_object($attachment) )
|
if ( ! is_object($attachment) )
|
||||||
return array();
|
return array();
|
||||||
|
|
||||||
|
|
|
@ -995,11 +995,11 @@ class WP_Meta_Query {
|
||||||
if ( 'relation' === $key ) {
|
if ( 'relation' === $key ) {
|
||||||
$relation = $query;
|
$relation = $query;
|
||||||
|
|
||||||
} else if ( ! is_array( $query ) ) {
|
} elseif ( ! is_array( $query ) ) {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// First-order clause.
|
// First-order clause.
|
||||||
} else if ( $this->is_first_order_clause( $query ) ) {
|
} elseif ( $this->is_first_order_clause( $query ) ) {
|
||||||
if ( isset( $query['value'] ) && array() === $query['value'] ) {
|
if ( isset( $query['value'] ) && array() === $query['value'] ) {
|
||||||
unset( $query['value'] );
|
unset( $query['value'] );
|
||||||
}
|
}
|
||||||
|
@ -1029,7 +1029,7 @@ class WP_Meta_Query {
|
||||||
* This value will not actually be used to join clauses, but it
|
* This value will not actually be used to join clauses, but it
|
||||||
* simplifies the logic around combining key-only queries.
|
* simplifies the logic around combining key-only queries.
|
||||||
*/
|
*/
|
||||||
} else if ( 1 === count( $clean_queries ) ) {
|
} elseif ( 1 === count( $clean_queries ) ) {
|
||||||
$clean_queries['relation'] = 'OR';
|
$clean_queries['relation'] = 'OR';
|
||||||
|
|
||||||
// Default to AND.
|
// Default to AND.
|
||||||
|
@ -1093,11 +1093,11 @@ class WP_Meta_Query {
|
||||||
$primary_meta_query,
|
$primary_meta_query,
|
||||||
$existing_meta_query,
|
$existing_meta_query,
|
||||||
);
|
);
|
||||||
} else if ( ! empty( $primary_meta_query ) ) {
|
} elseif ( ! empty( $primary_meta_query ) ) {
|
||||||
$meta_query = array(
|
$meta_query = array(
|
||||||
$primary_meta_query,
|
$primary_meta_query,
|
||||||
);
|
);
|
||||||
} else if ( ! empty( $existing_meta_query ) ) {
|
} elseif ( ! empty( $existing_meta_query ) ) {
|
||||||
$meta_query = $existing_meta_query;
|
$meta_query = $existing_meta_query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1254,7 +1254,7 @@ class WP_Meta_Query {
|
||||||
foreach ( $query as $key => &$clause ) {
|
foreach ( $query as $key => &$clause ) {
|
||||||
if ( 'relation' === $key ) {
|
if ( 'relation' === $key ) {
|
||||||
$relation = $query['relation'];
|
$relation = $query['relation'];
|
||||||
} else if ( is_array( $clause ) ) {
|
} elseif ( is_array( $clause ) ) {
|
||||||
|
|
||||||
// This is a first-order clause.
|
// This is a first-order clause.
|
||||||
if ( $this->is_first_order_clause( $clause ) ) {
|
if ( $this->is_first_order_clause( $clause ) ) {
|
||||||
|
@ -1263,7 +1263,7 @@ class WP_Meta_Query {
|
||||||
$where_count = count( $clause_sql['where'] );
|
$where_count = count( $clause_sql['where'] );
|
||||||
if ( ! $where_count ) {
|
if ( ! $where_count ) {
|
||||||
$sql_chunks['where'][] = '';
|
$sql_chunks['where'][] = '';
|
||||||
} else if ( 1 === $where_count ) {
|
} elseif ( 1 === $where_count ) {
|
||||||
$sql_chunks['where'][] = $clause_sql['where'][0];
|
$sql_chunks['where'][] = $clause_sql['where'][0];
|
||||||
} else {
|
} else {
|
||||||
$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
|
$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
|
||||||
|
@ -1492,7 +1492,7 @@ class WP_Meta_Query {
|
||||||
$compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' );
|
$compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' );
|
||||||
|
|
||||||
// Clauses joined by AND with "negative" operators share a join only if they also share a key.
|
// Clauses joined by AND with "negative" operators share a join only if they also share a key.
|
||||||
} else if ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) {
|
} elseif ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) {
|
||||||
$compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' );
|
$compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -806,7 +806,7 @@ function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_
|
||||||
'post_type' == $menu_item_type
|
'post_type' == $menu_item_type
|
||||||
) {
|
) {
|
||||||
$menu_item_ids[] = (int) $menu_item->ID;
|
$menu_item_ids[] = (int) $menu_item->ID;
|
||||||
} else if (
|
} elseif (
|
||||||
'taxonomy' == $object_type &&
|
'taxonomy' == $object_type &&
|
||||||
'taxonomy' == $menu_item_type &&
|
'taxonomy' == $menu_item_type &&
|
||||||
get_post_meta( $menu_item->ID, '_menu_item_object', true ) == $taxonomy
|
get_post_meta( $menu_item->ID, '_menu_item_object', true ) == $taxonomy
|
||||||
|
|
|
@ -327,7 +327,7 @@ function remove_all_filters( $tag, $priority = false ) {
|
||||||
if ( isset( $wp_filter[ $tag ]) ) {
|
if ( isset( $wp_filter[ $tag ]) ) {
|
||||||
if ( false === $priority ) {
|
if ( false === $priority ) {
|
||||||
$wp_filter[ $tag ] = array();
|
$wp_filter[ $tag ] = array();
|
||||||
} else if ( isset( $wp_filter[ $tag ][ $priority ] ) ) {
|
} elseif ( isset( $wp_filter[ $tag ][ $priority ] ) ) {
|
||||||
$wp_filter[ $tag ][ $priority ] = array();
|
$wp_filter[ $tag ][ $priority ] = array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -900,7 +900,7 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
|
||||||
|
|
||||||
return $obj_idx;
|
return $obj_idx;
|
||||||
}
|
}
|
||||||
} else if ( is_string($function[0]) ) {
|
} elseif ( is_string( $function[0] ) ) {
|
||||||
// Static Calling
|
// Static Calling
|
||||||
return $function[0] . '::' . $function[1];
|
return $function[0] . '::' . $function[1];
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,7 +129,7 @@ function get_the_title( $post = 0 ) {
|
||||||
*/
|
*/
|
||||||
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post );
|
$protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post );
|
||||||
$title = sprintf( $protected_title_format, $title );
|
$title = sprintf( $protected_title_format, $title );
|
||||||
} else if ( isset( $post->post_status ) && 'private' == $post->post_status ) {
|
} elseif ( isset( $post->post_status ) && 'private' == $post->post_status ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the text prepended to the post title of private posts.
|
* Filter the text prepended to the post title of private posts.
|
||||||
|
@ -566,7 +566,7 @@ function get_body_class( $class = '' ) {
|
||||||
if ( is_array( $post_type ) )
|
if ( is_array( $post_type ) )
|
||||||
$post_type = reset( $post_type );
|
$post_type = reset( $post_type );
|
||||||
$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
|
$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
|
||||||
} else if ( is_author() ) {
|
} elseif ( is_author() ) {
|
||||||
$author = $wp_query->get_queried_object();
|
$author = $wp_query->get_queried_object();
|
||||||
$classes[] = 'author';
|
$classes[] = 'author';
|
||||||
if ( isset( $author->user_nicename ) ) {
|
if ( isset( $author->user_nicename ) ) {
|
||||||
|
|
|
@ -2184,7 +2184,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
} else {
|
} else {
|
||||||
$value = esc_attr($value);
|
$value = esc_attr($value);
|
||||||
}
|
}
|
||||||
} else if ( 'db' == $context ) {
|
} elseif ( 'db' == $context ) {
|
||||||
if ( $prefixed ) {
|
if ( $prefixed ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2252,7 +2252,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
||||||
|
|
||||||
if ( 'attribute' == $context )
|
if ( 'attribute' == $context )
|
||||||
$value = esc_attr($value);
|
$value = esc_attr($value);
|
||||||
else if ( 'js' == $context )
|
elseif ( 'js' == $context )
|
||||||
$value = esc_js($value);
|
$value = esc_js($value);
|
||||||
|
|
||||||
return $value;
|
return $value;
|
||||||
|
@ -3907,7 +3907,7 @@ function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $appe
|
||||||
} else {
|
} else {
|
||||||
$post_categories = array();
|
$post_categories = array();
|
||||||
}
|
}
|
||||||
} else if ( 1 == count($post_categories) && '' == reset($post_categories) ) {
|
} elseif ( 1 == count( $post_categories ) && '' == reset( $post_categories ) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1654,9 +1654,9 @@ class WP_Query {
|
||||||
$this->is_date = true;
|
$this->is_date = true;
|
||||||
if ( strlen($qv['m']) > 9 ) {
|
if ( strlen($qv['m']) > 9 ) {
|
||||||
$this->is_time = true;
|
$this->is_time = true;
|
||||||
} else if ( strlen($qv['m']) > 7 ) {
|
} elseif ( strlen( $qv['m'] ) > 7 ) {
|
||||||
$this->is_day = true;
|
$this->is_day = true;
|
||||||
} else if ( strlen($qv['m']) > 5 ) {
|
} elseif ( strlen( $qv['m'] ) > 5 ) {
|
||||||
$this->is_month = true;
|
$this->is_month = true;
|
||||||
} else {
|
} else {
|
||||||
$this->is_year = true;
|
$this->is_year = true;
|
||||||
|
@ -1956,7 +1956,7 @@ class WP_Query {
|
||||||
$tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
|
$tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
|
||||||
$q['tag_slug__in'][] = $tag;
|
$q['tag_slug__in'][] = $tag;
|
||||||
}
|
}
|
||||||
} else if ( preg_match('/[+\r\n\t ]+/', $q['tag']) || !empty($q['cat']) ) {
|
} elseif ( preg_match('/[+\r\n\t ]+/', $q['tag'] ) || ! empty( $q['cat'] ) ) {
|
||||||
$tags = preg_split('/[+\r\n\t ]+/', $q['tag']);
|
$tags = preg_split('/[+\r\n\t ]+/', $q['tag']);
|
||||||
foreach ( (array) $tags as $tag ) {
|
foreach ( (array) $tags as $tag ) {
|
||||||
$tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
|
$tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
|
||||||
|
@ -2467,7 +2467,7 @@ class WP_Query {
|
||||||
$q['posts_per_page'] = (int) $q['posts_per_page'];
|
$q['posts_per_page'] = (int) $q['posts_per_page'];
|
||||||
if ( $q['posts_per_page'] < -1 )
|
if ( $q['posts_per_page'] < -1 )
|
||||||
$q['posts_per_page'] = abs($q['posts_per_page']);
|
$q['posts_per_page'] = abs($q['posts_per_page']);
|
||||||
else if ( $q['posts_per_page'] == 0 )
|
elseif ( $q['posts_per_page'] == 0 )
|
||||||
$q['posts_per_page'] = 1;
|
$q['posts_per_page'] = 1;
|
||||||
|
|
||||||
if ( !isset($q['comments_per_page']) || $q['comments_per_page'] == 0 )
|
if ( !isset($q['comments_per_page']) || $q['comments_per_page'] == 0 )
|
||||||
|
@ -4350,7 +4350,7 @@ class WP_Query {
|
||||||
return true;
|
return true;
|
||||||
} elseif ( in_array( $page_obj->post_title, $page ) ) {
|
} elseif ( in_array( $page_obj->post_title, $page ) ) {
|
||||||
return true;
|
return true;
|
||||||
} else if ( in_array( $page_obj->post_name, $page ) ) {
|
} elseif ( in_array( $page_obj->post_name, $page ) ) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
foreach ( $page as $pagepath ) {
|
foreach ( $page as $pagepath ) {
|
||||||
|
@ -4568,7 +4568,7 @@ class WP_Query {
|
||||||
*/
|
*/
|
||||||
if ( $post->ID === get_queried_object_id() && ( $this->is_page() || $this->is_single() ) ) {
|
if ( $post->ID === get_queried_object_id() && ( $this->is_page() || $this->is_single() ) ) {
|
||||||
$more = 1;
|
$more = 1;
|
||||||
} else if ( $this->is_feed() ) {
|
} elseif ( $this->is_feed() ) {
|
||||||
$more = 1;
|
$more = 1;
|
||||||
} else {
|
} else {
|
||||||
$more = 0;
|
$more = 0;
|
||||||
|
|
|
@ -1376,11 +1376,11 @@ class WP_Rewrite {
|
||||||
$rewrite = array_merge($rewrite, array($pagematch => $pagequery));
|
$rewrite = array_merge($rewrite, array($pagematch => $pagequery));
|
||||||
|
|
||||||
//only on pages with comments add ../comment-page-xx/
|
//only on pages with comments add ../comment-page-xx/
|
||||||
if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask )
|
if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask ) {
|
||||||
$rewrite = array_merge($rewrite, array($commentmatch => $commentquery));
|
$rewrite = array_merge($rewrite, array($commentmatch => $commentquery));
|
||||||
else if ( EP_ROOT & $ep_mask && get_option('page_on_front') )
|
} elseif ( EP_ROOT & $ep_mask && get_option('page_on_front') ) {
|
||||||
$rewrite = array_merge($rewrite, array($rootcommentmatch => $rootcommentquery));
|
$rewrite = array_merge($rewrite, array($rootcommentmatch => $rootcommentquery));
|
||||||
|
}
|
||||||
//do endpoints
|
//do endpoints
|
||||||
if ( $endpoints ) {
|
if ( $endpoints ) {
|
||||||
foreach ( (array) $ep_query_append as $regex => $ep) {
|
foreach ( (array) $ep_query_append as $regex => $ep) {
|
||||||
|
|
|
@ -467,7 +467,7 @@ function locate_template($template_names, $load = false, $require_once = true )
|
||||||
if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
|
if ( file_exists(STYLESHEETPATH . '/' . $template_name)) {
|
||||||
$located = STYLESHEETPATH . '/' . $template_name;
|
$located = STYLESHEETPATH . '/' . $template_name;
|
||||||
break;
|
break;
|
||||||
} else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
|
} elseif ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
|
||||||
$located = TEMPLATEPATH . '/' . $template_name;
|
$located = TEMPLATEPATH . '/' . $template_name;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -630,7 +630,7 @@ class WP_User_Query {
|
||||||
$orderby = 'ID';
|
$orderby = 'ID';
|
||||||
} elseif ( 'meta_value' == $qv['orderby'] ) {
|
} elseif ( 'meta_value' == $qv['orderby'] ) {
|
||||||
$orderby = "$wpdb->usermeta.meta_value";
|
$orderby = "$wpdb->usermeta.meta_value";
|
||||||
} else if ( 'include' === $qv['orderby'] && ! empty( $include ) ) {
|
} elseif ( 'include' === $qv['orderby'] && ! empty( $include ) ) {
|
||||||
// Sanitized earlier.
|
// Sanitized earlier.
|
||||||
$include_sql = implode( ',', $include );
|
$include_sql = implode( ',', $include );
|
||||||
$orderby = "FIELD( $wpdb->users.ID, $include_sql )";
|
$orderby = "FIELD( $wpdb->users.ID, $include_sql )";
|
||||||
|
@ -1514,7 +1514,7 @@ function sanitize_user_field($field, $value, $user_id, $context) {
|
||||||
$value = esc_html( $value ); // textarea_escaped?
|
$value = esc_html( $value ); // textarea_escaped?
|
||||||
else
|
else
|
||||||
$value = esc_attr($value);
|
$value = esc_attr($value);
|
||||||
} else if ( 'db' == $context ) {
|
} elseif ( 'db' == $context ) {
|
||||||
if ( $prefixed ) {
|
if ( $prefixed ) {
|
||||||
/** This filter is documented in wp-includes/post.php */
|
/** This filter is documented in wp-includes/post.php */
|
||||||
$value = apply_filters( "pre_{$field}", $value );
|
$value = apply_filters( "pre_{$field}", $value );
|
||||||
|
@ -1559,11 +1559,11 @@ function sanitize_user_field($field, $value, $user_id, $context) {
|
||||||
if ( 'user_url' == $field )
|
if ( 'user_url' == $field )
|
||||||
$value = esc_url($value);
|
$value = esc_url($value);
|
||||||
|
|
||||||
if ( 'attribute' == $context )
|
if ( 'attribute' == $context ) {
|
||||||
$value = esc_attr($value);
|
$value = esc_attr( $value );
|
||||||
else if ( 'js' == $context )
|
} elseif ( 'js' == $context ) {
|
||||||
$value = esc_js($value);
|
$value = esc_js( $value );
|
||||||
|
}
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31089';
|
$wp_version = '4.2-alpha-31090';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
|
@ -1366,7 +1366,7 @@ class wpdb {
|
||||||
while ( mysqli_more_results( $this->dbh ) ) {
|
while ( mysqli_more_results( $this->dbh ) ) {
|
||||||
mysqli_next_result( $this->dbh );
|
mysqli_next_result( $this->dbh );
|
||||||
}
|
}
|
||||||
} else if ( is_resource( $this->result ) ) {
|
} elseif ( is_resource( $this->result ) ) {
|
||||||
mysql_free_result( $this->result );
|
mysql_free_result( $this->result );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1435,9 +1435,9 @@ class wpdb {
|
||||||
|
|
||||||
if ( $this->has_connected ) {
|
if ( $this->has_connected ) {
|
||||||
$attempt_fallback = false;
|
$attempt_fallback = false;
|
||||||
} else if ( defined( 'WP_USE_EXT_MYSQL' ) && ! WP_USE_EXT_MYSQL ) {
|
} elseif ( defined( 'WP_USE_EXT_MYSQL' ) && ! WP_USE_EXT_MYSQL ) {
|
||||||
$attempt_fallback = false;
|
$attempt_fallback = false;
|
||||||
} else if ( ! function_exists( 'mysql_connect' ) ) {
|
} elseif ( ! function_exists( 'mysql_connect' ) ) {
|
||||||
$attempt_fallback = false;
|
$attempt_fallback = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1475,7 +1475,7 @@ class wpdb {
|
||||||
" ), htmlspecialchars( $this->dbhost, ENT_QUOTES ) ), 'db_connect_fail' );
|
" ), htmlspecialchars( $this->dbhost, ENT_QUOTES ) ), 'db_connect_fail' );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
} else if ( $this->dbh ) {
|
} elseif ( $this->dbh ) {
|
||||||
$this->has_connected = true;
|
$this->has_connected = true;
|
||||||
$this->set_charset( $this->dbh );
|
$this->set_charset( $this->dbh );
|
||||||
$this->ready = true;
|
$this->ready = true;
|
||||||
|
@ -1673,7 +1673,7 @@ class wpdb {
|
||||||
$this->last_result[$num_rows] = $row;
|
$this->last_result[$num_rows] = $row;
|
||||||
$num_rows++;
|
$num_rows++;
|
||||||
}
|
}
|
||||||
} else if ( is_resource( $this->result ) ) {
|
} elseif ( is_resource( $this->result ) ) {
|
||||||
while ( $row = @mysql_fetch_object( $this->result ) ) {
|
while ( $row = @mysql_fetch_object( $this->result ) ) {
|
||||||
$this->last_result[$num_rows] = $row;
|
$this->last_result[$num_rows] = $row;
|
||||||
$num_rows++;
|
$num_rows++;
|
||||||
|
|
|
@ -276,7 +276,7 @@ function retrieve_password() {
|
||||||
|
|
||||||
if ( empty( $_POST['user_login'] ) ) {
|
if ( empty( $_POST['user_login'] ) ) {
|
||||||
$errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
|
$errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.'));
|
||||||
} else if ( strpos( $_POST['user_login'], '@' ) ) {
|
} elseif ( strpos( $_POST['user_login'], '@' ) ) {
|
||||||
$user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
|
$user_data = get_user_by( 'email', trim( $_POST['user_login'] ) );
|
||||||
if ( empty( $user_data ) )
|
if ( empty( $user_data ) )
|
||||||
$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
|
$errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.'));
|
||||||
|
@ -333,10 +333,11 @@ function retrieve_password() {
|
||||||
*/
|
*/
|
||||||
$allow = apply_filters( 'allow_password_reset', true, $user_data->ID );
|
$allow = apply_filters( 'allow_password_reset', true, $user_data->ID );
|
||||||
|
|
||||||
if ( ! $allow )
|
if ( ! $allow ) {
|
||||||
return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
|
return new WP_Error( 'no_password_reset', __('Password reset is not allowed for this user') );
|
||||||
else if ( is_wp_error($allow) )
|
} elseif ( is_wp_error( $allow ) ) {
|
||||||
return $allow;
|
return $allow;
|
||||||
|
}
|
||||||
|
|
||||||
// Generate something random for a password reset key.
|
// Generate something random for a password reset key.
|
||||||
$key = wp_generate_password( 20, false );
|
$key = wp_generate_password( 20, false );
|
||||||
|
|
Loading…
Reference in New Issue