From a27b0d250a6e7f578eac231d15a833b2d6d77a61 Mon Sep 17 00:00:00 2001 From: Jay Wood Date: Mon, 27 Oct 2014 19:57:18 -0400 Subject: [PATCH] More yoda conditions --- class/main.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/class/main.class.php b/class/main.class.php index 727fb3a..5184367 100644 --- a/class/main.class.php +++ b/class/main.class.php @@ -198,19 +198,19 @@ class CWV3 { } $type = get_post_type( $id ); - if ( $type == 'post' ) { - $catData = get_option( "cwv3_cat_list" ); + if ( 'post' == $type ) { + $catData = get_option( 'cwv3_cat_list' ); $curCat = get_the_category( $id ); if ( $this->in_cat( $catData, $curCat ) ) { $cData['categories']->$id = $action; return setcookie( 'cwv3_cats', json_encode( $cData['categories'] ), ( $time['multiplier'] * $time['time'] )+time(), COOKIEPATH, COOKIE_DOMAIN, false ); - }else if ( get_post_meta( $id, 'cwv3_auth', true ) == 'yes' ) { + } else if ( 'yes' == get_post_meta( $id, 'cwv3_auth', true ) ) { $cData['posts']->$id = $action; return setcookie( 'cwv3_posts', json_encode( $cData['posts'] ), ( $time['multiplier'] * $time['time'] )+time(), COOKIEPATH, COOKIE_DOMAIN, false ); } } - if ( get_post_meta( $id, 'cwv3_auth', true ) == 'yes' ) { + if ( 'yes' == get_post_meta( $id, 'cwv3_auth', true ) ) { $cData['pages']->$id = $action; return setcookie( 'cwv3_pages', json_encode( $cData['pages'] ), ( $time['multiplier'] * $time['time'] )+time(), COOKIEPATH, COOKIE_DOMAIN, false ); }