From bd9521523825bf99fe7055fd3efc4d5f78611a96 Mon Sep 17 00:00:00 2001 From: Andrew Lima Date: Tue, 27 Sep 2022 09:54:25 +0200 Subject: [PATCH] Version bump 1.2 + readme update. --- includes/blocks.php | 27 +++++---------------------- pmpro-courses.php | 2 +- readme.txt | 11 ++++++++--- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/includes/blocks.php b/includes/blocks.php index 927e0ae..6f4cbd7 100644 --- a/includes/blocks.php +++ b/includes/blocks.php @@ -2,14 +2,15 @@ /** * Register block types for both My Courses and All Courses shortcode. * - * @since TBD + * @since 1.2 */ function pmpro_courses_register_block_type() { + register_block_type( PMPRO_COURSES_DIR . '/blocks/build/my-courses', array( 'editor_script' => 'pmpro-block-my-courses-js', - 'render_callback' => 'pmpro_courses_my_courses_callback', + 'render_callback' => 'pmpro_courses_shortcode_my_courses', ) ); @@ -17,34 +18,16 @@ function pmpro_courses_register_block_type() { PMPRO_COURSES_DIR . '/blocks/build/all-courses', array( 'editor_script' => 'pmpro-block-all-courses-js', - 'render_callback' => 'pmpro_courses_all_courses_callback', + 'render_callback' => 'pmpro_courses_shortcode_all_courses', ) ); } add_action( 'init', 'pmpro_courses_register_block_type' ); -/** - * Callback that is a wrapper for the pmpro_my_courses shortcode. - * - * @since TBD - */ -function pmpro_courses_my_courses_callback( $attributes ) { - return do_shortcode( "[pmpro_my_courses limit='" . (int) $attributes['limit'] . "']" ); -} - -/** - * Callback that is a wrapper for the pmpro_all_courses shortcode. - * - * @since TBD - */ -function pmpro_courses_all_courses_callback( $attributes ) { - return do_shortcode( "[pmpro_all_courses limit='" . (int) $attributes['limit'] . "']" ); -} - /** * Enqueue the Block Scripts for both blocks. * - * @since TBD + * @since 1.2 */ function pmpro_courses_block_scripts() { wp_enqueue_script( diff --git a/pmpro-courses.php b/pmpro-courses.php index 9ab5958..5ee07e3 100644 --- a/pmpro-courses.php +++ b/pmpro-courses.php @@ -3,7 +3,7 @@ * Plugin Name: Paid Memberships Pro - Courses for Membership Add On * Plugin URI: https://www.paidmembershipspro.com/add-ons/pmpro-courses-lms-integration/ * Description: Create courses and lessons for members. Integrates LMS plugins with Paid Memberships Pro. - * Version: 1.1 + * Version: 1.2 * Author: Paid Memberships Pro * Author URI: https://www.paidmembershipspro.com * Text Domain: pmpro-courses diff --git a/readme.txt b/readme.txt index 1cc2adb..bd757bc 100644 --- a/readme.txt +++ b/readme.txt @@ -4,9 +4,9 @@ Tags: course, education, elearning, lms, membership, pmpro Requires at least: 5.4 Tested up to: 6.0 Stable tag: 1.1 -Requires PHP: 5.6 -License: GPLv3 -License URI: https://www.gnu.org/licenses/gpl-3.0.html +Requires PHP: 7.0 +License: GPLv2 or later +License URI: http://www.gnu.org/licenses/gpl-2.0.html Create, protect, & sell courses with recurring subscriptions for Paid Memberships Pro, LearnDash, & LifterLMS. @@ -121,6 +121,11 @@ Please visit [our support site at https://www.paidmembershipspro.com](http://www 4. A course page on the site frontend showing overview content, a registration box with required levels, and a list of lessons. == Changelog == += 1.2 - 2022-09-27 = +* ENHANCEMENT: Added blocks for "My Courses" and "All Courses" shortcodes. This works only when the default module is being used. +* BUG FIX: Fixed an issue where lessons in TutorLMS weren't restricting correctly. +* BUG FIX: Fixed an issue where the limit attribute wasn't filtering the courses content for [pmpro_my_courses] and [pmpro_all_courses]. +* BUG FIX: Fixed an issue for the plugin_action_links throwing an error for certain user roles. = 1.1 - 2022-06-09 = * SECURITY: Improved security by preparing, sanitization and escaping of variables.