Changeset 3494297
- Timestamp:
- 03/30/2026 08:41:15 AM (6 days ago)
- Location:
- ghl-wizard
- Files:
-
- 79 added
- 3 edited
-
tags/2.2.3 (added)
-
tags/2.2.3/.gitignore (added)
-
tags/2.2.3/api (added)
-
tags/2.2.3/api/api-client.php (added)
-
tags/2.2.3/api/apis.php (added)
-
tags/2.2.3/api/contacts.php (added)
-
tags/2.2.3/api/get-associations.php (added)
-
tags/2.2.3/api/get-campaigns.php (added)
-
tags/2.2.3/api/get-custom-fields.php (added)
-
tags/2.2.3/api/get-custom-values.php (added)
-
tags/2.2.3/api/get-tags.php (added)
-
tags/2.2.3/api/get-token.php (added)
-
tags/2.2.3/api/get-workflows.php (added)
-
tags/2.2.3/build (added)
-
tags/2.2.3/build/images (added)
-
tags/2.2.3/build/images/bfcm.582d01b0.gif (added)
-
tags/2.2.3/build/images/cw-logo.c88ab71d.png (added)
-
tags/2.2.3/build/index.asset.php (added)
-
tags/2.2.3/build/index.css (added)
-
tags/2.2.3/build/index.js (added)
-
tags/2.2.3/css (added)
-
tags/2.2.3/css/admin-styles.css (added)
-
tags/2.2.3/css/select2.min.css (added)
-
tags/2.2.3/css/styles.css (added)
-
tags/2.2.3/ghl-wizard.php (added)
-
tags/2.2.3/go-pro.svg (added)
-
tags/2.2.3/images (added)
-
tags/2.2.3/images/50-off.png (added)
-
tags/2.2.3/images/apply-tags.png (added)
-
tags/2.2.3/images/ghl-bw.png (added)
-
tags/2.2.3/images/ghl-large-bw.png (added)
-
tags/2.2.3/images/ghl-large.png (added)
-
tags/2.2.3/images/ghl.png (added)
-
tags/2.2.3/images/go-pro.svg (added)
-
tags/2.2.3/images/logo-star-icon.svg (added)
-
tags/2.2.3/images/power-up.png (added)
-
tags/2.2.3/inc (added)
-
tags/2.2.3/inc/content-protection.php (added)
-
tags/2.2.3/inc/elementor (added)
-
tags/2.2.3/inc/elementor.php (added)
-
tags/2.2.3/inc/elementor/restricted-post-widget.php (added)
-
tags/2.2.3/inc/filters.php (added)
-
tags/2.2.3/inc/includes.php (added)
-
tags/2.2.3/inc/membership-api.php (added)
-
tags/2.2.3/inc/membership-page.php (added)
-
tags/2.2.3/inc/metaboxes.php (added)
-
tags/2.2.3/inc/options-page.php (added)
-
tags/2.2.3/inc/power-up.php (added)
-
tags/2.2.3/inc/product-page-settings.php (added)
-
tags/2.2.3/inc/rest-api.php (added)
-
tags/2.2.3/inc/settings-form.php (added)
-
tags/2.2.3/inc/settings-page.php (added)
-
tags/2.2.3/inc/shortcodes.php (added)
-
tags/2.2.3/inc/support-page.php (added)
-
tags/2.2.3/inc/surecart.php (added)
-
tags/2.2.3/inc/utility.php (added)
-
tags/2.2.3/inc/woo.php (added)
-
tags/2.2.3/inc/wp_user.php (added)
-
tags/2.2.3/js (added)
-
tags/2.2.3/js/admin-scripts.js (added)
-
tags/2.2.3/js/autologin.js (added)
-
tags/2.2.3/js/scripts.js (added)
-
tags/2.2.3/js/select2.min.js (added)
-
tags/2.2.3/lib (added)
-
tags/2.2.3/lib/client (added)
-
tags/2.2.3/lib/client/.editorconfig (added)
-
tags/2.2.3/lib/client/.gitignore (added)
-
tags/2.2.3/lib/client/.php-cs-fixer.dist.php (added)
-
tags/2.2.3/lib/client/composer.json (added)
-
tags/2.2.3/lib/client/composer.lock (added)
-
tags/2.2.3/lib/client/phpcs.xml.dist (added)
-
tags/2.2.3/lib/client/readme.md (added)
-
tags/2.2.3/lib/client/src (added)
-
tags/2.2.3/lib/client/src/Client.php (added)
-
tags/2.2.3/lib/client/src/Insights.php (added)
-
tags/2.2.3/lib/client/src/License.php (added)
-
tags/2.2.3/logo-star-icon.svg (added)
-
tags/2.2.3/readme.txt (added)
-
tags/2.2.3/uninstall.php (added)
-
trunk/ghl-wizard.php (modified) (1 diff)
-
trunk/inc/content-protection.php (modified) (9 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ghl-wizard/trunk/ghl-wizard.php
r3493207 r3494297 5 5 * Plugin URI: https://betterwizard.com/lead-connector-wizard/ 6 6 * Description: Connect WordPress with the popular LeadConnector CRM(HighLevel) and combine the power of automation and excellent user experience. Including memberships, content protection, WooCommerce automation, custom fields & many more... 7 * Version: 2.2. 27 * Version: 2.2.3 8 8 * Author: Better Wizard 9 9 * Author URI: https://connectorwizard.app/ -
ghl-wizard/trunk/inc/content-protection.php
r3493207 r3494297 5 5 // Check if a particular post has accees to the 6 6 // Curent logged in user 7 function hlwpw_has_access( $post_id ){7 function hlwpw_has_access( $post_id, $user_id = null ){ 8 8 9 if ( current_user_can('manage_options') ) { 9 $user_id = null === $user_id ? get_current_user_id() : absint( $user_id ); 10 11 if ( $user_id && user_can( $user_id, 'manage_options' ) ) { 10 12 return true; 11 13 } … … 29 31 // 1. login Restriction 30 32 if ( "logged_in" == $login_restriction_value ) { 31 $has_access = is_user_logged_in() ? true : false;33 $has_access = true; // when they logged in, they can access 32 34 }elseif( "logged_out" == $login_restriction_value ){ 33 $has_access = is_user_logged_in() ? false : true;35 $has_access = false; // when they logged in, they can not access 34 36 } 35 37 … … 43 45 44 46 $memberships_levels = array_keys( lcw_get_memberships() ); 45 $has_access = hlwpw_membership_restriction( $memberships_levels );47 $has_access = hlwpw_membership_restriction( $memberships_levels, $user_id ); 46 48 47 49 }else{ 48 50 49 $has_access = hlwpw_membership_restriction( $membership_restriction_value );51 $has_access = hlwpw_membership_restriction( $membership_restriction_value, $user_id ); 50 52 } 51 53 … … 57 59 if ( !empty($tag_restriction_value) && !empty($and_tag_restriction_value) ) { 58 60 59 $tag_restriction = hlwpw_contact_has_tag( $tag_restriction_value );60 $and_tag_restriction = hlwpw_contact_has_tag( $and_tag_restriction_value );61 $tag_restriction = hlwpw_contact_has_tag( $tag_restriction_value, 'any', $user_id ); 62 $and_tag_restriction = hlwpw_contact_has_tag( $and_tag_restriction_value, 'any', $user_id ); 61 63 62 64 if ( $tag_restriction && $and_tag_restriction ) { … … 65 67 66 68 }elseif ( !empty($tag_restriction_value) ) { 67 $has_access = hlwpw_contact_has_tag( $tag_restriction_value );69 $has_access = hlwpw_contact_has_tag( $tag_restriction_value, 'any', $user_id ); 68 70 } 69 71 … … 100 102 // var_dump($m); 101 103 102 function hlwpw_membership_restriction( $memberships ){ 103 104 if ( ! is_user_logged_in() ) { 104 function hlwpw_membership_restriction( $memberships, $user_id = null ){ 105 106 $user_id = null === $user_id ? get_current_user_id() : absint( $user_id ); 107 108 if ( ! $user_id ) { 105 109 return false; 106 110 } 107 111 108 112 // Provide access to admin 109 if ( current_user_can('manage_options') ) {113 if ( user_can( $user_id, 'manage_options') ) { 110 114 return true; 111 115 } … … 131 135 132 136 // Check membership 133 if ( hlwpw_contact_has_tag( $membership_tag ) && ! hlwpw_contact_has_tag( [$_payf_tag, $_susp_tag, $_canc_tag ]) ) {137 if ( hlwpw_contact_has_tag( $membership_tag, 'any', $user_id ) && ! hlwpw_contact_has_tag( [$_payf_tag, $_susp_tag, $_canc_tag ], 'any', $user_id ) ) { 134 138 135 139 return true; … … 197 201 } 198 202 199 function hlwpw_contact_has_tag( $tags, $condition = 'any' ){200 $user_id = get_current_user_id();203 function hlwpw_contact_has_tag( $tags, $condition = 'any', $user_id = null ){ 204 $user_id = null === $user_id ? get_current_user_id() : absint( $user_id ); 201 205 if ( ! $user_id ) { 202 206 return false; … … 627 631 foreach ( $restricted_posts as $post_id ) { 628 632 // Set the parent access condition 629 if ( ! hlwpw_has_access( $post_id ) ) {633 if ( ! hlwpw_has_access( $post_id, $user_id ) ) { 630 634 $has_not_access[] = $post_id; 631 635 } -
ghl-wizard/trunk/readme.txt
r3493207 r3494297 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 2.2. 28 Stable tag: 2.2.3 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 220 220 == Changelog == 221 221 222 = 2.2.3 - 30 March 2026 = 223 * Update Background Job 224 222 225 = 2.2.2 - 28 March 2026 = 223 226 * Performance Enhancement
Note: See TracChangeset
for help on using the changeset viewer.