Skip to content

Commit

Permalink
Merge pull request #56 from redbitcz/feature-user-profile-groups
Browse files Browse the repository at this point in the history
Feature user profile groups
  • Loading branch information
jakubboucek authored Jan 18, 2021
2 parents 87d44da + 60a3de9 commit 858a5a5
Show file tree
Hide file tree
Showing 5 changed files with 236 additions and 158 deletions.
10 changes: 5 additions & 5 deletions src/Access.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,11 @@ public function setup_nav_menu_item( $item ) {
*/
public function hide_menu_items() {
?>
<style type="text/css">
.ssc-hide {
display: none !important;
}
</style>
<style type="text/css">
.ssc-hide {
display: none !important;
}
</style>
<?php
}

Expand Down
36 changes: 18 additions & 18 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,31 +160,31 @@ public function publishing_actions() {
global $post;
if ( $post && $post->post_type == $mg_post_type ) {
echo '<style type="text/css">
.misc-pub-section.misc-pub-visibility,
.misc-pub-section.curtime
{
display:none;
}
</style>';
.misc-pub-section.misc-pub-visibility,
.misc-pub-section.curtime
{
display:none;
}
</style>';
} ?>

<!-- SSC TinyMCE Shortcode Plugin -->
<script type='text/javascript'>
var sscContentGroups = [];
sscContentGroups.push({
text: 'Vyberte skupinu',
value: ''
});
<!-- SSC TinyMCE Shortcode Plugin -->
<script type='text/javascript'>
var sscContentGroups = [];
sscContentGroups.push({
text: 'Vyberte skupinu',
value: ''
});
<?php
$group = new Group();
$groups = $group->get_groups();
foreach ($groups as $key => $group) { ?>
sscContentGroups.push({
text: '<?php echo $group; ?>',
value: '<?php echo $key; ?>'
});
sscContentGroups.push({
text: '<?php echo $group; ?>',
value: '<?php echo $key; ?>'
});
<?php } ?>
</script>
</script>

<?php

Expand Down
4 changes: 2 additions & 2 deletions src/Membership.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public function __construct( $user_id = '' ) {
*/
public function get() {
$ssc_groups = new Group();
$groups = $ssc_groups->get_user_groups( $this->user_id );
$groups = $ssc_groups->get_user_groups( $this->user_id ) ?: [];

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

0 comments on commit 858a5a5

Please sign in to comment.