From 7834e6e294625854a003c1968ba33ece34a65ca0 Mon Sep 17 00:00:00 2001 From: Mike Hemberger Date: Mon, 2 Apr 2018 14:53:12 -0400 Subject: [PATCH 1/3] Fix $/jQuery declaration --- assets/js/ld-full-access-groups.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/ld-full-access-groups.js b/assets/js/ld-full-access-groups.js index a378bac..8abc211 100644 --- a/assets/js/ld-full-access-groups.js +++ b/assets/js/ld-full-access-groups.js @@ -1,4 +1,4 @@ -$(document).ready(function() { +jQuery(document).ready(function($) { $( '#ld_full_access_groups' ).select2({ placeholder: 'Select Group(s)', }); From d841e703ca915b7d433a7d7f332f7f5d467e26cd Mon Sep 17 00:00:00 2001 From: Mike Hemberger Date: Mon, 2 Apr 2018 14:54:35 -0400 Subject: [PATCH 2/3] Fix LD conflict. WP_Query was blowing things up. Converted to get_posts(). Fix updater conditional. Missing text domain. --- learndash-full-access-groups.php | 41 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/learndash-full-access-groups.php b/learndash-full-access-groups.php index a2acc33..b476814 100644 --- a/learndash-full-access-groups.php +++ b/learndash-full-access-groups.php @@ -142,10 +142,9 @@ public function setup() { public function updater() { if ( ! class_exists( 'Puc_v4_Factory' ) ) { require_once LD_FULL_ACCESS_GROUPS_INCLUDES_DIR . 'vendor/plugin-update-checker/plugin-update-checker.php'; // 4.4 - } else { - $updater = Puc_v4_Factory::buildUpdateChecker( 'https://github.com/bizbudding/learndash-full-access-groups/', __FILE__, 'learndash-full-access-groups' ); - $updater->setAuthentication( '3221386f577b42d7089c35e0b4efffcaf3570ffd' ); } + $updater = Puc_v4_Factory::buildUpdateChecker( 'https://github.com/bizbudding/learndash-full-access-groups/', __FILE__, 'learndash-full-access-groups' ); + $updater->setAuthentication( '3221386f577b42d7089c35e0b4efffcaf3570ffd' ); } /** @@ -168,11 +167,11 @@ function register_metabox() { add_meta_box( 'ld_full_access_groups_edit', - esc_html__( 'LearnDash Full Access Groups', 'text-domain' ), + esc_html__( 'LearnDash Full Access Groups', 'learndash-full-access-groups' ), array( $this, 'render_metabox' ), 'sfwd-courses', 'side', - 'core' + 'default' ); } @@ -190,32 +189,34 @@ function render_metabox( $post ) { wp_enqueue_script( 'select2' ); wp_enqueue_script( 'ld_full_access_groups' ); - $args = array( - 'post_type' => 'groups', - 'posts_per_page' => 500, - 'post_status' => 'publish', - 'no_found_rows' => true, - 'update_post_meta_cache' => false, - 'update_post_term_cache' => false, - ); + // return; + + $groups = get_posts( array( + 'post_type' => 'groups', + 'posts_per_page' => 500, + 'post_status' => 'publish', + 'orderby' => 'title', + 'order' => 'ASC', + 'suppress_filters' => true + ) ); - $groups = new WP_Query( $args ); + if ( $groups ) { - if ( $groups->have_posts() ) { // Set nonce. wp_nonce_field( 'nonce_ld_full_access_groups_action', 'nonce_ld_full_access_groups_field' ); + // Existing values. $selected = (array) get_post_meta( $post->ID, 'ld_full_access_groups', true ); + // Select field. echo '

'; printf( '%s', esc_html__( 'Selected groups will have access to this course without start date restrictions. Course access/enrollment is managed by the group itself. Course prerequisites will not be affected.', 'learndash-full-access-groups' ) ); - } - wp_reset_postdata(); + } } From 881328c658f3edc5a3373ccfd3ec8e9854fafc2a Mon Sep 17 00:00:00 2001 From: Mike Hemberger Date: Mon, 2 Apr 2018 14:58:06 -0400 Subject: [PATCH 3/3] Changelog and v bump --- CHANGES.md | 12 ++++++++++++ includes/CHANGES.md | 7 ------- learndash-full-access-groups.php | 4 ++-- 3 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 CHANGES.md delete mode 100644 includes/CHANGES.md diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..c77db8d --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,12 @@ +### Changelog + +#### 1.1.0 (4/2/18) +* Fixed: Conflict with LD metabox by changing WP_Query to get_posts(). +* Fixed: Missing text-domain. +* Fixed: Updater conditional, so updates actually work effectively. + +#### 1.0.1 (3/12/18) +* Fixed: Allow clearing of saved Groups. + +#### 1.0.0 (3/12/18) +* Initial Release. diff --git a/includes/CHANGES.md b/includes/CHANGES.md deleted file mode 100644 index 98a8a8e..0000000 --- a/includes/CHANGES.md +++ /dev/null @@ -1,7 +0,0 @@ -### Changelog - -#### 1.0.1 (3/12/18) -* Fixed: Allow clearing of saved Groups. - -#### 1.0.0 (3/12/18) -* Initial Release. diff --git a/learndash-full-access-groups.php b/learndash-full-access-groups.php index b476814..021d745 100644 --- a/learndash-full-access-groups.php +++ b/learndash-full-access-groups.php @@ -4,7 +4,7 @@ * Plugin Name: LearnDash Full Access Groups * Plugin URI: https://bizbudding.com * Description: Allow specific Groups to access a course without start date restrictions. - * Version: 1.0.1 + * Version: 1.1.0 * * Author: BizBudding, Mike Hemberger * Author URI: https://bizbudding.com @@ -89,7 +89,7 @@ private function setup_constants() { // Plugin version. if ( ! defined( 'LD_FULL_ACCESS_GROUPS_VERSION' ) ) { - define( 'LD_FULL_ACCESS_GROUPS_VERSION', '1.0.1' ); + define( 'LD_FULL_ACCESS_GROUPS_VERSION', '1.1.0' ); } // Plugin Folder Path.