diff --git a/wp-admin/import/wordpress.php b/wp-admin/import/wordpress.php
index 49166b80e..0cd576295 100644
--- a/wp-admin/import/wordpress.php
+++ b/wp-admin/import/wordpress.php
@@ -866,7 +866,7 @@ class WP_Import {
break;
case 2:
check_admin_referer('import-wordpress');
- $fetch_attachments = (!empty($_POST['attachments'])) ? true : false;
+ $fetch_attachments = ! empty( $_POST['attachments'] );
$result = $this->import( $_GET['id'], $fetch_attachments);
if ( is_wp_error( $result ) )
echo $result->get_error_message();
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index cd9c8d3ff..52c0782c6 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -1191,7 +1191,7 @@ function get_media_item( $attachment_id, $args = null ) {
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
$display_title = $show_title ? "
" . wp_html_excerpt( $display_title, 60 ) . "
" : '';
- $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) ) ? true : false;
+ $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) );
$order = '';
foreach ( $form_fields as $key => $val ) {
diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php
index 6415a59f5..901aa8e37 100644
--- a/wp-admin/includes/plugin.php
+++ b/wp-admin/includes/plugin.php
@@ -92,7 +92,7 @@ function get_plugin_data( $plugin_file, $markup = true, $translate = true ) {
_deprecated_argument( __FUNCTION__, '3.0', sprintf( __( 'The %1$s
plugin header is deprecated. Use %2$s
instead.' ), 'Site Wide Only: true', 'Network: true' ) );
$plugin_data['Network'] = $plugin_data['_sitewide'];
}
- $plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) ) ? true : false;
+ $plugin_data['Network'] = ( 'true' == strtolower( $plugin_data['Network'] ) );
unset( $plugin_data['_sitewide'] );
//For backward compatibility by default Title is the same as Name.
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index 86d5a49f1..9f857909f 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -1457,7 +1457,7 @@ function wp_tiny_mce( $teeny = false, $settings = false ) {
$mce_buttons_4 = apply_filters('mce_buttons_4', array());
$mce_buttons_4 = implode($mce_buttons_4, ',');
}
- $no_captions = ( apply_filters( 'disable_captions', '' ) ) ? true : false;
+ $no_captions = (bool) apply_filters( 'disable_captions', '' );
// TinyMCE init settings
$initArray = array (
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 6a6658b07..9c5360864 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -2463,7 +2463,7 @@ function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
global $wp_locale, $post, $comment;
if ( $for_post )
- $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) ) ? false : true;
+ $edit = ! ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date_gmt || '0000-00-00 00:00:00' == $post->post_date_gmt ) );
$tab_index_attribute = '';
if ( (int) $tab_index > 0 )
diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php
index 87c1f6d8c..b3008ef19 100644
--- a/wp-admin/includes/upgrade.php
+++ b/wp-admin/includes/upgrade.php
@@ -563,7 +563,7 @@ function upgrade_110() {
// Check if we already set the GMT fields (if we did, then
// MAX(post_date_gmt) can't be '0000-00-00 00:00:00'
// I just slapped myself silly for not thinking about it earlier
- $got_gmt_fields = ($wpdb->get_var("SELECT MAX(post_date_gmt) FROM $wpdb->posts") == '0000-00-00 00:00:00') ? false : true;
+ $got_gmt_fields = ! ($wpdb->get_var("SELECT MAX(post_date_gmt) FROM $wpdb->posts") == '0000-00-00 00:00:00');
if (!$got_gmt_fields) {
diff --git a/wp-admin/install.php b/wp-admin/install.php
index b721c4f18..94509fe8b 100644
--- a/wp-admin/install.php
+++ b/wp-admin/install.php
@@ -75,7 +75,7 @@ function display_header() {
*/
function display_setup_form( $error = null ) {
global $wpdb;
- $user_table = ( $wpdb->get_var("SHOW TABLES LIKE '$wpdb->users'") != null ) ? true : false;
+ $user_table = ( $wpdb->get_var("SHOW TABLES LIKE '$wpdb->users'") != null );
// Ensure that Blogs appear in search engines by default
$blog_public = 1;
diff --git a/wp-app.php b/wp-app.php
index d3d81de88..7e07309ce 100644
--- a/wp-app.php
+++ b/wp-app.php
@@ -412,7 +412,7 @@ EOD;
array_push($post_category, $cat->term_id);
}
- $publish = (isset($entry->draft) && trim($entry->draft) == 'yes') ? false : true;
+ $publish = ! ( isset( $entry->draft ) && 'yes' == trim( $entry->draft ) );
$cap = ($publish) ? 'publish_posts' : 'edit_posts';
@@ -505,7 +505,7 @@ EOD;
if ( !current_user_can('edit_post', $entry['ID']) )
$this->auth_required(__('Sorry, you do not have the right to edit this post.'));
- $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;
+ $publish = ! ( isset($parsed->draft) && 'yes' == trim($parsed->draft) );
$post_status = ($publish) ? 'publish' : 'draft';
extract($entry);
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index 8e171bd41..242cc7478 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -1418,7 +1418,7 @@ function wp_list_comments($args = array(), $comments = null ) {
if ( empty($overridden_cpage) ) {
$r['page'] = get_query_var('cpage');
} else {
- $threaded = ( -1 == $r['max_depth'] ) ? false : true;
+ $threaded = ( -1 != $r['max_depth'] );
$r['page'] = ( 'newest' == get_option('default_comments_page') ) ? get_comment_pages_count($_comments, $r['per_page'], $threaded) : 1;
set_query_var( 'cpage', $r['page'] );
}
@@ -1429,7 +1429,7 @@ function wp_list_comments($args = array(), $comments = null ) {
$r['page'] = 1;
if ( null === $r['reverse_top_level'] )
- $r['reverse_top_level'] = ( 'desc' == get_option('comment_order') ) ? TRUE : FALSE;
+ $r['reverse_top_level'] = ( 'desc' == get_option('comment_order') );
extract( $r, EXTR_SKIP );
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index 2e7588c9b..c5733fd82 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -3829,13 +3829,13 @@ function wp_timezone_choice( $selected_zone ) {
// This determines what gets set and translated - we don't translate Etc/* strings here, they are done later
$exists = array(
- 0 => ( isset( $zone[0] ) && $zone[0] ) ? true : false,
- 1 => ( isset( $zone[1] ) && $zone[1] ) ? true : false,
- 2 => ( isset( $zone[2] ) && $zone[2] ) ? true : false
+ 0 => ( isset( $zone[0] ) && $zone[0] ),
+ 1 => ( isset( $zone[1] ) && $zone[1] ),
+ 2 => ( isset( $zone[2] ) && $zone[2] ),
);
- $exists[3] = ( $exists[0] && 'Etc' !== $zone[0] ) ? true : false;
- $exists[4] = ( $exists[1] && $exists[3] ) ? true : false;
- $exists[5] = ( $exists[2] && $exists[3] ) ? true : false;
+ $exists[3] = ( $exists[0] && 'Etc' !== $zone[0] );
+ $exists[4] = ( $exists[1] && $exists[3] );
+ $exists[5] = ( $exists[2] && $exists[3] );
$zonen[] = array(
'continent' => ( $exists[0] ? $zone[0] : '' ),
diff --git a/wp-includes/media.php b/wp-includes/media.php
index 1b1959fbe..2e32367cb 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -1116,7 +1116,7 @@ class WP_Embed {
}
// Use oEmbed to get the HTML
- $attr['discover'] = ( apply_filters('embed_oembed_discover', false) && author_can( $post_ID, 'unfiltered_html' ) ) ? true : false;
+ $attr['discover'] = ( apply_filters('embed_oembed_discover', false) && author_can( $post_ID, 'unfiltered_html' ) );
$html = wp_oembed_get( $url, $attr );
// Cache the result
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index 0cc14e9f4..b2182c320 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -684,7 +684,7 @@ function wp_set_auth_cookie($user_id, $remember = false, $secure = '') {
}
if ( '' === $secure )
- $secure = is_ssl() ? true : false;
+ $secure = is_ssl();
if ( $secure ) {
$auth_cookie_name = SECURE_AUTH_COOKIE;
@@ -777,10 +777,7 @@ if ( !function_exists('auth_redirect') ) :
function auth_redirect() {
// Checks if a user is logged in, if not redirects them to the login page
- if ( is_ssl() || force_ssl_admin() )
- $secure = true;
- else
- $secure = false;
+ $secure = ( is_ssl() || force_ssl_admin() );
// If https is required and request is http, redirect
if ( $secure && !is_ssl() && false !== strpos($_SERVER['REQUEST_URI'], 'wp-admin') ) {
diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php
index 31ccd761f..cbfa71d6c 100644
--- a/wp-includes/rewrite.php
+++ b/wp-includes/rewrite.php
@@ -1958,7 +1958,7 @@ class WP_Rewrite {
unset($this->search_structure);
unset($this->feed_structure);
unset($this->comment_feed_structure);
- $this->use_trailing_slashes = ( substr($this->permalink_structure, -1, 1) == '/' ) ? true : false;
+ $this->use_trailing_slashes = ( '/' == substr($this->permalink_structure, -1, 1) );
// Enable generic rules for pages if permalink structure doesn't begin with a wildcard.
if ( preg_match("/^[^%]*%(?:postname|category|tag|author)%/", $this->permalink_structure) )
diff --git a/wp-includes/user.php b/wp-includes/user.php
index 8dd1878d1..3dc8756c1 100644
--- a/wp-includes/user.php
+++ b/wp-includes/user.php
@@ -41,7 +41,7 @@ function wp_signon( $credentials = '', $secure_cookie = '' ) {
do_action_ref_array('wp_authenticate', array(&$credentials['user_login'], &$credentials['user_password']));
if ( '' === $secure_cookie )
- $secure_cookie = is_ssl() ? true : false;
+ $secure_cookie = is_ssl();
global $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie
$auth_secure_cookie = $secure_cookie;