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 = '';
|
||||
if ( isset($page_hook) )
|
||||
if ( isset( $page_hook ) ) {
|
||||
$hook_suffix = $page_hook;
|
||||
else if ( isset($plugin_page) )
|
||||
} elseif ( isset( $plugin_page ) ) {
|
||||
$hook_suffix = $plugin_page;
|
||||
else if ( isset($pagenow) )
|
||||
} elseif ( isset( $pagenow ) ) {
|
||||
$hook_suffix = $pagenow;
|
||||
}
|
||||
|
||||
set_current_screen();
|
||||
|
||||
|
@ -243,7 +244,7 @@ if ( isset($plugin_page) ) {
|
|||
include(ABSPATH . 'wp-admin/admin-footer.php');
|
||||
|
||||
exit();
|
||||
} else if (isset($_GET['import'])) {
|
||||
} elseif ( isset( $_GET['import'] ) ) {
|
||||
|
||||
$importer = $_GET['import'];
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ $title = $tax->labels->name;
|
|||
if ( 'post' != $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";
|
||||
} else if ( 'link_category' == $tax->name ) {
|
||||
} elseif ( 'link_category' == $tax->name ) {
|
||||
$parent_file = 'link-manager.php';
|
||||
$submenu_file = 'edit-tags.php?taxonomy=link_category';
|
||||
} else {
|
||||
|
|
|
@ -60,7 +60,7 @@ if ( isset( $_GET['download'] ) ) {
|
|||
|
||||
if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) {
|
||||
$args['content'] = 'all';
|
||||
} else if ( 'posts' == $_GET['content'] ) {
|
||||
} elseif ( 'posts' == $_GET['content'] ) {
|
||||
$args['content'] = 'post';
|
||||
|
||||
if ( $_GET['cat'] )
|
||||
|
@ -76,7 +76,7 @@ if ( isset( $_GET['download'] ) ) {
|
|||
|
||||
if ( $_GET['post_status'] )
|
||||
$args['status'] = $_GET['post_status'];
|
||||
} else if ( 'pages' == $_GET['content'] ) {
|
||||
} elseif ( 'pages' == $_GET['content'] ) {
|
||||
$args['content'] = 'page';
|
||||
|
||||
if ( $_GET['page_author'] )
|
||||
|
|
|
@ -422,10 +422,11 @@ function _wp_ajax_add_hierarchical_term() {
|
|||
continue;
|
||||
if ( !$cat_id = term_exists( $cat_name, $taxonomy->name, $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;
|
||||
else if ( is_array( $cat_id ) )
|
||||
} elseif ( is_array( $cat_id ) ) {
|
||||
$cat_id = $cat_id['term_id'];
|
||||
}
|
||||
$checked_categories[] = $cat_id;
|
||||
if ( $parent ) // Do these all at once in a second
|
||||
continue;
|
||||
|
@ -741,10 +742,11 @@ function wp_ajax_add_link_category( $action ) {
|
|||
continue;
|
||||
if ( !$cat_id = term_exists( $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;
|
||||
else if ( is_array( $cat_id ) )
|
||||
} elseif ( is_array( $cat_id ) ) {
|
||||
$cat_id = $cat_id['term_id'];
|
||||
}
|
||||
$cat_name = esc_html( $cat_name );
|
||||
$x->add( array(
|
||||
'what' => 'link-category',
|
||||
|
@ -1174,7 +1176,7 @@ function wp_ajax_add_meta() {
|
|||
} else {
|
||||
wp_die( 0 );
|
||||
}
|
||||
} else if ( !$mid = add_meta( $pid ) ) {
|
||||
} elseif ( ! $mid = add_meta( $pid ) ) {
|
||||
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.
|
||||
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>';
|
||||
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>';
|
||||
}
|
||||
} 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['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;
|
||||
} 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++ ) {
|
||||
$key = $match[1]{$j};
|
||||
$out[$key] = true;
|
||||
}
|
||||
|
||||
$last_arg = $key;
|
||||
} else if ( $last_arg !== null ) {
|
||||
} elseif ( $last_arg !== null ) {
|
||||
$out[$last_arg] = $args[$i];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -447,12 +447,13 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
|
|||
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>';
|
||||
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>';
|
||||
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>';
|
||||
}
|
||||
|
||||
if ( ! $this->result || is_wp_error($this->result) ) {
|
||||
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
|
||||
*/
|
||||
public function feedback( $data ) {
|
||||
if ( is_wp_error( $data ) )
|
||||
if ( is_wp_error( $data ) ) {
|
||||
$string = $data->get_error_message();
|
||||
else if ( is_array( $data ) )
|
||||
} elseif ( is_array( $data ) ) {
|
||||
return;
|
||||
else
|
||||
} else {
|
||||
$string = $data;
|
||||
|
||||
}
|
||||
if ( ! empty( $this->upgrader->strings[ $string ] ) )
|
||||
$string = $this->upgrader->strings[ $string ];
|
||||
|
||||
|
|
|
@ -431,7 +431,7 @@ class WP_Upgrader {
|
|||
|
||||
if ( is_wp_error($removed) ) {
|
||||
return $removed;
|
||||
} else if ( ! $removed ) {
|
||||
} elseif ( ! $removed ) {
|
||||
return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']);
|
||||
}
|
||||
} elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists($remote_destination) ) {
|
||||
|
@ -637,7 +637,7 @@ class WP_Upgrader {
|
|||
$maintenance_string = '<?php $upgrading = ' . time() . '; ?>';
|
||||
$wp_filesystem->delete($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');
|
||||
$wp_filesystem->delete($file);
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ function export_wp( $args = array() ) {
|
|||
$cat = get_term( $term['term_id'], 'category' );
|
||||
$cats = array( $cat->term_id => $cat );
|
||||
unset( $term, $cat );
|
||||
} else if ( 'all' == $args['content'] ) {
|
||||
} elseif ( 'all' == $args['content'] ) {
|
||||
$categories = (array) get_categories( 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.
|
||||
$method = 'direct';
|
||||
$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
|
||||
// safely in this directory. This mode doesn't create new files, only alter existing ones.
|
||||
$method = 'direct';
|
||||
|
@ -1038,15 +1038,15 @@ function request_filesystem_credentials($form_post, $type = '', $error = false,
|
|||
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';
|
||||
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';
|
||||
else if ( !empty($_POST['connection_type']) )
|
||||
} elseif ( ! empty( $_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';
|
||||
|
||||
}
|
||||
if ( ! $error &&
|
||||
(
|
||||
( !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'] ) ) {
|
||||
/* 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'] );
|
||||
} else if ( ! empty( $meta['album'] ) ) {
|
||||
} elseif ( ! empty( $meta['album'] ) ) {
|
||||
/* translators: 1: audio track title, 2: album title */
|
||||
$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 */
|
||||
$content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] );
|
||||
} else {
|
||||
$content .= sprintf( __( '"%s".' ), $title );
|
||||
}
|
||||
|
||||
} else if ( ! empty( $meta['album'] ) ) {
|
||||
} elseif ( ! empty( $meta['album'] ) ) {
|
||||
|
||||
if ( ! empty( $meta['artist'] ) ) {
|
||||
/* 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'] . '.';
|
||||
}
|
||||
|
||||
} else if ( ! empty( $meta['artist'] ) ) {
|
||||
} elseif ( ! empty( $meta['artist'] ) ) {
|
||||
|
||||
$content .= $meta['artist'] . '.';
|
||||
|
||||
|
|
|
@ -166,11 +166,11 @@ $datef = __( 'M j, Y @ G:i' );
|
|||
if ( 0 != $post->ID ) {
|
||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||
$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>');
|
||||
} 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>');
|
||||
} 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>');
|
||||
} else { // draft, 1 or more saves, date specified
|
||||
$stamp = __('Publish on: <b>%1$s</b>');
|
||||
|
|
|
@ -145,10 +145,11 @@ function wpmu_delete_blog( $blog_id, $drop = false ) {
|
|||
if ( $file == '.' || $file == '..' )
|
||||
continue;
|
||||
|
||||
if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) )
|
||||
if ( @is_dir( $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 );
|
||||
}
|
||||
}
|
||||
@closedir( $dh );
|
||||
}
|
||||
|
|
|
@ -517,7 +517,7 @@ function install_plugin_information() {
|
|||
<?php
|
||||
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>';
|
||||
} 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>';
|
||||
}
|
||||
|
||||
|
|
|
@ -1652,7 +1652,7 @@ function get_plugin_page_hookname( $plugin_page, $parent_page ) {
|
|||
else
|
||||
if ( isset( $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];
|
||||
}
|
||||
|
||||
|
@ -1713,7 +1713,7 @@ function user_can_access_admin_page() {
|
|||
return true;
|
||||
else
|
||||
return false;
|
||||
} else if ( $submenu_array[2] == $pagenow ) {
|
||||
} elseif ( $submenu_array[2] == $pagenow ) {
|
||||
if ( current_user_can( $submenu_array[1] ))
|
||||
return true;
|
||||
else
|
||||
|
|
|
@ -66,12 +66,12 @@ function wp_create_category( $cat_name, $parent = 0 ) {
|
|||
*/
|
||||
function wp_create_categories( $categories, $post_id = '' ) {
|
||||
$cat_ids = array ();
|
||||
foreach ($categories as $category) {
|
||||
if ($id = category_exists($category))
|
||||
foreach ( $categories as $category ) {
|
||||
if ( $id = category_exists( $category ) ) {
|
||||
$cat_ids[] = $id;
|
||||
else
|
||||
if ($id = wp_create_category($category))
|
||||
$cat_ids[] = $id;
|
||||
} elseif ( $id = wp_create_category( $category ) ) {
|
||||
$cat_ids[] = $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 ) {
|
||||
$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;
|
||||
}
|
||||
|
||||
|
|
|
@ -167,7 +167,7 @@ function get_theme_update_available( $theme ) {
|
|||
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>',
|
||||
$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>',
|
||||
$theme_name, esc_url( $details_url ), esc_attr( $theme['Name'] ), $update['new_version'] );
|
||||
} else {
|
||||
|
|
|
@ -278,13 +278,13 @@ function wp_plugin_update_row( $file, $plugin_data ) {
|
|||
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">';
|
||||
|
||||
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 );
|
||||
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 );
|
||||
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) );
|
||||
|
||||
}
|
||||
/**
|
||||
* Fires at the end of the update message container in each
|
||||
* 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');
|
||||
|
||||
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 );
|
||||
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'] );
|
||||
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) );
|
||||
|
||||
}
|
||||
/**
|
||||
* Fires at the end of the update message container in each
|
||||
* 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);
|
||||
update_user_option($user_id, 'default_password_nag', true, true);
|
||||
$email_password = true;
|
||||
} else if ( !$user_id ) {
|
||||
} elseif ( ! $user_id ) {
|
||||
// Password has been provided
|
||||
$message = '<em>'.__('Your chosen password.').'</em>';
|
||||
$user_id = wp_create_user($user_name, $user_password, $user_email);
|
||||
|
@ -840,7 +840,7 @@ function upgrade_210() {
|
|||
if ( 'static' == $status ) {
|
||||
$status = 'publish';
|
||||
$type = 'page';
|
||||
} else if ( 'attachment' == $status ) {
|
||||
} elseif ( 'attachment' == $status ) {
|
||||
$status = 'inherit';
|
||||
$type = 'attachment';
|
||||
}
|
||||
|
@ -1716,14 +1716,14 @@ function dbDelta( $queries = '', $execute = true ) {
|
|||
|
||||
// Create a tablename index for an array ($cqueries) of queries
|
||||
foreach($queries as $qry) {
|
||||
if (preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {
|
||||
if ( preg_match( "|CREATE TABLE ([^ ]*)|", $qry, $matches ) ) {
|
||||
$cqueries[ trim( $matches[1], '`' ) ] = $qry;
|
||||
$for_update[$matches[1]] = 'Created table '.$matches[1];
|
||||
} else if (preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {
|
||||
array_unshift($cqueries, $qry);
|
||||
} else if (preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {
|
||||
} elseif ( preg_match( "|CREATE DATABASE ([^ ]*)|", $qry, $matches ) ) {
|
||||
array_unshift( $cqueries, $qry );
|
||||
} elseif ( preg_match( "|INSERT INTO ([^ ]*)|", $qry, $matches ) ) {
|
||||
$iqueries[] = $qry;
|
||||
} else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {
|
||||
} elseif ( preg_match( "|UPDATE ([^ ]*)|", $qry, $matches ) ) {
|
||||
$iqueries[] = $qry;
|
||||
} else {
|
||||
// Unrecognized query type
|
||||
|
@ -1875,7 +1875,7 @@ function dbDelta( $queries = '', $execute = true ) {
|
|||
$index_string = '';
|
||||
if ($index_name == 'PRIMARY') {
|
||||
$index_string .= 'PRIMARY ';
|
||||
} else if($index_data['unique']) {
|
||||
} elseif ( $index_data['unique'] ) {
|
||||
$index_string .= 'UNIQUE ';
|
||||
}
|
||||
$index_string .= 'KEY ';
|
||||
|
|
|
@ -254,7 +254,7 @@ switch($step) {
|
|||
// TODO: poka-yoke
|
||||
display_setup_form( __( 'Your passwords do not match. Please try again.' ) );
|
||||
$error = true;
|
||||
} else if ( empty( $admin_email ) ) {
|
||||
} elseif ( empty( $admin_email ) ) {
|
||||
// TODO: poka-yoke
|
||||
display_setup_form( __( 'You must provide an email address.' ) );
|
||||
$error = true;
|
||||
|
|
|
@ -174,7 +174,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
|||
$class[] = 'current';
|
||||
// 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.
|
||||
} else if (
|
||||
} elseif (
|
||||
( ! 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 ) )
|
||||
) {
|
||||
|
|
|
@ -151,12 +151,13 @@ if ( ! empty( $_GET['settings-updated'] ) ) : ?>
|
|||
<div id="message" class="updated"><p><?php
|
||||
if ( ! is_multisite() ) {
|
||||
if ( $iis7_permalinks ) {
|
||||
if ( $permalink_structure && ! $usingpi && ! $writable )
|
||||
if ( $permalink_structure && ! $usingpi && ! $writable ) {
|
||||
_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!');
|
||||
else
|
||||
} else {
|
||||
_e('Permalink structure updated.');
|
||||
}
|
||||
} elseif ( $is_nginx ) {
|
||||
_e('Permalink structure updated.');
|
||||
} else {
|
||||
|
|
|
@ -121,7 +121,7 @@ $comment_type = '';
|
|||
if ( get_option('require_name_email') && !$user->exists() ) {
|
||||
if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) {
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -386,17 +386,18 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
|
|||
} else {
|
||||
$value = esc_attr($value);
|
||||
}
|
||||
} else if ( 'db' == $context ) {
|
||||
} elseif ( 'db' == $context ) {
|
||||
/** This filter is documented in wp-includes/post.php */
|
||||
$value = apply_filters( "pre_$field", $value );
|
||||
} else {
|
||||
/** This filter is documented in wp-includes/post.php */
|
||||
$value = apply_filters( $field, $value, $bookmark_id, $context );
|
||||
|
||||
if ( 'attribute' == $context )
|
||||
$value = esc_attr($value);
|
||||
else if ( 'js' == $context )
|
||||
$value = esc_js($value);
|
||||
if ( 'attribute' == $context ) {
|
||||
$value = esc_attr( $value );
|
||||
} elseif ( 'js' == $context ) {
|
||||
$value = esc_js( $value );
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
|
|
@ -893,12 +893,12 @@ class WP_Http_Streams {
|
|||
|
||||
$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'];
|
||||
unset($r['headers']['User-Agent']);
|
||||
} else if ( isset($r['headers']['user-agent']) ) {
|
||||
unset( $r['headers']['User-Agent'] );
|
||||
} elseif ( isset( $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.
|
||||
|
@ -1358,12 +1358,12 @@ class WP_Http_Curl {
|
|||
|
||||
$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'];
|
||||
unset($r['headers']['User-Agent']);
|
||||
} else if ( isset($r['headers']['user-agent']) ) {
|
||||
unset( $r['headers']['User-Agent'] );
|
||||
} elseif ( isset( $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.
|
||||
|
@ -2244,7 +2244,7 @@ class WP_Http_Encoding {
|
|||
if ( is_array( $headers ) ) {
|
||||
if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) )
|
||||
return true;
|
||||
} else if ( is_string( $headers ) ) {
|
||||
} elseif ( is_string( $headers ) ) {
|
||||
return ( stripos($headers, 'content-encoding:') !== false );
|
||||
}
|
||||
|
||||
|
|
|
@ -3211,10 +3211,11 @@ class wp_xmlrpc_server extends IXR_Server {
|
|||
|
||||
if ( !$user ) {
|
||||
$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' ) );
|
||||
else if ( !$allow_anon )
|
||||
} elseif ( ! $allow_anon ) {
|
||||
return $this->error;
|
||||
}
|
||||
} else {
|
||||
$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;
|
||||
|
||||
if ( ('publish' == $post_status) ) {
|
||||
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.'));
|
||||
else if ( !current_user_can('publish_posts') )
|
||||
return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.'));
|
||||
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.' ) );
|
||||
} elseif ( ! current_user_can( 'publish_posts' ) ) {
|
||||
return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) );
|
||||
}
|
||||
}
|
||||
|
||||
if ( $post_more )
|
||||
|
|
|
@ -135,11 +135,11 @@ class WP {
|
|||
$this->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;
|
||||
else if (! empty($extra_query_vars))
|
||||
parse_str($extra_query_vars, $this->extra_query_vars);
|
||||
|
||||
} elseif ( ! empty( $extra_query_vars ) ) {
|
||||
parse_str( $extra_query_vars, $this->extra_query_vars );
|
||||
}
|
||||
// Process PATH_INFO, REQUEST_URI, and 404 for permalinks.
|
||||
|
||||
// Fetch the rewrite rules.
|
||||
|
@ -357,7 +357,7 @@ class WP {
|
|||
} elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) {
|
||||
$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');
|
||||
} else {
|
||||
// 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 ) {
|
||||
$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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -506,7 +506,7 @@ class WP_Comment_Query {
|
|||
// Disable ORDER BY with 'none', an empty array, or boolean false.
|
||||
if ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) {
|
||||
$orderby = '';
|
||||
} else if ( ! empty( $this->query_vars['orderby'] ) ) {
|
||||
} elseif ( ! empty( $this->query_vars['orderby'] ) ) {
|
||||
$ordersby = is_array( $this->query_vars['orderby'] ) ?
|
||||
$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'] ) ) {
|
||||
$data['comment_approved'] = 1;
|
||||
} else if ( 'hold' == $data['comment_approved'] ) {
|
||||
} elseif ( 'hold' == $data['comment_approved'] ) {
|
||||
$data['comment_approved'] = 0;
|
||||
} else if ( 'approve' == $data['comment_approved'] ) {
|
||||
} elseif ( 'approve' == $data['comment_approved'] ) {
|
||||
$data['comment_approved'] = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -425,7 +425,7 @@ class WP_Date_Query {
|
|||
$valid = false;
|
||||
}
|
||||
|
||||
} else if ( $day_exists && $month_exists ) {
|
||||
} elseif ( $day_exists && $month_exists ) {
|
||||
/*
|
||||
* 2. checking day, month combination
|
||||
* 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 ) {
|
||||
if ( 'relation' === $key ) {
|
||||
$relation = $query['relation'];
|
||||
} else if ( is_array( $clause ) ) {
|
||||
} elseif ( is_array( $clause ) ) {
|
||||
|
||||
// This is a first-order clause.
|
||||
if ( $this->is_first_order_clause( $clause ) ) {
|
||||
|
@ -616,7 +616,7 @@ class WP_Date_Query {
|
|||
$where_count = count( $clause_sql['where'] );
|
||||
if ( ! $where_count ) {
|
||||
$sql_chunks['where'][] = '';
|
||||
} else if ( 1 === $where_count ) {
|
||||
} elseif ( 1 === $where_count ) {
|
||||
$sql_chunks['where'][] = $clause_sql['where'][0];
|
||||
} else {
|
||||
$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'] ) )
|
||||
$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";
|
||||
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";
|
||||
|
||||
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";
|
||||
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";
|
||||
|
||||
}
|
||||
if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) )
|
||||
$where_parts[] = "DAYOFYEAR( $column ) $compare $value";
|
||||
|
||||
|
@ -858,14 +858,14 @@ class WP_Date_Query {
|
|||
'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
|
||||
$datetime = array(
|
||||
'year' => intval( $matches[1] ),
|
||||
'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
|
||||
$datetime = array(
|
||||
'year' => intval( $matches[1] ),
|
||||
|
@ -873,7 +873,7 @@ class WP_Date_Query {
|
|||
'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
|
||||
$datetime = array(
|
||||
'year' => intval( $matches[1] ),
|
||||
|
|
|
@ -2396,7 +2396,7 @@ function update_usermeta( $user_id, $meta_key, $meta_value ) {
|
|||
|
||||
if ( !$cur )
|
||||
$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') );
|
||||
else
|
||||
return false;
|
||||
|
|
|
@ -1502,7 +1502,7 @@ function force_balance_tags( $text ) {
|
|||
// or close to be safe $tag = '/' . $tag;
|
||||
}
|
||||
// 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
|
||||
// Pop
|
||||
array_pop( $tagstack );
|
||||
|
@ -2337,7 +2337,7 @@ function iso8601_to_datetime($date_string, $timezone = 'user') {
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1437,7 +1437,7 @@ function wp_get_referer() {
|
|||
$ref = false;
|
||||
if ( ! empty( $_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'] );
|
||||
|
||||
if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) )
|
||||
|
@ -1670,11 +1670,11 @@ function wp_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');
|
||||
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' );
|
||||
|
||||
}
|
||||
// check tmp file for read/write capabilities
|
||||
$should_delete_tmp_file = !file_exists( $path );
|
||||
$f = @fopen( $path, 'a' );
|
||||
|
|
|
@ -594,7 +594,7 @@ function load_plugin_textdomain( $domain, $deprecated = false, $plugin_rel_path
|
|||
|
||||
if ( false !== $plugin_rel_path ) {
|
||||
$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
|
||||
} else if ( false !== $deprecated ) {
|
||||
} elseif ( false !== $deprecated ) {
|
||||
_deprecated_argument( __FUNCTION__, '2.7' );
|
||||
$path = ABSPATH . trim( $deprecated, '/' );
|
||||
} else {
|
||||
|
|
|
@ -59,7 +59,7 @@ function wp_fix_server_vars() {
|
|||
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
|
||||
}
|
||||
// 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'];
|
||||
} else {
|
||||
// Use ORIG_PATH_INFO if there is no PATH_INFO
|
||||
|
@ -427,7 +427,7 @@ function wp_start_object_cache() {
|
|||
}
|
||||
|
||||
$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
|
||||
* 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.
|
||||
*/
|
||||
function get_attachment_taxonomies($attachment) {
|
||||
if ( is_int( $attachment ) )
|
||||
$attachment = get_post($attachment);
|
||||
else if ( is_array($attachment) )
|
||||
if ( is_int( $attachment ) ) {
|
||||
$attachment = get_post( $attachment );
|
||||
} elseif ( is_array( $attachment ) ) {
|
||||
$attachment = (object) $attachment;
|
||||
|
||||
}
|
||||
if ( ! is_object($attachment) )
|
||||
return array();
|
||||
|
||||
|
|
|
@ -995,11 +995,11 @@ class WP_Meta_Query {
|
|||
if ( 'relation' === $key ) {
|
||||
$relation = $query;
|
||||
|
||||
} else if ( ! is_array( $query ) ) {
|
||||
} elseif ( ! is_array( $query ) ) {
|
||||
continue;
|
||||
|
||||
// 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'] ) {
|
||||
unset( $query['value'] );
|
||||
}
|
||||
|
@ -1029,7 +1029,7 @@ class WP_Meta_Query {
|
|||
* This value will not actually be used to join clauses, but it
|
||||
* simplifies the logic around combining key-only queries.
|
||||
*/
|
||||
} else if ( 1 === count( $clean_queries ) ) {
|
||||
} elseif ( 1 === count( $clean_queries ) ) {
|
||||
$clean_queries['relation'] = 'OR';
|
||||
|
||||
// Default to AND.
|
||||
|
@ -1093,11 +1093,11 @@ class WP_Meta_Query {
|
|||
$primary_meta_query,
|
||||
$existing_meta_query,
|
||||
);
|
||||
} else if ( ! empty( $primary_meta_query ) ) {
|
||||
} elseif ( ! empty( $primary_meta_query ) ) {
|
||||
$meta_query = array(
|
||||
$primary_meta_query,
|
||||
);
|
||||
} else if ( ! empty( $existing_meta_query ) ) {
|
||||
} elseif ( ! empty( $existing_meta_query ) ) {
|
||||
$meta_query = $existing_meta_query;
|
||||
}
|
||||
|
||||
|
@ -1254,7 +1254,7 @@ class WP_Meta_Query {
|
|||
foreach ( $query as $key => &$clause ) {
|
||||
if ( 'relation' === $key ) {
|
||||
$relation = $query['relation'];
|
||||
} else if ( is_array( $clause ) ) {
|
||||
} elseif ( is_array( $clause ) ) {
|
||||
|
||||
// This is a first-order clause.
|
||||
if ( $this->is_first_order_clause( $clause ) ) {
|
||||
|
@ -1263,7 +1263,7 @@ class WP_Meta_Query {
|
|||
$where_count = count( $clause_sql['where'] );
|
||||
if ( ! $where_count ) {
|
||||
$sql_chunks['where'][] = '';
|
||||
} else if ( 1 === $where_count ) {
|
||||
} elseif ( 1 === $where_count ) {
|
||||
$sql_chunks['where'][] = $clause_sql['where'][0];
|
||||
} else {
|
||||
$sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )';
|
||||
|
@ -1492,7 +1492,7 @@ class WP_Meta_Query {
|
|||
$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.
|
||||
} 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' );
|
||||
}
|
||||
|
||||
|
|
|
@ -806,7 +806,7 @@ function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_
|
|||
'post_type' == $menu_item_type
|
||||
) {
|
||||
$menu_item_ids[] = (int) $menu_item->ID;
|
||||
} else if (
|
||||
} elseif (
|
||||
'taxonomy' == $object_type &&
|
||||
'taxonomy' == $menu_item_type &&
|
||||
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 ( false === $priority ) {
|
||||
$wp_filter[ $tag ] = array();
|
||||
} else if ( isset( $wp_filter[ $tag ][ $priority ] ) ) {
|
||||
} elseif ( isset( $wp_filter[ $tag ][ $priority ] ) ) {
|
||||
$wp_filter[ $tag ][ $priority ] = array();
|
||||
}
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
|
|||
|
||||
return $obj_idx;
|
||||
}
|
||||
} else if ( is_string($function[0]) ) {
|
||||
} elseif ( is_string( $function[0] ) ) {
|
||||
// Static Calling
|
||||
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 );
|
||||
$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.
|
||||
|
@ -566,7 +566,7 @@ function get_body_class( $class = '' ) {
|
|||
if ( is_array( $post_type ) )
|
||||
$post_type = reset( $post_type );
|
||||
$classes[] = 'post-type-archive-' . sanitize_html_class( $post_type );
|
||||
} else if ( is_author() ) {
|
||||
} elseif ( is_author() ) {
|
||||
$author = $wp_query->get_queried_object();
|
||||
$classes[] = 'author';
|
||||
if ( isset( $author->user_nicename ) ) {
|
||||
|
|
|
@ -2184,7 +2184,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
|||
} else {
|
||||
$value = esc_attr($value);
|
||||
}
|
||||
} else if ( 'db' == $context ) {
|
||||
} elseif ( 'db' == $context ) {
|
||||
if ( $prefixed ) {
|
||||
|
||||
/**
|
||||
|
@ -2252,7 +2252,7 @@ function sanitize_post_field($field, $value, $post_id, $context) {
|
|||
|
||||
if ( 'attribute' == $context )
|
||||
$value = esc_attr($value);
|
||||
else if ( 'js' == $context )
|
||||
elseif ( 'js' == $context )
|
||||
$value = esc_js($value);
|
||||
|
||||
return $value;
|
||||
|
@ -3907,7 +3907,7 @@ function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $appe
|
|||
} else {
|
||||
$post_categories = array();
|
||||
}
|
||||
} else if ( 1 == count($post_categories) && '' == reset($post_categories) ) {
|
||||
} elseif ( 1 == count( $post_categories ) && '' == reset( $post_categories ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1654,9 +1654,9 @@ class WP_Query {
|
|||
$this->is_date = true;
|
||||
if ( strlen($qv['m']) > 9 ) {
|
||||
$this->is_time = true;
|
||||
} else if ( strlen($qv['m']) > 7 ) {
|
||||
} elseif ( strlen( $qv['m'] ) > 7 ) {
|
||||
$this->is_day = true;
|
||||
} else if ( strlen($qv['m']) > 5 ) {
|
||||
} elseif ( strlen( $qv['m'] ) > 5 ) {
|
||||
$this->is_month = true;
|
||||
} else {
|
||||
$this->is_year = true;
|
||||
|
@ -1956,7 +1956,7 @@ class WP_Query {
|
|||
$tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db');
|
||||
$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']);
|
||||
foreach ( (array) $tags as $tag ) {
|
||||
$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'];
|
||||
if ( $q['posts_per_page'] < -1 )
|
||||
$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;
|
||||
|
||||
if ( !isset($q['comments_per_page']) || $q['comments_per_page'] == 0 )
|
||||
|
@ -4350,7 +4350,7 @@ class WP_Query {
|
|||
return true;
|
||||
} elseif ( in_array( $page_obj->post_title, $page ) ) {
|
||||
return true;
|
||||
} else if ( in_array( $page_obj->post_name, $page ) ) {
|
||||
} elseif ( in_array( $page_obj->post_name, $page ) ) {
|
||||
return true;
|
||||
} else {
|
||||
foreach ( $page as $pagepath ) {
|
||||
|
@ -4568,7 +4568,7 @@ class WP_Query {
|
|||
*/
|
||||
if ( $post->ID === get_queried_object_id() && ( $this->is_page() || $this->is_single() ) ) {
|
||||
$more = 1;
|
||||
} else if ( $this->is_feed() ) {
|
||||
} elseif ( $this->is_feed() ) {
|
||||
$more = 1;
|
||||
} else {
|
||||
$more = 0;
|
||||
|
|
|
@ -1376,11 +1376,11 @@ class WP_Rewrite {
|
|||
$rewrite = array_merge($rewrite, array($pagematch => $pagequery));
|
||||
|
||||
//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));
|
||||
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));
|
||||
|
||||
}
|
||||
//do endpoints
|
||||
if ( $endpoints ) {
|
||||
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)) {
|
||||
$located = STYLESHEETPATH . '/' . $template_name;
|
||||
break;
|
||||
} else if ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
|
||||
} elseif ( file_exists(TEMPLATEPATH . '/' . $template_name) ) {
|
||||
$located = TEMPLATEPATH . '/' . $template_name;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -630,7 +630,7 @@ class WP_User_Query {
|
|||
$orderby = 'ID';
|
||||
} elseif ( 'meta_value' == $qv['orderby'] ) {
|
||||
$orderby = "$wpdb->usermeta.meta_value";
|
||||
} else if ( 'include' === $qv['orderby'] && ! empty( $include ) ) {
|
||||
} elseif ( 'include' === $qv['orderby'] && ! empty( $include ) ) {
|
||||
// Sanitized earlier.
|
||||
$include_sql = implode( ',', $include );
|
||||
$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?
|
||||
else
|
||||
$value = esc_attr($value);
|
||||
} else if ( 'db' == $context ) {
|
||||
} elseif ( 'db' == $context ) {
|
||||
if ( $prefixed ) {
|
||||
/** This filter is documented in wp-includes/post.php */
|
||||
$value = apply_filters( "pre_{$field}", $value );
|
||||
|
@ -1559,11 +1559,11 @@ function sanitize_user_field($field, $value, $user_id, $context) {
|
|||
if ( 'user_url' == $field )
|
||||
$value = esc_url($value);
|
||||
|
||||
if ( 'attribute' == $context )
|
||||
$value = esc_attr($value);
|
||||
else if ( 'js' == $context )
|
||||
$value = esc_js($value);
|
||||
|
||||
if ( 'attribute' == $context ) {
|
||||
$value = esc_attr( $value );
|
||||
} elseif ( 'js' == $context ) {
|
||||
$value = esc_js( $value );
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @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.
|
||||
|
|
|
@ -1366,7 +1366,7 @@ class wpdb {
|
|||
while ( mysqli_more_results( $this->dbh ) ) {
|
||||
mysqli_next_result( $this->dbh );
|
||||
}
|
||||
} else if ( is_resource( $this->result ) ) {
|
||||
} elseif ( is_resource( $this->result ) ) {
|
||||
mysql_free_result( $this->result );
|
||||
}
|
||||
}
|
||||
|
@ -1435,9 +1435,9 @@ class wpdb {
|
|||
|
||||
if ( $this->has_connected ) {
|
||||
$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;
|
||||
} else if ( ! function_exists( 'mysql_connect' ) ) {
|
||||
} elseif ( ! function_exists( 'mysql_connect' ) ) {
|
||||
$attempt_fallback = false;
|
||||
}
|
||||
|
||||
|
@ -1475,7 +1475,7 @@ class wpdb {
|
|||
" ), htmlspecialchars( $this->dbhost, ENT_QUOTES ) ), 'db_connect_fail' );
|
||||
|
||||
return false;
|
||||
} else if ( $this->dbh ) {
|
||||
} elseif ( $this->dbh ) {
|
||||
$this->has_connected = true;
|
||||
$this->set_charset( $this->dbh );
|
||||
$this->ready = true;
|
||||
|
@ -1673,7 +1673,7 @@ class wpdb {
|
|||
$this->last_result[$num_rows] = $row;
|
||||
$num_rows++;
|
||||
}
|
||||
} else if ( is_resource( $this->result ) ) {
|
||||
} elseif ( is_resource( $this->result ) ) {
|
||||
while ( $row = @mysql_fetch_object( $this->result ) ) {
|
||||
$this->last_result[$num_rows] = $row;
|
||||
$num_rows++;
|
||||
|
|
|
@ -276,7 +276,7 @@ function retrieve_password() {
|
|||
|
||||
if ( empty( $_POST['user_login'] ) ) {
|
||||
$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'] ) );
|
||||
if ( empty( $user_data ) )
|
||||
$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 );
|
||||
|
||||
if ( ! $allow )
|
||||
return new WP_Error('no_password_reset', __('Password reset is not allowed for this user'));
|
||||
else if ( is_wp_error($allow) )
|
||||
if ( ! $allow ) {
|
||||
return new WP_Error( 'no_password_reset', __('Password reset is not allowed for this user') );
|
||||
} elseif ( is_wp_error( $allow ) ) {
|
||||
return $allow;
|
||||
}
|
||||
|
||||
// Generate something random for a password reset key.
|
||||
$key = wp_generate_password( 20, false );
|
||||
|
|
Loading…
Reference in New Issue