Skip to content

Commit

Permalink
Fix improper code
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubboucek committed Sep 3, 2018
1 parent 29f3e95 commit 2e21c1f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion includes/class.ssc_access.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion includes/class.ssc_rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion includes/class.ssc_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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{

Expand All @@ -11,7 +16,7 @@ class SSC_Settings{
*
* @var Myprefix_Admin
*/
protected static $instance = null;
protected static $instance;

/**
* Options Page title
Expand Down
5 changes: 3 additions & 2 deletions includes/ssc_helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
{
Expand Down

0 comments on commit 2e21c1f

Please sign in to comment.