diff --git a/includes/class.ssc_access.php b/includes/class.ssc_access.php index 69a9029..b062304 100644 --- a/includes/class.ssc_access.php +++ b/includes/class.ssc_access.php @@ -37,7 +37,7 @@ function check_access(){ if($post_groups && !$this->user_can_view_post() && !is_home() && !is_front_page()){ $no_access_url = $this->get_no_access_redirect_url(); - $url = $no_access_url ? $no_access_url : site_url(); + $url = $no_access_url ?: site_url(); wp_redirect($url); exit(); } diff --git a/includes/class.ssc_rest.php b/includes/class.ssc_rest.php index 2c3c4b2..c159d08 100644 --- a/includes/class.ssc_rest.php +++ b/includes/class.ssc_rest.php @@ -98,7 +98,7 @@ public function create_item($request){ // Set the membership valid_to param $membership = new SSC_Membership($user_id); - $valid_to = $request->get_param('valid_to') ? $request->get_param('valid_to') : ''; + $valid_to = $request->get_param('valid_to') ?: ''; $membership->set_valid_to($group,$valid_to); $user_groups[] = $group; diff --git a/includes/class.ssc_settings.php b/includes/class.ssc_settings.php index 7eef11f..18d8cec 100644 --- a/includes/class.ssc_settings.php +++ b/includes/class.ssc_settings.php @@ -3,6 +3,11 @@ /** * CMB2 Theme Options * @version 0.1.0 + * + * @property-read string $key + * @property-read string $metabox_id + * @property-read string $title + * @property-read string $options_page */ class SSC_Settings{ @@ -11,7 +16,7 @@ class SSC_Settings{ * * @var Myprefix_Admin */ - protected static $instance = null; + protected static $instance; /** * Options Page title diff --git a/includes/ssc_helpers.php b/includes/ssc_helpers.php index 341b266..9937857 100644 --- a/includes/ssc_helpers.php +++ b/includes/ssc_helpers.php @@ -66,8 +66,9 @@ function ssc_list_hooks( $hook = '' ) { */ function ssc_remove_anonymous_object_filter( $tag, $class, $method ) { - if (!isset($GLOBALS['wp_filter'][ $tag ]) || empty($GLOBALS['wp_filter'][ $tag ])) - return; + if (!isset($GLOBALS['wp_filter'][ $tag ]) || empty($GLOBALS['wp_filter'][ $tag ])) { + return null; + } foreach ( $GLOBALS['wp_filter'][ $tag ] as $priority => $filter ) {