mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Remove redundant isset() and empty() checks.
git-svn-id: https://develop.svn.wordpress.org/trunk@13770 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -951,7 +951,7 @@ function wp_kses_bad_protocol_once2($matches) {
|
||||
global $_kses_allowed_protocols;
|
||||
|
||||
if ( is_array($matches) ) {
|
||||
if ( ! isset($matches[1]) || empty($matches[1]) )
|
||||
if ( empty($matches[1]) )
|
||||
return '';
|
||||
|
||||
$string = $matches[1];
|
||||
|
||||
@@ -62,7 +62,7 @@ function wp_fix_server_vars() {
|
||||
}
|
||||
|
||||
// Append the query string if it exists and isn't null
|
||||
if ( isset( $_SERVER['QUERY_STRING'] ) && !empty( $_SERVER['QUERY_STRING'] ) ) {
|
||||
if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
|
||||
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -828,7 +828,7 @@ function wp_page_menu( $args = array() ) {
|
||||
$list_args = $args;
|
||||
|
||||
// Show Home in the menu
|
||||
if ( isset($args['show_home']) && ! empty($args['show_home']) ) {
|
||||
if ( ! empty($args['show_home']) ) {
|
||||
if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] )
|
||||
$text = __('Home');
|
||||
else
|
||||
|
||||
@@ -2078,7 +2078,7 @@ function wp_insert_post($postarr = array(), $wp_error = false) {
|
||||
|
||||
// Create a valid post name. Drafts and pending posts are allowed to have an empty
|
||||
// post name.
|
||||
if ( !isset($post_name) || empty($post_name) ) {
|
||||
if ( empty($post_name) ) {
|
||||
if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
|
||||
$post_name = sanitize_title($post_title);
|
||||
else
|
||||
|
||||
@@ -2234,7 +2234,7 @@ class WP_Query {
|
||||
if ( ! empty($q['meta_key']) )
|
||||
$where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s ", $q['meta_key']);
|
||||
if ( ! empty($q['meta_value']) ) {
|
||||
if ( ! isset($q['meta_compare']) || empty($q['meta_compare']) || ! in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=')) )
|
||||
if ( empty($q['meta_compare']) || ! in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=')) )
|
||||
$q['meta_compare'] = '=';
|
||||
|
||||
$where .= $wpdb->prepare("AND $wpdb->postmeta.meta_value {$q['meta_compare']} %s ", $q['meta_value']);
|
||||
|
||||
@@ -966,7 +966,7 @@ function is_dynamic_sidebar() {
|
||||
function is_active_sidebar( $index ) {
|
||||
$index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);
|
||||
$sidebars_widgets = wp_get_sidebars_widgets();
|
||||
if ( isset($sidebars_widgets[$index]) && !empty($sidebars_widgets[$index]) )
|
||||
if ( !empty($sidebars_widgets[$index]) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user