More PHPcs complain passification

This commit is contained in:
Jay Wood
2015-08-28 19:19:25 -04:00
parent 896b70b100
commit b3848809c0

View File

@ -64,6 +64,7 @@ class CWV3 {
* regular category taxonomy.
*
* @param int $post_id Post ID
*
* @return bool TRUE | FALSE
*/
public function is_gated( $post_id ) {
@ -82,15 +83,19 @@ class CWV3 {
*
* Determines if a post is within a gated category, if so, will
* return the category id for use in cookie names like so '_cat_###'
*
* @param int $post_id Post ID
*
* @return boolean|string False on failure, cookie string otherwise
*/
public function is_cat_gated( $post_id ) {
$cat_settings = get_option( 'cwv3_cat_list', array() );
if ( ! empty( $cat_settings ) ) {
$post_categories = get_the_category( $post_id );
return $this->in_cat( $cat_settings, $post_categories );
}
return false;
}
@ -103,6 +108,7 @@ class CWV3 {
*
* @param array $cat_settings Array of categories from settings page
* @param array $post_categories Array of categories from get_the_category()
*
* @return boolean|int False on failure, category ID on success
*/
public function in_cat( $cat_settings, $post_categories ) {
@ -117,6 +123,7 @@ class CWV3 {
continue;
}
}
return false;
}
@ -143,7 +150,9 @@ class CWV3 {
public function load_dependancies() {
global $post;
if ( current_user_can( 'manage_options' ) ) { return; }
if ( current_user_can( 'manage_options' ) ) {
return;
}
wp_enqueue_style( 'cwv3_css' );
wp_enqueue_script( 'cwv3_js' );
@ -153,7 +162,8 @@ class CWV3 {
'opacity' => get_option( 'cwv3_bg_opacity', 0.85 ),
'cookie_path' => SITECOOKIEPATH,
'cookie_name' => $this->get_cookie_name(),
'cookie_time' => intval( $cookie_death ) > 365 ? 365 : intval( $cookie_death ), // Max at one year if it's over 365 days.
'cookie_time' => intval( $cookie_death ) > 365 ? 365 : intval( $cookie_death ),
// Max at one year if it's over 365 days.
'denial_enabled' => get_option( 'cwv3_denial', 'enabled' ),
'denial_method' => get_option( 'cwv3_method', 'redirect' ),
'redirect_url' => esc_js( get_option( 'cwv3_exit_link', '#' ) ),