Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature user profile groups #56

Merged
merged 3 commits into from
Jan 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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