Skip to content

Commit

Permalink
Fix PHP 5.3 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubboucek committed Sep 3, 2018
1 parent a75d373 commit 9152d87
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions includes/class.ssc_cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function __construct()
function send_user_has_access_to_post_notification()
{
// Get posts, that have set either days to view or specific date
$args = [
$args = array(
'post_type' => 'any',
'posts_per_page' => -1,
'meta_query' => array(
Expand All @@ -32,7 +32,7 @@ function send_user_has_access_to_post_notification()
'compare' => 'EXISTS'
)
)
];
);

$the_query = new \WP_Query($args);

Expand All @@ -45,7 +45,7 @@ function send_user_has_access_to_post_notification()
$users = get_users();

// Get all groups to array
$users_groups = [];
$users_groups = array();
foreach ($users as $user) {
$membership = new SSC_Membership($user->ID);
$users_groups[$user->ID] = $membership->groups;
Expand Down
4 changes: 2 additions & 2 deletions includes/class.ssc_membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ function get()
$groups = $ssc_groups->get_user_groups($this->user_id);

foreach ($groups as $group) {
$this->groups[$group] = [
$this->groups[$group] = array(
'group_id' => $group,
'subscription_date' => $this->get_subscription_date($group),
'valid_to' => $this->get_valid_to($group)
];
);
}
}

Expand Down
4 changes: 3 additions & 1 deletion includes/class.ssc_rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,12 @@ public function create_item($request){
// Get the post details
$links = array();
$i = 0;

// Foreach group from request
// foreach($request->get_param('user_group') as $group){
// Foreach each group
foreach((new SSC_Group())->get_user_groups($user_id) as $group){
$SSC_group = new SSC_Group();
foreach($SSC_group->get_user_groups($user_id) as $group){
// Scrub through posts and check, if some of the posts has that group assigned
foreach($posts as $post){
$access = new SSC_Access();
Expand Down
2 changes: 1 addition & 1 deletion includes/class.ssc_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function is_valid_api_keys(){
if (get_option('ssc_valid_api_keys') == 1)
return array();

return ['hidden'];
return array( 'hidden' );

}

Expand Down

0 comments on commit 9152d87

Please sign in to comment.