Changeset 3339334
- Timestamp:
- 08/05/2025 01:56:40 AM (8 months ago)
- Location:
- chama/trunk
- Files:
-
- 6 edited
-
assets/css/admin.css (modified) (1 diff)
-
assets/css/frontend.css (modified) (2 diffs)
-
inc/metaboxes.php (modified) (1 diff)
-
inc/options.php (modified) (4 diffs)
-
inc/protection.php (modified) (4 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chama/trunk/assets/css/admin.css
r3327875 r3339334 270 270 color: #0a4b78; 271 271 } 272 .chamawp_page_chama-settings #wpfooter { 273 position: relative; 274 } 272 275 273 276 .chama-test-mode-label { -
chama/trunk/assets/css/frontend.css
r3327875 r3339334 148 148 .chama-form input[type="url"], 149 149 .chama-form textarea { 150 box-sizing: border-box; 150 151 background-color: #FFF; 151 152 border: 1px solid var(--chama-content-text-color); … … 163 164 padding: 0 14px; 164 165 166 } 167 .chama-input-wrapper input[type="number"] { 168 width: auto !important; 169 flex: 1 1 auto; 165 170 } 166 171 -
chama/trunk/inc/metaboxes.php
r3327875 r3339334 13 13 14 14 ]; 15 $excluded_post_types = ['chama_ tier', 'chama_commission', 'chama_campaign', 'attachment', 'slide'];15 $excluded_post_types = ['chama_newsletter', 'chama_tier', 'chama_commission', 'chama_campaign', 'attachment', 'slide']; 16 16 $post_types = get_post_types($args); 17 17 $filtered_post_types = array_diff($post_types, $excluded_post_types); -
chama/trunk/inc/options.php
r3327875 r3339334 800 800 801 801 ]; 802 $excluded_post_types = ['page', 'attachment', 'chama_ tier', 'chama_commission', 'chama_campaign', 'slide'];802 $excluded_post_types = ['page', 'attachment', 'chama_newsletter', 'chama_tier', 'chama_commission', 'chama_campaign', 'slide']; 803 803 $post_types = get_post_types($args); 804 804 $filtered_post_types = array_diff($post_types, $excluded_post_types); … … 1310 1310 1311 1311 //Require membership for commenting 1312 $chama_require_me bership_for_comments_args = [1312 $chama_require_membership_for_comments_args = [ 1313 1313 'option' => 'chama_require_mebership_for_comments', 1314 1314 'checkbox_value' => 'yes', … … 1317 1317 ]; 1318 1318 1319 add_settings_field("chama_require_mebership_for_comments", "Commenting for members only", 'chama_checkbox_option_generator', $page_slug, "chama_protection_section", $chama_require_me bership_for_comments_args);1319 add_settings_field("chama_require_mebership_for_comments", "Commenting for members only", 'chama_checkbox_option_generator', $page_slug, "chama_protection_section", $chama_require_membership_for_comments_args); 1320 1320 // phpcs:ignore PluginCheck.CodeAnalysis.SettingSanitization.register_settingDynamic 1321 1321 register_setting($settings_group, "chama_require_mebership_for_comments", ['type' => 'string', 'sanitize_callback' => 'sanitize_text_field']); … … 1338 1338 1339 1339 ]; 1340 $excluded_post_types = ['chama_ tier', 'chama_commission', 'chama_campaign', 'attachment', 'slide'];1340 $excluded_post_types = ['chama_newsletter', 'chama_tier', 'chama_commission', 'chama_campaign', 'attachment', 'slide', 'page']; 1341 1341 $post_types = get_post_types($args); 1342 1342 $filtered_post_types = array_diff($post_types, $excluded_post_types); -
chama/trunk/inc/protection.php
r3327875 r3339334 207 207 } 208 208 209 //check global restriction 210 $post_option = 'chama_' . $post_type . '_post_type'; 211 $global_post_level = get_option($post_option); 212 $protected = $global_post_level === '0' ? true : $global_post_level; 213 if ($protected) { 214 return [ 215 'post_level' => $global_post_level, 216 'is_protected' => true, 217 ]; 218 } 219 209 220 return [ 210 221 'post_level' => false, … … 270 281 global $post, $current_user; 271 282 $post_type = get_post_type($post->ID); 272 $excluded_post_types = ['chama_ tier', 'chama_commission', 'chama_campaign', 'chama_donation', 'chama_fund', 'chama_com_order', 'chama_subscription', 'slide'];283 $excluded_post_types = ['chama_newsletter', 'chama_tier', 'chama_commission', 'chama_campaign', 'chama_donation', 'chama_fund', 'chama_com_order', 'chama_subscription', 'slide']; 273 284 if ($post && in_array($post->post_type, $excluded_post_types)) { 274 285 return $content; … … 318 329 function chama_restricted_content_message($post_level) 319 330 { 320 // Enqueue the registered style331 // Enqueue the registered style 321 332 wp_enqueue_style('chama-protected-content'); 322 333 ob_start(); … … 461 472 if (! chama_can_user_access_post($post_level, $current_user->ID)) { 462 473 $chama_hide_content = true; 463 $metadata = '';474 $metadata = ''; 464 475 ob_start(); 465 476 chama_restricted_content_message($post_level_formatted); -
chama/trunk/readme.txt
r3328342 r3339334 1 === ChamaWP - Monetize with donations, memberships, crowdfunding, commissions & restricted content ===1 === ChamaWP – Monetize With Donations, Memberships, Crowdfunding, Commissions & Restricted Content === 2 2 Author: Leetoo 3 3 Contributors: chamawp … … 7 7 Tested up to: 6.8 8 8 Requires PHP: 7.4 9 Stable tag: 1.0.5 9 Stable tag: 1.0.5b 10 10 Text Domain: chama 11 11 License: GPLv3 or later … … 81 81 == Changelog == 82 82 83 = 1.0.6 - 2025-08-04 = 84 * UPDATE: Added support for setting a global membership tier for Custom Post Types. 85 * FIX: Resolved styling issues for input fields on the front end and footer text in the admin dashboard. 86 83 87 = 1.0.5 - 2025-07-13 = 84 88 * UPDATE: Improved logic on some functions to accomodate nonce checks.
Note: See TracChangeset
for help on using the changeset viewer.