`if` is a statment, not a function.

See #32444.

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


git-svn-id: http://core.svn.wordpress.org/trunk@32771 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-06-16 20:01:25 +00:00
parent 5e14470894
commit 5c6b63d3a6
24 changed files with 42 additions and 42 deletions

View File

@ -472,7 +472,7 @@ class WP_Comments_List_Table extends WP_List_Table {
$out = ''; $out = '';
if( $primary === $column_name ) { if ( $primary === $column_name ) {
$del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) ); $del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) ); $approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );

View File

@ -286,7 +286,7 @@ class WP_Links_List_Table extends WP_List_Table {
* @return string Row action output for links. * @return string Row action output for links.
*/ */
protected function handle_row_actions( $link, $column_name, $primary ) { protected function handle_row_actions( $link, $column_name, $primary ) {
if( $primary === $column_name ) { if ( $primary === $column_name ) {
$edit_link = get_edit_bookmark_link( $link ); $edit_link = get_edit_bookmark_link( $link );
$actions = array(); $actions = array();

View File

@ -634,7 +634,7 @@ class WP_List_Table {
public function get_pagenum() { public function get_pagenum() {
$pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0; $pagenum = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 0;
if( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] ) if ( isset( $this->_pagination_args['total_pages'] ) && $pagenum > $this->_pagination_args['total_pages'] )
$pagenum = $this->_pagination_args['total_pages']; $pagenum = $this->_pagination_args['total_pages'];
return max( 1, $pagenum ); return max( 1, $pagenum );

View File

@ -633,7 +633,7 @@ class WP_Media_List_Table extends WP_List_Table {
* @return string Row action output for links. * @return string Row action output for links.
*/ */
protected function handle_row_actions( $link, $column_name, $primary ) { protected function handle_row_actions( $link, $column_name, $primary ) {
if( $primary === $column_name ) { if ( $primary === $column_name ) {
return $this->row_actions( $this->_get_row_actions( $post, $att_title ) ); return $this->row_actions( $this->_get_row_actions( $post, $att_title ) );
} }
} }

View File

@ -1045,7 +1045,7 @@ class WP_Press_This {
if ( ! empty( $data['t'] ) ) { if ( ! empty( $data['t'] ) ) {
$title = $data['t']; $title = $data['t'];
} elseif( ! empty( $data['_meta'] ) ) { } elseif ( ! empty( $data['_meta'] ) ) {
if ( ! empty( $data['_meta']['twitter:title'] ) ) { if ( ! empty( $data['_meta']['twitter:title'] ) ) {
$title = $data['_meta']['twitter:title']; $title = $data['_meta']['twitter:title'];
} else if ( ! empty( $data['_meta']['og:title'] ) ) { } else if ( ! empty( $data['_meta']['og:title'] ) ) {

View File

@ -572,9 +572,9 @@ class WP_User_Search {
function do_paging() { function do_paging() {
if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results if ( $this->total_users_for_query > $this->users_per_page ) { // have to page the results
$args = array(); $args = array();
if( ! empty($this->search_term) ) if ( ! empty($this->search_term) )
$args['usersearch'] = urlencode($this->search_term); $args['usersearch'] = urlencode($this->search_term);
if( ! empty($this->role) ) if ( ! empty($this->role) )
$args['role'] = urlencode($this->role); $args['role'] = urlencode($this->role);
$this->paging_text = paginate_links( array( $this->paging_text = paginate_links( array(

View File

@ -139,7 +139,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
</dl> </dl>
<div class="menu-item-settings" id="menu-item-settings-<?php echo $item_id; ?>"> <div class="menu-item-settings" id="menu-item-settings-<?php echo $item_id; ?>">
<?php if( 'custom' == $item->type ) : ?> <?php if ( 'custom' == $item->type ) : ?>
<p class="field-url description description-wide"> <p class="field-url description description-wide">
<label for="edit-menu-item-url-<?php echo $item_id; ?>"> <label for="edit-menu-item-url-<?php echo $item_id; ?>">
<?php _e( 'URL' ); ?><br /> <?php _e( 'URL' ); ?><br />
@ -197,7 +197,7 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
</p> </p>
<div class="menu-item-actions description-wide submitbox"> <div class="menu-item-actions description-wide submitbox">
<?php if( 'custom' != $item->type && $original_title !== false ) : ?> <?php if ( 'custom' != $item->type && $original_title !== false ) : ?>
<p class="link-to-original"> <p class="link-to-original">
<?php printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?> <?php printf( __('Original: %s'), '<a href="' . esc_attr( $item->url ) . '">' . esc_html( $original_title ) . '</a>' ); ?>
</p> </p>
@ -459,7 +459,7 @@ function wp_nav_menu_setup() {
add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' ); add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns' );
// If first time editing, disable advanced items by default. // If first time editing, disable advanced items by default.
if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { if ( false === get_user_option( 'managenav-menuscolumnshidden' ) ) {
$user = wp_get_current_user(); $user = wp_get_current_user();
update_user_option($user->ID, 'managenav-menuscolumnshidden', update_user_option($user->ID, 'managenav-menuscolumnshidden',
array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', 4 => 'title-attribute', ), array( 0 => 'link-target', 1 => 'css-classes', 2 => 'xfn', 3 => 'description', 4 => 'title-attribute', ),
@ -1180,7 +1180,7 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) {
$result .= '<p>' . __( 'Add menu items from the column on the left.' ) . '</p>'; $result .= '<p>' . __( 'Add menu items from the column on the left.' ) . '</p>';
$result .= '</div>'; $result .= '</div>';
if( empty($menu_items) ) if ( empty($menu_items) )
return $result . ' <ul class="menu" id="menu-to-edit"> </ul>'; return $result . ' <ul class="menu" id="menu-to-edit"> </ul>';
/** /**

View File

@ -1318,7 +1318,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
} }
if ( isset( $view_post ) ) { if ( isset( $view_post ) ) {
if( 'draft' == $post->post_status ) { if ( 'draft' == $post->post_status ) {
$preview_link = set_url_scheme( get_permalink( $post->ID ) ); $preview_link = set_url_scheme( get_permalink( $post->ID ) );
/** This filter is documented in wp-admin/includes/meta-boxes.php */ /** This filter is documented in wp-admin/includes/meta-boxes.php */
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );

View File

@ -58,7 +58,7 @@ function network_domain_check() {
*/ */
function allow_subdomain_install() { function allow_subdomain_install() {
$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) ); $domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'home' ) );
if( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) ) if ( parse_url( get_option( 'home' ), PHP_URL_PATH ) || 'localhost' == $domain || preg_match( '|^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$|', $domain ) )
return false; return false;
return true; return true;

View File

@ -504,7 +504,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
&& ( $post_type_object->public ) && ( $post_type_object->public )
&& ( $post_type_object->show_in_admin_bar ) ) && ( $post_type_object->show_in_admin_bar ) )
{ {
if( 'draft' == $post->post_status ) { if ( 'draft' == $post->post_status ) {
$preview_link = set_url_scheme( get_permalink( $post->ID ) ); $preview_link = set_url_scheme( get_permalink( $post->ID ) );
/** This filter is documented in wp-admin/includes/meta-boxes.php */ /** This filter is documented in wp-admin/includes/meta-boxes.php */
$preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );

View File

@ -136,7 +136,7 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
try { try {
$this->image = new Imagick( $this->file ); $this->image = new Imagick( $this->file );
if( ! $this->image->valid() ) if ( ! $this->image->valid() )
return new WP_Error( 'invalid_image', __('File is not an image.'), $this->file); return new WP_Error( 'invalid_image', __('File is not an image.'), $this->file);
// Select the first frame to handle animated images properly // Select the first frame to handle animated images properly

View File

@ -348,7 +348,7 @@ abstract class WP_Image_Editor {
$info = pathinfo( $filename ); $info = pathinfo( $filename );
$dir = $info['dirname']; $dir = $info['dirname'];
if( isset( $info['extension'] ) ) if ( isset( $info['extension'] ) )
$ext = $info['extension']; $ext = $info['extension'];
$filename = trailingslashit( $dir ) . wp_basename( $filename, ".$ext" ) . ".{$new_ext}"; $filename = trailingslashit( $dir ) . wp_basename( $filename, ".$ext" ) . ".{$new_ext}";

View File

@ -3962,12 +3962,12 @@ class wp_xmlrpc_server extends IXR_Server {
/** This action is documented in wp-includes/class-wp-xmlrpc-server.php */ /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
do_action( 'xmlrpc_call', 'wp.getPostType' ); do_action( 'xmlrpc_call', 'wp.getPostType' );
if( ! post_type_exists( $post_type_name ) ) if ( ! post_type_exists( $post_type_name ) )
return new IXR_Error( 403, __( 'Invalid post type' ) ); return new IXR_Error( 403, __( 'Invalid post type' ) );
$post_type = get_post_type_object( $post_type_name ); $post_type = get_post_type_object( $post_type_name );
if( ! current_user_can( $post_type->cap->edit_posts ) ) if ( ! current_user_can( $post_type->cap->edit_posts ) )
return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post type.' ) ); return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post type.' ) );
return $this->_prepare_post_type( $post_type, $fields ); return $this->_prepare_post_type( $post_type, $fields );
@ -4019,7 +4019,7 @@ class wp_xmlrpc_server extends IXR_Server {
$struct = array(); $struct = array();
foreach( $post_types as $post_type ) { foreach( $post_types as $post_type ) {
if( ! current_user_can( $post_type->cap->edit_posts ) ) if ( ! current_user_can( $post_type->cap->edit_posts ) )
continue; continue;
$struct[$post_type->name] = $this->_prepare_post_type( $post_type, $fields ); $struct[$post_type->name] = $this->_prepare_post_type( $post_type, $fields );

View File

@ -17,7 +17,7 @@ function wp_initial_constants() {
// set memory limits // set memory limits
if ( !defined('WP_MEMORY_LIMIT') ) { if ( !defined('WP_MEMORY_LIMIT') ) {
if( is_multisite() ) { if ( is_multisite() ) {
define('WP_MEMORY_LIMIT', '64M'); define('WP_MEMORY_LIMIT', '64M');
} else { } else {
define('WP_MEMORY_LIMIT', '40M'); define('WP_MEMORY_LIMIT', '40M');

View File

@ -43,7 +43,7 @@ do_action( 'rss_tag_pre', 'atom-comments' );
<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php comments_link_feed(); ?>" /> <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php comments_link_feed(); ?>" />
<link rel="self" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?>" /> <link rel="self" type="application/atom+xml" href="<?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?>" />
<id><?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?></id> <id><?php echo esc_url( get_post_comments_feed_link('', 'atom') ); ?></id>
<?php } elseif(is_search()) { ?> <?php } elseif (is_search()) { ?>
<link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo home_url() . '?s=' . get_search_query(); ?>" /> <link rel="alternate" type="<?php bloginfo_rss('html_type'); ?>" href="<?php echo home_url() . '?s=' . get_search_query(); ?>" />
<link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" /> <link rel="self" type="application/atom+xml" href="<?php echo get_search_comments_feed_link('', 'atom'); ?>" />
<id><?php echo get_search_comments_feed_link('', 'atom'); ?></id> <id><?php echo get_search_comments_feed_link('', 'atom'); ?></id>

View File

@ -109,7 +109,7 @@ function get_last_build_date_feed() {
$postids = implode( "','", $post_ids ); $postids = implode( "','", $post_ids );
$max_post_time = max( $post_times ); $max_post_time = max( $post_times );
if( $wp_query->is_comment_feed() ) { if ( $wp_query->is_comment_feed() ) {
$max_comment_time = $wpdb->get_var( $wpdb->prepare( "SELECT MAX(comment_date_gmt) FROM $wpdb->comments WHERE comment_post_ID IN ('%s') AND comment_approved = '1'", $postids ) ); $max_comment_time = $wpdb->get_var( $wpdb->prepare( "SELECT MAX(comment_date_gmt) FROM $wpdb->comments WHERE comment_post_ID IN ('%s') AND comment_approved = '1'", $postids ) );
return max( $max_post_time, $max_comment_time ); return max( $max_post_time, $max_comment_time );

View File

@ -1582,7 +1582,7 @@ function force_balance_tags( $text ) {
if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag
$tag = strtolower(substr($regex[1],1)); $tag = strtolower(substr($regex[1],1));
// if too many closing tags // if too many closing tags
if( $stacksize <= 0 ) { if ( $stacksize <= 0 ) {
$tag = ''; $tag = '';
// or close to be safe $tag = '/' . $tag; // or close to be safe $tag = '/' . $tag;
} }
@ -1637,7 +1637,7 @@ function force_balance_tags( $text ) {
// Attributes // Attributes
$attributes = $regex[2]; $attributes = $regex[2];
if( ! empty( $attributes ) && $attributes[0] != '>' ) if ( ! empty( $attributes ) && $attributes[0] != '>' )
$attributes = ' ' . $attributes; $attributes = ' ' . $attributes;
$tag = '<' . $tag . $attributes . '>'; $tag = '<' . $tag . $attributes . '>';
@ -2742,7 +2742,7 @@ function ent2ncr( $text ) {
* @param string $text The text prior to entity conversion. * @param string $text The text prior to entity conversion.
*/ */
$filtered = apply_filters( 'pre_ent2ncr', null, $text ); $filtered = apply_filters( 'pre_ent2ncr', null, $text );
if( null !== $filtered ) if ( null !== $filtered )
return $filtered; return $filtered;
$to_ncr = array( $to_ncr = array(

View File

@ -1484,7 +1484,7 @@ function wp_mkdir_p( $target ) {
$wrapper = null; $wrapper = null;
// Strip the protocol. // Strip the protocol.
if( wp_is_stream( $target ) ) { if ( wp_is_stream( $target ) ) {
list( $wrapper, $target ) = explode( '://', $target, 2 ); list( $wrapper, $target ) = explode( '://', $target, 2 );
} }
@ -1492,7 +1492,7 @@ function wp_mkdir_p( $target ) {
$target = str_replace( '//', '/', $target ); $target = str_replace( '//', '/', $target );
// Put the wrapper back on the target. // Put the wrapper back on the target.
if( $wrapper !== null ) { if ( $wrapper !== null ) {
$target = $wrapper . '://' . $target; $target = $wrapper . '://' . $target;
} }

View File

@ -11,7 +11,7 @@
define( 'SHORTINIT', true ); define( 'SHORTINIT', true );
require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' ); require_once( dirname( dirname( __FILE__ ) ) . '/wp-load.php' );
if( !is_multisite() ) if ( !is_multisite() )
die( 'Multisite support not enabled' ); die( 'Multisite support not enabled' );
ms_file_constants(); ms_file_constants();
@ -30,10 +30,10 @@ if ( !is_file( $file ) ) {
} }
$mime = wp_check_filetype( $file ); $mime = wp_check_filetype( $file );
if( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) ) if ( false === $mime[ 'type' ] && function_exists( 'mime_content_type' ) )
$mime[ 'type' ] = mime_content_type( $file ); $mime[ 'type' ] = mime_content_type( $file );
if( $mime[ 'type' ] ) if ( $mime[ 'type' ] )
$mimetype = $mime[ 'type' ]; $mimetype = $mime[ 'type' ];
else else
$mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 ); $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 );
@ -60,7 +60,7 @@ header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' );
// Support for Conditional GET - use stripslashes to avoid formatting.php dependency // Support for Conditional GET - use stripslashes to avoid formatting.php dependency
$client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false; $client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false;
if( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) if ( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) )
$_SERVER['HTTP_IF_MODIFIED_SINCE'] = false; $_SERVER['HTTP_IF_MODIFIED_SINCE'] = false;
$client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ); $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] );

View File

@ -1863,7 +1863,7 @@ function global_terms( $term_id, $deprecated = '' ) {
clean_term_cache($term_id); clean_term_cache($term_id);
} }
if( $recurse_start ) if ( $recurse_start )
$global_terms_recurse = null; $global_terms_recurse = null;
return $global_id; return $global_id;

View File

@ -409,7 +409,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
try { try {
// Break $recipient into name and address parts if in the format "Foo <bar@baz.com>" // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
$recipient_name = ''; $recipient_name = '';
if( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) { if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) {
if ( count( $matches ) == 3 ) { if ( count( $matches ) == 3 ) {
$recipient_name = $matches[1]; $recipient_name = $matches[1];
$recipient = $matches[2]; $recipient = $matches[2];
@ -431,7 +431,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
try { try {
// Break $recipient into name and address parts if in the format "Foo <bar@baz.com>" // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
$recipient_name = ''; $recipient_name = '';
if( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) { if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) {
if ( count( $matches ) == 3 ) { if ( count( $matches ) == 3 ) {
$recipient_name = $matches[1]; $recipient_name = $matches[1];
$recipient = $matches[2]; $recipient = $matches[2];
@ -449,7 +449,7 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array()
try { try {
// Break $recipient into name and address parts if in the format "Foo <bar@baz.com>" // Break $recipient into name and address parts if in the format "Foo <bar@baz.com>"
$recipient_name = ''; $recipient_name = '';
if( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) { if ( preg_match( '/(.*)<(.+)>/', $recipient, $matches ) ) {
if ( count( $matches ) == 3 ) { if ( count( $matches ) == 3 ) {
$recipient_name = $matches[1]; $recipient_name = $matches[1];
$recipient = $matches[2]; $recipient = $matches[2];

View File

@ -3294,7 +3294,7 @@ function wp_insert_post( $postarr, $wp_error = false ) {
if ( mysql2date('U', $post_date_gmt, false) > mysql2date('U', $now, false) ) { if ( mysql2date('U', $post_date_gmt, false) > mysql2date('U', $now, false) ) {
$post_status = 'future'; $post_status = 'future';
} }
} elseif( 'future' == $post_status ) { } elseif ( 'future' == $post_status ) {
$now = gmdate('Y-m-d H:i:59'); $now = gmdate('Y-m-d H:i:59');
if ( mysql2date('U', $post_date_gmt, false) <= mysql2date('U', $now, false) ) { if ( mysql2date('U', $post_date_gmt, false) <= mysql2date('U', $now, false) ) {
$post_status = 'publish'; $post_status = 'publish';

View File

@ -150,7 +150,7 @@ function wp_save_post_revision( $post_id ) {
$post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $last_revision, $post ); $post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $last_revision, $post );
//don't save revision if post unchanged //don't save revision if post unchanged
if( ! $post_has_changed ) { if ( ! $post_has_changed ) {
return; return;
} }
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-alpha-32799'; $wp_version = '4.3-alpha-32800';
/** /**
* 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.