Changeset 3795620
- Timestamp:
- 11/11/2026 03:53:30 AM (less than one hour ago)
- Location:
- learnpress-wishlist/trunk
- Files:
-
- 38 added
- 10 edited
-
.eslintignore (added)
-
.eslintrc.js (added)
-
.gitignore (added)
-
assets/src (added)
-
assets/src/js (added)
-
assets/src/js/gutenberg (added)
-
assets/src/js/gutenberg/blocks (added)
-
assets/src/js/gutenberg/blocks/course-button-wishlist (added)
-
assets/src/js/gutenberg/blocks/course-button-wishlist/block.json (added)
-
assets/src/js/gutenberg/blocks/course-button-wishlist/edit.js (added)
-
assets/src/js/gutenberg/blocks/course-button-wishlist/index.js (added)
-
assets/src/js/gutenberg/blocks/course-button-wishlist/save.js (added)
-
assets/src/js/gutenberg/blocks/utilBlock.js (added)
-
assets/src/js/lp-wishlist.js (added)
-
assets/src/js/lpToastify.js (added)
-
assets/src/js/utils.js (added)
-
assets/src/js/wishlist.js (added)
-
assets/src/scss (added)
-
assets/src/scss/_wishlist-legacy.scss (added)
-
assets/src/scss/admin-wishlist-block.scss (added)
-
assets/src/scss/wishlist.scss (added)
-
assets/src/scss/wp-blocks (added)
-
assets/src/scss/wp-blocks/course-button-wishlist.scss (added)
-
build-release.js (added)
-
composer.json (added)
-
config/elementor/wishlist.php (modified) (10 diffs)
-
config/elementor/wishlist_loop.php (added)
-
gulpfile.mjs (added)
-
inc/Elementor/Widgets/CourseWishlistElementor.php (modified) (3 diffs)
-
inc/Elementor/Widgets/CourseWishlistLoopElementor.php (added)
-
inc/Elementor/WishListElementorHandler.php (modified) (2 diffs)
-
inc/Gutenberg (added)
-
inc/Gutenberg/Blocks (added)
-
inc/Gutenberg/Blocks/ButtonWishListBlockType.php (added)
-
inc/TemplateHooks (added)
-
inc/TemplateHooks/CourseWishlistTemplate.php (added)
-
inc/TemplateHooks/CoursesWishlistTemplate.php (added)
-
inc/functions.php (modified) (5 diffs)
-
inc/load.php (modified) (21 diffs)
-
inc/rest-api/class-lp-rest-wishlist-v1-controller.php (modified) (6 diffs)
-
languages/learnpress-wishlist.pot (modified) (1 diff)
-
languages/learnpress-woo-payment.pot (modified) (3 diffs)
-
learnpress-wishlist.php (modified) (4 diffs)
-
package-lock.json (added)
-
package.json (added)
-
phpcs.xml (added)
-
readme.txt (modified) (2 diffs)
-
webpack.config.js (added)
Legend:
- Unmodified
- Added
- Removed
-
learnpress-wishlist/trunk/config/elementor/wishlist.php
r3143402 r3795620 3 3 use Elementor\Controls_Manager; 4 4 use Elementor\Group_Control_Text_Shadow; 5 use Elementor\Group_Control_Border; 5 6 use Elementor\Group_Control_Typography; 6 7 use LearnPress\ExternalPlugin\Elementor\LPElementorControls; … … 11 12 Controls_Manager::TAB_STYLE, 12 13 [ 14 'layout' => LPElementorControls::add_control_type_select( 15 'layout', 16 esc_html__( 'Layout', 'learnpress-wishlist' ), 17 [ 18 'classic' => esc_html__( 'Classic', 'learnpress-wishlist' ), 19 'modern' => esc_html__( 'Modern', 'learnpress-wishlist' ), 20 'icon-only' => esc_html__( 'Icon Only', 'learnpress-wishlist' ), 21 ], 22 'classic' 23 ), 13 24 'add_button_color' => LPElementorControls::add_control_type_color( 14 25 'add_button_color', 15 26 esc_html__( 'Color', 'learnpress-wishlist' ), 16 27 [ 17 '{{WRAPPER}} . course-wishlist' => 'color: {{VALUE}};',28 '{{WRAPPER}} .lp-button-wishlist-action , {{WRAPPER}} .lp-button-wishlist-action i' => 'color: {{VALUE}};', 18 29 ] 19 30 ), … … 22 33 esc_html__( 'Color Active, Hover', 'learnpress-wishlist' ), 23 34 [ 24 '{{WRAPPER}} .course-wishlist.on,{{WRAPPER}} .course-wishlist:hover' => 'color: {{VALUE}};', 35 '{{WRAPPER}} .lp-button-wishlist-action.wishlisted,{{WRAPPER}} .lp-button-wishlist-action:hover' => 'color: {{VALUE}};', 36 '{{WRAPPER}} .lp-button-wishlist-action:hover i, {{WRAPPER}} .lp-button-wishlist-action.wishlisted i' => 'color: {{VALUE}};' 25 37 ] 26 38 ), … … 29 41 esc_html__( 'Background Color', 'learnpress-wishlist' ), 30 42 [ 31 '{{WRAPPER}} . course-wishlist' => 'background-color: {{VALUE}};',43 '{{WRAPPER}} .lp-button-wishlist-action' => 'background-color: {{VALUE}};', 32 44 ] 33 45 ), … … 36 48 esc_html__( 'Background Color Hover', 'learnpress-wishlist' ), 37 49 [ 38 '{{WRAPPER}} . course-wishlist:hover' => 'background-color: {{VALUE}};',50 '{{WRAPPER}} .lp-button-wishlist-action:hover' => 'background-color: {{VALUE}};', 39 51 ] 40 52 ), … … 47 59 'size_units' => [ 'px', '%', 'custom' ], 48 60 'selectors' => array( 49 '{{WRAPPER}} . course-wishlist' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',61 '{{WRAPPER}} .lp-button-wishlist-action' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', 50 62 ), 51 63 ] … … 54 66 'button_typography', 55 67 Group_Control_Typography::get_type(), 56 '{{WRAPPER}} .course-wishlist' 68 '{{WRAPPER}} .lp-button-wishlist-action' 69 ), 70 'button_border' => LPElementorControls::add_group_control_type( 71 'button_border', 72 Group_Control_Border::get_type(), 73 '{{WRAPPER}} .lp-button-wishlist-action' 57 74 ), 58 75 'icon_size' => LPElementorControls::add_responsive_control_type( … … 64 81 'size_units' => [ 'px', 'em', 'custom' ], 65 82 'selectors' => array( 66 '{{WRAPPER}} . course-wishlist:before' => 'font-size: {{SIZE}}{{UNIT}};',83 '{{WRAPPER}} .lp-button-wishlist-action i' => 'font-size: {{SIZE}}{{UNIT}};', 67 84 ), 68 85 ] … … 76 93 'size_units' => [ 'px', '%', 'custom' ], 77 94 'selectors' => array( 78 '{{WRAPPER}} . course-wishlist:before' => 'margin-right: {{SIZE}}{{UNIT}};',95 '{{WRAPPER}} .lp-button-wishlist-action i' => 'margin-right: {{SIZE}}{{UNIT}};', 79 96 ), 80 97 ] … … 83 100 'button_shadow', 84 101 Group_Control_Text_Shadow::get_type(), 85 '{{WRAPPER}} . course-wishlist'102 '{{WRAPPER}} .lp-button-wishlist-action' 86 103 ), 87 104 ] -
learnpress-wishlist/trunk/inc/Elementor/Widgets/CourseWishlistElementor.php
r3143402 r3795620 4 4 * 5 5 * @sicne 4.0.6 6 * @version 1.0. 06 * @version 1.0.1 7 7 */ 8 namespace L P_Addon_Wishlist\Elementor\Widgets;8 namespace LearnPress\Wishlist\Elementor\Widgets; 9 9 10 10 use LearnPress\ExternalPlugin\Elementor\LPElementorWidgetBase; 11 11 use LearnPress\ExternalPlugin\Elementor\Widgets\Course\SingleCourseBaseElementor; 12 use LP_Addon_Wishlist_Preload; 12 use LearnPress\Wishlist\TemplateHooks\CourseWishlistTemplate; 13 use LP_Addon_Wishlist; 14 use LP_Debug; 15 use Throwable; 13 16 14 17 class CourseWishlistElementor extends LPElementorWidgetBase { … … 19 22 $this->name = 'course_wishlist'; 20 23 $this->keywords = [ 'course wishlist', 'wishlist' ]; 24 $this->add_script_depends( 'lp-course-wishlist-script' ); 21 25 parent::__construct( $data, $args ); 22 26 } 23 27 24 28 protected function register_controls() { 25 $this->controls = require_once LP_A DDON_WISHLIST_PATH. '/config/elementor/wishlist.php';29 $this->controls = require_once LP_Addon_Wishlist::instance()->plugin_folder_path . '/config/elementor/wishlist.php'; 26 30 parent::register_controls(); 27 31 } … … 34 38 protected function render() { 35 39 try { 36 $course = $this->get_course();37 if ( ! $course ) {40 $courseModel = $this->get_course_model(); 41 if ( ! $courseModel ) { 38 42 return; 39 43 } 40 wp_enqueue_script( 'lp-course-wishlist' ); 41 LP_Addon_Wishlist_Preload::$addon->wishlist_button( $course->get_id() ); 42 } catch ( \Throwable $e ) { 43 error_log( $e->getMessage() ); 44 45 $settings = $this->get_settings_for_display(); 46 $layout = $settings['layout'] ?? 'classic'; 47 48 echo CourseWishlistTemplate::instance()->html_button_action( $courseModel, [ 'layout' => $layout ] ); 49 50 } catch ( Throwable $e ) { 51 LP_Debug::error_log( $e ); 44 52 } 45 53 } -
learnpress-wishlist/trunk/inc/Elementor/WishListElementorHandler.php
r3143402 r3795620 6 6 * 7 7 * @since 4.0.6 8 * @version 1.0. 08 * @version 1.0.1 9 9 */ 10 namespace L P_Addon_Wishlist\Elementor;10 namespace LearnPress\Wishlist\Elementor; 11 11 12 12 use LearnPress\Helpers\Singleton; 13 use LP_Addon_Wishlist\Elementor\Widgets\CourseWishlistElementor; 13 use LearnPress\Wishlist\Elementor\Widgets\CourseWishlistElementor; 14 use LearnPress\Wishlist\Elementor\Widgets\CourseWishlistLoopElementor; 14 15 15 16 class WishListElementorHandler { … … 30 31 */ 31 32 public function register_widgets( array $lp_widgets ): array { 32 include_once LP_ADDON_WISHLIST_INC . 'Elementor/Widgets/CourseWishlistElementor.php';33 //include_once LP_ADDON_WISHLIST_INC . 'Elementor/Widgets/CourseWishlistElementor.php'; 33 34 34 $lp_widgets['course-wishlist'] = CourseWishlistElementor::class; 35 $lp_widgets['course-wishlist'] = CourseWishlistElementor::class; 36 $lp_widgets['course-wishlist-loop'] = CourseWishlistLoopElementor::class; 35 37 36 38 return $lp_widgets; -
learnpress-wishlist/trunk/inc/functions.php
r3143402 r3795620 22 22 */ 23 23 function learn_press_course_wishlist_template( $name, $args = [] ) { 24 _deprecated_function( __FUNCTION__, '4.0.5' ); 25 return; 24 26 //_deprecated_function( __FUNCTION__, '4.0.5', 'LP_Addon_Wishlist_Preload::$addon->get_template' ); 25 LP_Addon_Wishlist_Preload::$addon->get_template( $name, $args );27 //LP_Addon_Wishlist_Preload::$addon->get_template( $name, $args ); 26 28 //learn_press_get_template( $name, $args, learn_press_template_path() . '/addons/wishlist/', LP_ADDON_WISHLIST_TEMPLATE ); 27 29 } … … 37 39 */ 38 40 function learn_press_wishlist_get_template( $name, $args = null ) { 41 _deprecated_function( __FUNCTION__, '4.0.5' ); 42 return; 39 43 //_deprecated_function( __FUNCTION__, '4.0.5', 'LP_Addon_Wishlist_Preload::$addon->get_template' ); 40 learn_press_get_template( $name, $args, learn_press_template_path() . '/addons/wishlist/', LP_ADDON_WISHLIST_PATH . '/templates/' );44 //learn_press_get_template( $name, $args, learn_press_template_path() . '/addons/wishlist/', LP_ADDON_WISHLIST_PATH . '/templates/' ); 41 45 } 42 46 } 43 47 48 // Theme ivy-school is using this hook, override file user-wishlist.php 44 49 add_action( 'learn_press_wishlist_loop_item_title', 'learn_press_wishlist_loop_item_title', 5 ); 45 50 … … 47 52 /** 48 53 * Loop item title. 54 * 55 * Theme ivy-school is using this function. 49 56 */ 50 57 function learn_press_wishlist_loop_item_title() { … … 61 68 * 62 69 * @return bool 70 * @using theme coaching is using 63 71 */ 64 72 function learn_press_user_wishlist_has_course( $course_id = null, $user_id = null ) { … … 71 79 } 72 80 73 $wish_list = (array) get_user_meta( $user_id, '_lpr_wish_list', true);81 $wish_list = LP_Addon_Wishlist::get_courses_wishlist( $user_id ); 74 82 75 83 return in_array( $course_id, $wish_list ); 76 84 } 77 85 } 78 79 if ( ! function_exists( 'learn_press_buddypress_is_active' ) ) {80 /**81 * Check BuddyPress active.82 *83 * @return bool84 */85 function learn_press_buddypress_is_active() {86 if ( ! function_exists( 'is_plugin_active' ) ) {87 include_once( ABSPATH . 'wp-admin/includes/plugin.php' );88 }89 90 return class_exists( 'BuddyPress' ) && is_plugin_active( 'buddypress/bp-loader.php' );91 }92 }93 94 if ( learn_press_buddypress_is_active() ) {95 96 /*97 * Set up sub admin bar wishlist.98 */99 add_filter( 'learn_press_bp_courses_bar', 'learn_press_bp_courses_bar_wishlist', 20 );100 function learn_press_bp_courses_bar_wishlist( $wp_admin_nav ) {101 102 $courses_slug = apply_filters( 'learn_press_bp_courses_slug', '' );103 $courses_link = learn_press_get_current_bp_link();104 105 $wp_admin_nav[] = array(106 'parent' => 'my-account-' . $courses_slug,107 'id' => 'my-account-' . $courses_slug . '-wishlist',108 'title' => __( 'Wishlist', 'learnpress_wishlist' ),109 'href' => trailingslashit( $courses_link . 'wishlist' ),110 );111 112 return $wp_admin_nav;113 }114 115 /*116 * Setup sub navigation wishlist.117 */118 if ( bp_is_my_profile() || current_user_can( 'manage_options' ) ) {119 add_filter( 'learn_press_bp_courses_sub_navs', 'learn_press_bp_courses_nav_wishlist' );120 121 function learn_press_bp_courses_nav_wishlist( $sub_navs ) {122 $nav_wishlist = array(123 'name' => __( 'Wishlist', 'learnpress_wishlist' ),124 'slug' => 'wishlist',125 'show_for_displayed_user' => false,126 'position' => 10,127 'screen_function' => 'learn_press_bp_courses_wishlist',128 'parent_url' => learn_press_get_current_bp_link(),129 'parent_slug' => apply_filters( 'learn_press_bp_courses_slug', '' ),130 );131 array_push( $sub_navs, $nav_wishlist );132 133 return $sub_navs;134 }135 136 function learn_press_bp_courses_wishlist() {137 add_action( 'bp_template_title', 'learn_press_bp_courses_wishlist_title' );138 add_action( 'bp_template_content', 'learn_press_bp_courses_wishlist_content' );139 bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );140 }141 142 /*143 * Setup title of navigation all.144 */145 function learn_press_bp_courses_wishlist_title() {146 echo __( 'Your wishlist', 'learnpress_wishlist' );147 }148 149 /*150 * Setup content of navigation all.151 */152 function learn_press_bp_courses_wishlist_content() {153 global $bp;154 echo apply_filters( 'learn_press_user_wishlist_tab_content', '', get_user_by( 'id', $bp->displayed_user->id ) );155 }156 }157 } -
learnpress-wishlist/trunk/inc/load.php
r3143402 r3795620 9 9 10 10 // Prevent loading this file directly 11 use LearnPress\Helpers\Template; 11 12 use LearnPress\Models\CourseModel; 12 13 use LearnPress\Models\UserModel; 13 use LP_Addon_Wishlist\Elementor\WishListElementorHandler; 14 use LearnPress\Wishlist\Elementor\WishListElementorHandler; 15 use LearnPress\Wishlist\TemplateHooks\CoursesWishlistTemplate; 16 use LearnPress\Wishlist\TemplateHooks\CourseWishlistTemplate; 17 use LearnPress\Wishlist\Gutenberg\Blocks\ButtonWishListBlockType; 14 18 15 19 defined( 'ABSPATH' ) || exit; … … 19 23 */ 20 24 class LP_Addon_Wishlist extends LP_Addon { 25 public $version = LP_ADDON_WISHLIST_VER; 26 public $require_version = LP_ADDON_WISHLIST_REQUIRE_VER; 27 public $plugin_file = LP_ADDON_WISHLIST_FILE; 28 public $text_domain = 'learnpress-wishlist'; 29 30 public static function instance() { 31 static $instance = null; 32 if ( is_null( $instance ) ) { 33 $instance = new self(); 34 } 35 36 return $instance; 37 } 21 38 22 39 /** … … 25 42 protected $_tab_slug = ''; 26 43 27 /** 28 * @var string 29 */ 30 public $version = LP_ADDON_WISHLIST_VER; 31 32 /** 33 * @var string 34 */ 35 public $require_version = LP_ADDON_WISHLIST_REQUIRE_VER; 36 37 /** 38 * Path file addon 39 * 40 * @var string 41 */ 42 public $plugin_file = LP_ADDON_WISHLIST_FILE; 44 const META_KEY = '_lpr_wish_list'; 43 45 44 46 /** … … 47 49 public function __construct() { 48 50 parent::__construct(); 51 $this->hooks(); 49 52 add_filter( 'learn-press/profile-tabs', array( $this, 'wishlist_tab' ), 100, 1 ); 50 53 $this->_tab_slug = sanitize_title( __( 'wishlist', 'learnpress-wishlist' ) ); 51 } 52 53 /** 54 * Defined constants. 55 */ 56 protected function _define_constants() { 57 define( 'LP_ADDON_WISHLIST_PATH', dirname( LP_ADDON_WISHLIST_FILE ) ); 58 define( 'LP_ADDON_WISHLIST_INC', LP_ADDON_WISHLIST_PATH . '/inc/' ); 59 define( 'LP_ADDON_WISHLIST_TEMPLATE', LP_ADDON_WISHLIST_PATH . '/templates/' ); 54 add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); 55 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_style' ) ); 60 56 } 61 57 … … 64 60 */ 65 61 protected function _includes() { 66 include_once LP_ADDON_WISHLIST_INC . 'functions.php';62 include_once $this->plugin_folder_path . '/inc/functions.php'; 67 63 if ( is_plugin_active( 'elementor/elementor.php' ) ) { 68 include_once LP_ADDON_WISHLIST_INC . 'Elementor/WishListElementorHandler.php';64 //include_once LP_ADDON_WISHLIST_INC . 'Elementor/WishListElementorHandler.php'; 69 65 WishListElementorHandler::instance(); 70 66 } 71 67 72 68 // Rest API 73 include_once LP_ADDON_WISHLIST_INC . 'rest-api/class-lp-rest-wishlist-v1-controller.php';74 include_once LP_ADDON_WISHLIST_INC . 'rest-api/class-rest-api.php';69 include_once $this->plugin_folder_path . '/inc/rest-api/class-lp-rest-wishlist-v1-controller.php'; 70 include_once $this->plugin_folder_path . '/inc/rest-api/class-rest-api.php'; 75 71 } 76 72 … … 78 74 * Init hooks. 79 75 */ 80 protected function _init_hooks() {76 protected function hooks() { 81 77 add_action( 'learn-press/after-course-buttons', array( $this, 'wishlist_button' ), 100 ); 82 78 add_filter( 'learn_press_profile_tab_endpoints', array( $this, 'profile_tab_endpoints' ) ); 83 add_filter( 'lean-press/single-course/offline/info-bar', [ $this, 'single_course_offline' ], 10, 3 ); 79 add_filter( 80 'learn-press/single-course/offline/section-right/info-meta', 81 [ 82 $this, 83 'single_course_offline', 84 ], 85 10, 86 3 87 ); 84 88 add_action( 'lp/template/archive-course/description', [ $this, 'load_js_css_on_archive_course' ] ); 89 add_action( 'learn-press/user-profile', [ $this, 'load_js_css_on_archive_course' ] ); 85 90 LP_Request::register_ajax( 'toggle_course_wishlist', array( $this, 'toggle_course_wishlist' ) ); 91 add_filter( 'learn-press/config/block-elements', array( $this, 'add_block_elements' ) ); 86 92 87 93 //$this->rewrite_endpoint(); 94 add_filter( 95 'learn-press/single-course/social-share/sections', 96 [ 97 $this, 98 'display_on_single_course_modern_layout', 99 ], 100 10, 101 3 102 ); 103 // Load js, css on list courses 104 add_action( 105 'learn-press/list-courses/layout', 106 function () { 107 wp_enqueue_style( 'lp-course-wishlist' ); 108 wp_enqueue_script( 'lp-course-wishlist-script' ); 109 } 110 ); 111 add_action( 112 'learn-press/single-instructor/layout', 113 function () { 114 wp_enqueue_style( 'lp-course-wishlist' ); 115 wp_enqueue_script( 'lp-course-wishlist-script' ); 116 } 117 ); 118 // Load js, css for course related section (fires BEFORE AJAX) 119 add_action( 120 'learn-press/single-course/courses-related/layout', 121 function () { 122 wp_enqueue_style( 'lp-course-wishlist' ); 123 wp_enqueue_script( 'lp-course-wishlist-script' ); 124 } 125 ); 126 add_filter( 127 'learn-press/layout/list-courses/item/section-top', 128 [ 129 $this, 130 'display_on_list_course_layout', 131 ], 132 10, 133 3 134 ); 135 // Hook for course related section (uses different filter) 136 add_filter( 137 'learn-press/list-courses/related/layout/item/section', 138 [ 139 $this, 140 'display_on_related_course_layout', 141 ], 142 10, 143 3 144 ); 88 145 } 89 146 … … 92 149 * Wishlist scripts. 93 150 */ 94 p rotected function _enqueue_assets() {151 public function enqueue_assets() { 95 152 $ver = LP_ADDON_WISHLIST_VER; 96 153 $min = '.min'; … … 103 160 wp_register_style( 104 161 'lp-course-wishlist', 105 LP_Addon_Wishlist_Preload::$addon->get_plugin_url( "/assets/css/wishlist{$is_rtl}{$min}.css" ),162 $this->get_plugin_url( "/assets/dist/css/wishlist{$is_rtl}{$min}.css" ), 106 163 [], 107 164 $ver … … 109 166 wp_register_script( 110 167 'lp-course-wishlist', 111 LP_Addon_Wishlist_Preload::$addon->get_plugin_url( "/assets/js/dist/wishlist{$min}.js" ),168 $this->get_plugin_url( "/assets/dist/js/wishlist{$min}.js" ), 112 169 [ 'jquery' ], 113 170 $ver, 114 171 [ 'strategy' => 'async' ] 115 172 ); 173 wp_register_script( 174 'lp-course-wishlist-script', 175 $this->get_plugin_url( "/assets/dist/js/lp-wishlist{$min}.js" ), 176 [], 177 $ver, 178 [ 'strategy' => 'async' ] 179 ); 180 181 // Load js for Eduma theme override old template button. 182 $path = 'addons/' . str_replace( 'learnpress-', '', $this->plugin_folder_name ) . '/'; 183 $is_override = Template::check_template_is_override( $path . 'button.php' ); 184 if ( $is_override ) { 185 wp_enqueue_script( 'lp-course-wishlist' ); 186 } 187 } 188 189 /** 190 * Register or enqueue admin styles 191 * 192 * @param array $styles 193 * 194 * @return array 195 * @since 4.0.9 196 * @version 1.0.0 197 */ 198 public function enqueue_admin_style() { 199 // Only enqueue on Site Editor or Block Editor screens for performance optimization 200 $screen = get_current_screen(); 201 if ( ! $screen ) { 202 return; 203 } 204 205 // Check if we're in Site Editor, Block Editor, or widget block editor 206 $allowed_screens = [ 207 'site-editor', // Site Editor (FSE) 208 'widgets', // Block-based widgets 209 ]; 210 211 $is_block_editor = $screen->is_block_editor(); 212 $is_allowed_screen = in_array( $screen->id, $allowed_screens, true ); 213 214 if ( ! $is_block_editor && ! $is_allowed_screen ) { 215 return; 216 } 217 218 $ver = LP_ADDON_WISHLIST_VER; 219 $min = '.min'; 220 if ( LP_Debug::is_debug() ) { 221 $min = ''; 222 $ver = uniqid(); 223 } 224 $is_rtl = is_rtl() ? '-rtl' : ''; 225 226 wp_register_style( 227 'lp-admin-wishlist-block', 228 LP_Addon_Wishlist_Preload::$addon->get_plugin_url( "/assets/dist/css/admin-wishlist-block{$is_rtl}{$min}.css" ), 229 [], 230 $ver 231 ); 232 233 wp_enqueue_style( 'lp-admin-wishlist-block' ); 116 234 } 117 235 … … 132 250 133 251 public function toggle_course_wishlist() { 134 sleep( 1 );135 252 $nonce = ! empty( $_POST['nonce'] ) ? $_POST['nonce'] : null; 136 253 if ( ! wp_verify_nonce( $nonce, 'course-toggle-wishlist' ) ) { … … 141 258 $user_id = get_current_user_id(); 142 259 260 $user = UserModel::find( $user_id, true ); 261 if ( ! $user ) { 262 return; 263 } 264 143 265 if ( ( get_post_type( $course_id ) != 'lp_course' ) || ! $user_id ) { 144 266 return; 145 267 } 146 268 $state = ! empty( $_POST['state'] ) ? $_POST['state'] : false; 147 $wishlist = LP_Addon_Wishlist::get_courses_wishlist( $user_id );269 $wishlist = self::get_courses_wishlist( $user_id ); 148 270 if ( $state === false ) { 149 271 $state = in_array( $course_id, $wishlist ) ? 'off' : 'on'; … … 160 282 } 161 283 if ( sizeof( $wishlist ) ) { 162 update_user_meta( $user_id,'_lpr_wish_list', $wishlist );284 $user->set_meta_value_by_key( '_lpr_wish_list', $wishlist ); 163 285 } else { 164 286 delete_user_meta( $user_id, '_lpr_wish_list' ); 165 } 287 unset( $user->meta_data->_lpr_wish_list ); 288 } 289 166 290 learn_press_send_json( 167 291 array( … … 206 330 * Show wishlist button. 207 331 * 208 * @param $course_id 332 * @param int $course_id 333 * @param string $layout 209 334 * 210 335 * @return void 211 336 */ 212 public function wishlist_button( $course_id = 0 ) {337 public function wishlist_button( $course_id = 0, $layout = 'modern' ) { 213 338 $user_id = get_current_user_id(); 214 339 if ( ! $course_id ) { … … 216 341 } 217 342 218 // If user or course are invalid then return.343 // If user or course are invalid then return. 219 344 if ( ! $user_id || ! $course_id ) { 345 return; 346 } 347 348 $course = CourseModel::find( $course_id, true ); 349 if ( ! $course ) { 220 350 return; 221 351 } … … 226 356 } 227 357 228 wp_enqueue_style( 'lp-course-wishlist' ); 229 wp_enqueue_script( 'lp-course-wishlist' ); 230 231 $classes = array( 'course-wishlist' ); 232 $state = $this->has_in_wishlist( $course_id, $user ) ? 'on' : 'off'; 233 234 if ( $state == 'on' ) { 235 $classes[] = 'on'; 236 } 237 $classes = apply_filters( 'learn_press_course_wishlist_button_classes', $classes, $course_id ); 238 $title = $this->_get_state_title( $state ); 239 240 // fetch template 241 LP_Addon_Wishlist_Preload::$addon->get_template( 242 'button.php', 243 compact( 'user_id', 'course_id', 'classes', 'title', 'state' ) 244 ); 358 $path = 'addons/' . str_replace( 'learnpress-', '', $this->plugin_folder_name ) . '/'; 359 $is_override = Template::check_template_is_override( $path . 'button.php' ); 360 if ( $is_override || $layout === 'old' ) { 361 // Load template old, for some themes override. 362 wp_enqueue_style( 'lp-course-wishlist' ); 363 wp_enqueue_script( 'lp-course-wishlist' ); 364 365 $classes = array( 'course-wishlist' ); 366 $state = $this->has_in_wishlist( $course_id, $user ) ? 'on' : 'off'; 367 368 if ( $state == 'on' ) { 369 $classes[] = 'on'; 370 } 371 $classes = apply_filters( 'learn_press_course_wishlist_button_classes', $classes, $course_id ); 372 $title = $this->_get_state_title( $state ); 373 374 $this->get_template( 375 'button.php', 376 compact( 'user_id', 'course_id', 'classes', 'title', 'state' ) 377 ); 378 } else { 379 echo CourseWishlistTemplate::instance()->html_button_action( $course ); 380 } 245 381 } 246 382 … … 262 398 'callback' => array( $this, 'wishlist_tab_content' ), 263 399 'priority' => 20, 264 'icon' => '<i class=" fas fa-heart"></i>',400 'icon' => '<i class="lp-icon-heart-o"></i>', 265 401 ); 266 402 … … 277 413 $profile = LP_Profile::instance(); 278 414 $viewing_user = $profile->get_user(); 279 LP_Addon_Wishlist_Preload::$addon->get_template( 280 'user-wishlist.php', 281 array( 282 'wishlist' => $this->get_wishlist_courses( $viewing_user->get_id() ), 283 ) 284 ); 415 416 $path = 'addons/' . str_replace( 'learnpress-', '', $this->plugin_folder_name ) . '/'; 417 $is_override = Template::check_template_is_override( $path . 'user-wishlist.php' ); 418 if ( $is_override ) { 419 $this->get_template( 420 'user-wishlist.php', 421 array( 422 'wishlist' => $this->get_wishlist_courses( $viewing_user->get_id() ), 423 ) 424 ); 425 } else { 426 echo CoursesWishlistTemplate::instance()->html_list_courses(); 427 } 285 428 } 286 429 … … 331 474 } 332 475 333 $wish_list = $user->get_meta_value_by_key( '_lpr_wish_list', [] );476 $wish_list = $user->get_meta_value_by_key( self::META_KEY, [] ); 334 477 335 478 return $wish_list; 479 } 480 481 /** 482 * Add or remove course to wishlist 483 * 484 * @param UserModel $userModel 485 * @param CourseModel $courseModel 486 * 487 * @return boolean 488 */ 489 public static function user_add_or_remove_wishlist_course( 490 UserModel $userModel, 491 CourseModel $courseModel 492 ): bool { 493 $wishlist_courses = self::get_courses_wishlist( $userModel->get_id() ); 494 495 $course_id = $courseModel->get_id(); 496 497 if ( in_array( $course_id, $wishlist_courses, true ) ) { 498 // Remove from wishlist. 499 unset( $wishlist_courses[ array_search( $course_id, $wishlist_courses, true ) ] ); 500 $status_wishlisted = false; 501 } else { 502 // Add to wishlist. 503 $wishlist_courses[] = $course_id; 504 $wishlist_courses = array_unique( $wishlist_courses ); 505 $status_wishlisted = true; 506 } 507 508 $userModel->set_meta_value_by_key( self::META_KEY, $wishlist_courses ); 509 510 return $status_wishlisted; 511 } 512 513 /** 514 * Update course ids wishlist for user 515 * 516 * @param UserModel $user 517 * @param array $wish_list 518 * 519 * @return void 520 */ 521 public static function update_courses_wishlist( UserModel $user, array $wish_list ) { 522 $user->set_meta_value_by_key( self::META_KEY, $wish_list ); 336 523 } 337 524 … … 355 542 * Template button ico wishlist 356 543 * 357 * @param int $course_id544 * @param CourseModel $course 358 545 * @param UserModel|false $user 359 546 * 360 547 * @return string 361 548 * @since 4.0.8 362 * @version 1.0. 0363 */ 364 public function html_btn_ico_wishlist( int $course_id, $user ): string {549 * @version 1.0.1 550 */ 551 /*public function html_btn_ico_wishlist( CourseModel $course, $user ): string { 365 552 if ( empty( $user ) ) { 366 553 return ''; … … 370 557 wp_enqueue_script( 'lp-course-wishlist' ); 371 558 372 $is_in_wishlist = $this->has_in_wishlist( $course_id, $user ); 373 374 $class = ''; 559 $is_in_wishlist = $this->has_in_wishlist( $course->get_id(), $user ); 560 561 $class = ''; 562 $label = __( 'add to wishlist', 'learnpress-wishlist' ); 563 $profile_wishlist_url = ''; 375 564 if ( $is_in_wishlist ) { 376 565 $class = 'active'; 377 } 378 379 return sprintf( '<span class="lp-item-wishlist %s" data-item-id="%d"></span>', $class, $course_id ); 380 } 566 $label = __( 'view', 'learnpress-wishlist' ); 567 568 $profile = LP_Profile::instance( $user->get_id() ); 569 $profile_wishlist_url = $profile->get_tab_link( 'wishlist' ); 570 } 571 572 return sprintf( 573 '<a class="lp-item-wishlist %s" data-item-id="%d" href="%s" target="_blank">%s</a>', 574 $class, 575 $course->get_id(), 576 $profile_wishlist_url, 577 $label 578 ); 579 }*/ 381 580 382 581 /** 383 582 * @param array $section 384 * @param CourseModel $course 583 * @param CourseModel $courseModel 385 584 * @param false|UserModel $user 585 * 586 * @return array 587 * @since 4.0.8 588 * @version 1.0.1 589 */ 590 public function single_course_offline( array $section, CourseModel $courseModel, $user ): array { 591 return Template::insert_value_to_position_array( 592 $section, 593 'after', 594 'buttons', 595 'wishlist', 596 sprintf( 597 '<div class="item-meta">%s</div>', 598 CourseWishlistTemplate::instance()->html_button_action( $courseModel ) 599 ) 600 ); 601 } 602 603 public function add_block_elements( $elements ) { 604 $elements[] = new ButtonWishListBlockType(); 605 606 return $elements; 607 } 608 609 /** 610 * Load js and css on archive course 611 */ 612 public function load_js_css_on_archive_course() { 613 wp_enqueue_style( 'lp-course-wishlist' ); 614 wp_enqueue_script( 'lp-course-wishlist' ); 615 wp_enqueue_script( 'lp-course-wishlist-script' ); 616 } 617 618 /** 619 * Show wishlist button on single course modern layout 620 * 621 * @param array $section 622 * @param $courseModel 623 * @param $data 386 624 * 387 625 * @return array … … 389 627 * @version 1.0.0 390 628 */ 391 public function single_course_offline( array $section, CourseModel $course, $user): array {392 $section_new = [];393 if ( empty( $user) ) {629 public function display_on_single_course_modern_layout( $section, $courseModel = null, $data = [] ): array { 630 // Skip for block themes, need add via block widget 631 if ( wp_is_block_theme() ) { 394 632 return $section; 395 633 } 396 634 397 foreach ( $section as $key => $value ) { 398 if ( $key === 'wrapper_end' ) { 399 $section_new['wishlist'] = sprintf( '<div class="item-meta">%s</div>', $this->html_btn_ico_wishlist( $course->get_id(), $user ) ); 400 } 401 $section_new[ $key ] = $value; 402 } 403 635 // Return early if section is not array or courseModel is not provided 636 if ( ! is_array( $section ) || empty( $courseModel ) ) { 637 return is_array( $section ) ? $section : []; 638 } 639 640 $html_button = CourseWishlistTemplate::instance()->html_button_action( $courseModel ); 641 642 $section_new = Template::insert_value_to_position_array( 643 $section, 644 'before', 645 'toggle', 646 'wishlist', 647 $html_button 648 ); 404 649 405 650 return $section_new; 406 651 } 407 652 408 /** 409 * Load js and css on archive course 410 */ 411 public function load_js_css_on_archive_course() { 412 wp_enqueue_style( 'lp-course-wishlist' ); 413 wp_enqueue_script( 'lp-course-wishlist' ); 653 public function display_on_list_course_layout( $section, $courseModel = null, $data = [] ): array { 654 // Skip for block themes, need add via block widget 655 if ( wp_is_block_theme() 656 && ! LP_Page_Controller::is_page_instructor() 657 && ! LP_Page_Controller::is_page_profile() 658 && ! ( isset( $data['id_url'] ) && $data['id_url'] ) == 'wishlist-courses' ) { 659 return $section; 660 } 661 662 // Return early if section is not array or courseModel is not provided 663 if ( ! is_array( $section ) || empty( $courseModel ) ) { 664 return is_array( $section ) ? $section : []; 665 } 666 667 $html_button = CourseWishlistTemplate::instance()->html_button_action( $courseModel, [ 'layout' => 'icon-only' ] ); 668 669 $section_new = Template::insert_value_to_position_array( 670 $section, 671 'before', 672 'img', 673 'wishlist', 674 $html_button 675 ); 676 677 return $section_new; 678 } 679 680 /** 681 * Show wishlist button on course related layout 682 * 683 * @param array $section 684 * @param CourseModel $courseModel 685 * @param array $data 686 * 687 * @return array 688 * @since 4.0.9 689 */ 690 public function display_on_related_course_layout( $section, $courseModel = null, $data = [] ): array { 691 // Return early if section is not array or courseModel is not provided 692 if ( ! is_array( $section ) || empty( $courseModel ) ) { 693 return is_array( $section ) ? $section : []; 694 } 695 696 $html_button = CourseWishlistTemplate::instance()->html_button_action( $courseModel, [ 'layout' => 'icon-only' ] ); 697 698 // Insert wishlist button after wrapper_start (before 'top' key) 699 $section_new = Template::insert_value_to_position_array( 700 $section, 701 'after', 702 'wrapper_start', 703 'wishlist', 704 $html_button 705 ); 706 707 return $section_new; 414 708 } 415 709 } -
learnpress-wishlist/trunk/inc/rest-api/class-lp-rest-wishlist-v1-controller.php
r3143402 r3795620 60 60 ); 61 61 62 register_rest_route(62 /*register_rest_route( 63 63 $this->namespace, 64 64 '/' . $this->rest_base . '/add_or_remove', … … 77 77 ), 78 78 ) 79 ); 79 );*/ 80 80 } 81 81 … … 175 175 } 176 176 177 $wishlists = LP_Addon_Wishlist::get_courses_wishlist( $user_id );177 $wishlists = LP_Addon_Wishlist::get_courses_wishlist( $user_id ); 178 178 if ( ! empty( $wishlists ) && in_array( $course_id, $wishlists ) ) { 179 179 $pos = array_search( $course_id, $wishlists ); … … 228 228 * @return LP_REST_Response 229 229 * @since 4.0.8 230 * @version 1.0. 0230 * @version 1.0.1 231 231 */ 232 public function wishlist_toggle( WP_REST_Request $request ): LP_REST_Response {232 /*public function wishlist_toggle( WP_REST_Request $request ): LP_REST_Response { 233 233 $course_id = $request->get_param( 'id' ); 234 234 $user_id = get_current_user_id(); … … 258 258 } 259 259 260 update_user_meta( $user_id, '_lpr_wish_list', $wish_list );260 LP_Addon_Wishlist::update_courses_wishlist( $user, $wish_list ); 261 261 262 262 $response->data->wishlist = $wish_list; 263 $response->status = 'success'; 263 $response->data->html = LP_Addon_Wishlist_Preload::$addon->html_btn_ico_wishlist( $course, $user ); 264 $response->status = 'success'; 264 265 } catch ( Throwable $e ) { 265 266 $response->message = $e->getMessage(); … … 267 268 268 269 return $response; 269 } 270 }*/ 270 271 } 271 272 } -
learnpress-wishlist/trunk/languages/learnpress-wishlist.pot
r3143402 r3795620 1 # SOME DESCRIPTIVE TITLE. 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 # This file is distributed under the same license as the PACKAGE package. 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 5 # 6 #, fuzzy 1 # Copyright (C) 2026 ThimPress 2 # This file is distributed under the same license as the LearnPress - Course Wishlist plugin. 7 3 msgid "" 8 4 msgstr "" 9 "Project-Id-Version: PACKAGE VERSION\n" 10 "Report-Msgid-Bugs-To: \n" 11 "POT-Creation-Date: 2018-03-26 09:43+0700\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 5 "Project-Id-Version: LearnPress - Course Wishlist 4.1.1\n" 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/learnpress-wishlist\n" 13 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 8 "Language-Team: LANGUAGE <LL@li.org>\n" 15 "Language: \n"16 9 "MIME-Version: 1.0\n" 17 "Content-Type: text/plain; charset= CHARSET\n"10 "Content-Type: text/plain; charset=UTF-8\n" 18 11 "Content-Transfer-Encoding: 8bit\n" 19 20 #: learnpress-wishlist.php:52 12 "POT-Creation-Date: 2026-04-22T05:46:18+03:00\n" 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2.12.0\n" 15 "X-Domain: learnpress-wishlist\n" 16 17 #. Plugin Name of the plugin 18 #: learnpress-wishlist.php 19 msgid "LearnPress - Course Wishlist" 20 msgstr "" 21 22 #. Plugin URI of the plugin 23 #: learnpress-wishlist.php 24 msgid "https://thimpress.com/product/learnpress-course-wishlist/" 25 msgstr "" 26 27 #. Description of the plugin 28 #: learnpress-wishlist.php 29 msgid "Wishlist feature." 30 msgstr "" 31 32 #. Author of the plugin 33 #: learnpress-wishlist.php 34 msgid "ThimPress" 35 msgstr "" 36 37 #. Author URI of the plugin 38 #: learnpress-wishlist.php 39 msgid "http://thimpress.com" 40 msgstr "" 41 42 #: config/elementor/wishlist.php:11 43 #: config/elementor/wishlist_loop.php:11 44 msgid "Style" 45 msgstr "" 46 47 #: config/elementor/wishlist.php:16 48 #: config/elementor/wishlist_loop.php:16 49 msgid "Layout" 50 msgstr "" 51 52 #: config/elementor/wishlist.php:18 53 #: config/elementor/wishlist_loop.php:18 54 msgid "Classic" 55 msgstr "" 56 57 #: config/elementor/wishlist.php:19 58 #: config/elementor/wishlist_loop.php:19 59 msgid "Modern" 60 msgstr "" 61 62 #: config/elementor/wishlist.php:20 63 #: config/elementor/wishlist_loop.php:20 64 msgid "Icon Only" 65 msgstr "" 66 67 #: config/elementor/wishlist.php:26 68 #: config/elementor/wishlist_loop.php:26 69 msgid "Color" 70 msgstr "" 71 72 #: config/elementor/wishlist.php:33 73 #: config/elementor/wishlist_loop.php:33 74 msgid "Color Active, Hover" 75 msgstr "" 76 77 #: config/elementor/wishlist.php:41 78 #: config/elementor/wishlist_loop.php:41 79 msgid "Background Color" 80 msgstr "" 81 82 #: config/elementor/wishlist.php:48 83 #: config/elementor/wishlist_loop.php:48 84 msgid "Background Color Hover" 85 msgstr "" 86 87 #: config/elementor/wishlist.php:55 88 #: config/elementor/wishlist_loop.php:55 89 msgid "Padding" 90 msgstr "" 91 92 #: config/elementor/wishlist.php:77 93 #: config/elementor/wishlist_loop.php:77 94 msgid "Icon Size" 95 msgstr "" 96 97 #: config/elementor/wishlist.php:89 98 #: config/elementor/wishlist_loop.php:89 99 msgid "Icon Space" 100 msgstr "" 101 102 #: inc/Elementor/Widgets/CourseWishlistElementor.php:21 103 msgid "Course Wishlist" 104 msgstr "" 105 106 #: inc/Elementor/Widgets/CourseWishlistLoopElementor.php:20 107 msgid "Course Wishlist Loop" 108 msgstr "" 109 110 #: inc/Gutenberg/Blocks/ButtonWishListBlockType.php:210 111 #: inc/TemplateHooks/CourseWishlistTemplate.php:157 21 112 #, php-format 22 msgid "" 23 "<strong>%s</strong> addon version %s requires %s version %s or higher is " 24 "<strong>installed</strong> and <strong>activated</strong>." 25 msgstr "" 26 27 #: learnpress-wishlist.php:53 28 msgid "LearnPress Wishlist" 29 msgstr "" 30 31 #: learnpress-wishlist.php:55 32 msgid "LearnPress" 33 msgstr "" 34 35 #: inc/functions.php:114 inc/functions.php:174 inc/functions.php:189 36 #: inc/load.php:197 113 msgid "Please %s to add this course to your wishlist." 114 msgstr "" 115 116 #: inc/Gutenberg/Blocks/ButtonWishListBlockType.php:214 117 #: inc/TemplateHooks/CourseWishlistTemplate.php:161 118 msgid "login" 119 msgstr "" 120 121 #: inc/Gutenberg/Blocks/ButtonWishListBlockType.php:234 122 #: inc/TemplateHooks/CourseWishlistTemplate.php:179 123 msgid "Course added to wishlist." 124 msgstr "" 125 126 #: inc/Gutenberg/Blocks/ButtonWishListBlockType.php:238 127 #: inc/TemplateHooks/CourseWishlistTemplate.php:183 128 msgid "View Wishlist" 129 msgstr "" 130 131 #: inc/Gutenberg/Blocks/ButtonWishListBlockType.php:243 132 #: inc/TemplateHooks/CourseWishlistTemplate.php:188 133 msgid "Course removed from wishlist." 134 msgstr "" 135 136 #: inc/load.php:53 137 msgid "wishlist" 138 msgstr "" 139 140 #: inc/load.php:254 141 msgid "You have not permission to do this action" 142 msgstr "" 143 144 #: inc/load.php:297 145 #: inc/TemplateHooks/CourseWishlistTemplate.php:32 146 #: inc/TemplateHooks/CourseWishlistTemplate.php:213 147 #: templates/button.php:25 148 msgid "Add to Wishlist" 149 msgstr "" 150 151 #: inc/load.php:300 152 #: inc/TemplateHooks/CourseWishlistTemplate.php:36 153 #: inc/TemplateHooks/CourseWishlistTemplate.php:218 154 #: templates/button.php:25 155 msgid "Remove from Wishlist" 156 msgstr "" 157 158 #: inc/load.php:311 159 msgid "Remove this course from your wishlist" 160 msgstr "" 161 162 #: inc/load.php:314 163 msgid "Add this course to your wishlist" 164 msgstr "" 165 166 #: inc/load.php:323 167 msgid "This course added to your wishlist" 168 msgstr "" 169 170 #: inc/load.php:326 171 msgid "This course removed from your wishlist" 172 msgstr "" 173 174 #: inc/load.php:396 175 #: inc/TemplateHooks/CourseWishlistTemplate.php:238 176 #: inc/TemplateHooks/CourseWishlistTemplate.php:243 37 177 msgid "Wishlist" 38 178 msgstr "" 39 179 40 #: inc/functions.php:212 41 msgid "Your wishlist" 42 msgstr "" 43 44 #: inc/load.php:40 45 msgid "wishlist" 46 msgstr "" 47 48 #: inc/load.php:98 49 msgid "You have not permission to do this action" 50 msgstr "" 51 52 #: inc/load.php:134 templates/button.php:22 53 msgid "Add to Wishlist" 54 msgstr "" 55 56 #: inc/load.php:134 templates/button.php:22 57 msgid "Remove from Wishlist" 58 msgstr "" 59 60 #: inc/load.php:145 61 msgid "Remove this course from your wishlist" 62 msgstr "" 63 64 #: inc/load.php:145 65 msgid "Add this course to your wishlist" 66 msgstr "" 67 68 #: inc/load.php:154 69 msgid "This course added to your wishlist" 70 msgstr "" 71 72 #: inc/load.php:154 73 msgid "This course removed from your wishlist" 74 msgstr "" 75 76 #: templates/button.php:21 180 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:116 181 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:164 182 msgid "Add to wishlist" 183 msgstr "" 184 185 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:117 186 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:165 187 msgid "Remove from wishlist" 188 msgstr "" 189 190 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:138 191 msgid "This course available in your wishlist" 192 msgstr "" 193 194 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:141 195 msgid "This course not in your wishlist" 196 msgstr "" 197 198 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:184 199 msgid "This course has been removed from your wishlists" 200 msgstr "" 201 202 #: inc/rest-api/class-lp-rest-wishlist-v1-controller.php:189 203 msgid "This course has been added to your wishlists" 204 msgstr "" 205 206 #: inc/TemplateHooks/CoursesWishlistTemplate.php:75 207 msgid "My Wishlist Courses" 208 msgstr "" 209 210 #: templates/button.php:24 77 211 msgid "Processing..." 78 212 msgstr "" -
learnpress-wishlist/trunk/languages/learnpress-woo-payment.pot
r3143402 r3795620 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: LearnPress - Course Wishlist 4.0. 8\n"5 "Project-Id-Version: LearnPress - Course Wishlist 4.0.9-beta.1\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/learnpress-wishlist\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024- 08-29T10:01:50+03:00\n"12 "POT-Creation-Date: 2024-10-05T12:58:19+03:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.8.1\n" … … 71 71 msgstr "" 72 72 73 #: inc/load.php:5 073 #: inc/load.php:53 74 74 msgid "wishlist" 75 75 msgstr "" 76 76 77 #: inc/load.php:1 3777 #: inc/load.php:140 78 78 msgid "You have not permission to do this action" 79 79 msgstr "" 80 80 81 #: inc/load.php:17 381 #: inc/load.php:176 82 82 #: templates/button.php:25 83 83 msgid "Add to Wishlist" 84 84 msgstr "" 85 85 86 #: inc/load.php:17 686 #: inc/load.php:179 87 87 #: templates/button.php:25 88 88 msgid "Remove from Wishlist" 89 89 msgstr "" 90 90 91 #: inc/load.php:1 8791 #: inc/load.php:190 92 92 msgid "Remove this course from your wishlist" 93 93 msgstr "" 94 94 95 #: inc/load.php:19 095 #: inc/load.php:193 96 96 msgid "Add this course to your wishlist" 97 97 msgstr "" 98 98 99 #: inc/load.php: 19999 #: inc/load.php:202 100 100 msgid "This course added to your wishlist" 101 101 msgstr "" 102 102 103 #: inc/load.php:20 2103 #: inc/load.php:205 104 104 msgid "This course removed from your wishlist" 105 105 msgstr "" 106 106 107 #: inc/load.php:2 60107 #: inc/load.php:277 108 108 msgid "Wishlist" 109 msgstr "" 110 111 #: inc/load.php:404 112 msgid "add to wishlist" 113 msgstr "" 114 115 #: inc/load.php:408 116 msgid "view" 109 117 msgstr "" 110 118 -
learnpress-wishlist/trunk/learnpress-wishlist.php
r3143402 r3795620 2 2 /** 3 3 * Plugin Name: LearnPress - Course Wishlist 4 * Plugin URI: http ://thimpress.com/learnpress4 * Plugin URI: https://thimpress.com/product/learnpress-course-wishlist/ 5 5 * Description: Wishlist feature. 6 6 * Author: ThimPress 7 * Version: 4. 0.87 * Version: 4.1.2 8 8 * Author URI: http://thimpress.com 9 9 * Tags: learnpress 10 10 * Text Domain: learnpress-wishlist 11 11 * Domain Path: /languages/ 12 * Require_LP_Version: 4.2.7-beta.0 12 * Require_LP_Version: 4.3.2.7 13 * Requires Plugins: learnpress 13 14 * 14 15 * @package LearnPress-Course-Wishlist … … 18 19 * Prevent loading this file directly 19 20 */ 21 22 use LearnPress\Wishlist\TemplateHooks\CoursesWishlistTemplate; 23 use LearnPress\Wishlist\TemplateHooks\CourseWishlistTemplate; 24 20 25 defined( 'ABSPATH' ) || exit(); 21 26 22 27 const LP_ADDON_WISHLIST_FILE = __FILE__; 28 const LP_ADDON_WISHLIST_PATH = __DIR__; 23 29 24 30 /** … … 74 80 add_action( 'admin_notices', array( $this, 'show_note_errors_require_lp' ) ); 75 81 76 deactivate_plugins( LP_ADDON_WISHLIST_BASENAME );82 /*deactivate_plugins( LP_ADDON_WISHLIST_BASENAME ); 77 83 78 84 if ( isset( $_GET['activate'] ) ) { 79 85 unset( $_GET['activate'] ); 80 } 86 }*/ 81 87 82 88 return; 83 89 } 90 91 require_once LP_ADDON_WISHLIST_PATH . '/vendor/autoload.php'; 84 92 85 93 // Sure LP loaded. … … 91 99 */ 92 100 public function load() { 93 self::$addon = LP_Addon::load( 'LP_Addon_Wishlist', 'inc/load.php', __FILE__ ); 101 include_once LP_ADDON_WISHLIST_PATH . '/inc/load.php'; 102 self::$addon = LP_Addon_Wishlist::instance(); 103 CourseWishlistTemplate::instance(); 104 CoursesWishlistTemplate::instance(); 94 105 } 95 106 -
learnpress-wishlist/trunk/readme.txt
r3660123 r3795620 4 4 Tags: lms, elearning, e-learning, learning management system, education. 5 5 Requires at least: 6.0 6 Tested up to: 7.16 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 4.1. 18 Stable tag: 4.1.2 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 56 56 57 57 == Changelog == 58 59 = 4.1.2 (2026-11-11) = 60 * Fixed: security vulnerability in wishlist button AJAX callback — user_id must be derived from session instead of client input. 61 62 = 4.1.0 (2026-04-22) = 63 ~ Fixed: minor bugs. 64 65 = 4.1.0 (2026-02-02) = 66 ~ Fixed: build min js incorrect. 67 68 = 4.0.9 (2026-01-31) = 69 ~ Display button wishlist in single course (classic/modern/offline), list courses (archive course, single instructor, profile) 70 ~ Improve add/remove wishlist. 71 ~ Display toastify. 72 ~ Check theme override file. 73 ~ Handle with elementor. 74 ~ Add widget block for Gutenberg. 75 ~ Display with user not logged in. 58 76 59 77 = 4.0.8 (2024-08-29) =
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)