Changeset 3313519
- Timestamp:
- 06/17/2025 10:37:42 PM (9 months ago)
- Location:
- wp-commerce7/trunk
- Files:
-
- 9 added
- 9 edited
-
README.txt (modified) (3 diffs)
-
commerce7-for-wordpress.php (modified) (4 diffs)
-
includes/beaverbuilder/collectionlist (added)
-
includes/beaverbuilder/collectionlist/default.php (added)
-
includes/beaverbuilder/collectionlist/icon.svg (added)
-
includes/beaverbuilder/collectionlist/includes (added)
-
includes/beaverbuilder/collectionlist/includes/frontend.php (added)
-
includes/beaverbuilder/load.php (modified) (1 diff)
-
includes/class-c7wp.php (modified) (2 diffs)
-
includes/elementor/elementor-collectionlist.php (added)
-
includes/elementor/load.php (modified) (2 diffs)
-
includes/gutenberg/blocks-v2/clubselector/c7wp-clubselector.js (modified) (19 diffs)
-
includes/gutenberg/blocks-v2/collectionlist (added)
-
includes/gutenberg/blocks-v2/collectionlist/c7wp-collectionlist.css (added)
-
includes/gutenberg/blocks-v2/collectionlist/c7wp-collectionlist.js (added)
-
includes/gutenberg/load.php (modified) (2 diffs)
-
includes/themeco/cornerstone/controls.php (modified) (1 diff)
-
includes/wpbakery/wpbakery-legacy.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-commerce7/trunk/README.txt
r3292181 r3313519 4 4 Tags: commerce7 5 5 Requires at least: 6.0 6 Tested up to: 6.8 7 Stable tag: 1.5. 06 Tested up to: 6.8.1 7 Stable tag: 1.5.2 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.en.html … … 73 73 == Changelog == 74 74 75 = 1.5.0 - May 12, 2025 = 75 = 1.5.2 - June 5, 2025 = 76 * Added: New "Collection List" block - Outputs a list of links to all Collections with a Web Status of "Available" 77 78 = 1.5.1 - May 29, 2025 = 79 * Fixed: Allow multiple club selectors per page using the new Radio Group Name field. You may have to recreate your existing selectors, or at the very least, press the "attempt recovery" button when you edit them next. 80 81 = 1.5.0 - May 11, 2025 = 76 82 * Added: Club selector block for Gutenberg. 77 83 * Added: Admin notice management. … … 212 218 == Upgrade Notice == 213 219 220 = 1.5.1 = 221 You may need to resave existing Club Selector blocks if you've used them already. 222 214 223 = 1.5.0 = 215 224 Check out the new Club Selector block for Gutenberg! -
wp-commerce7/trunk/commerce7-for-wordpress.php
r3292177 r3313519 12 12 * Plugin Name: Commerce7 for WordPress 13 13 * Description: Integrate Commerce7 functionality into your WordPress site easily 14 * Version: 1.5. 014 * Version: 1.5.2 15 15 * Author: URSA6 & 5forests 16 16 * Author URI: https://5forests.com … … 18 18 * Requires at least: 6.0 19 19 * Tested up to: 6.8 20 * Stable tag: 1.5. 020 * Stable tag: 1.5.2 21 21 * Requires PHP: 7.4 22 22 * License: GPL3 … … 28 28 * Author: Michael Bourne 29 29 * ----- 30 * Last Modified: Sunday, May 11th 2025, 1:50:44pm30 * Last Modified: Thursday, June 5th 2025, 5:16:01 pm 31 31 * Modified By: Michael Bourne 32 32 * ----- … … 48 48 defined( 'C7WP_ROOT' ) || define( 'C7WP_ROOT', __DIR__ ); 49 49 defined( 'C7WP_URI' ) || define( 'C7WP_URI', plugin_dir_url( __FILE__ ) ); 50 defined( 'C7WP_VERSION' ) || define( 'C7WP_VERSION', '1.5. 0' );50 defined( 'C7WP_VERSION' ) || define( 'C7WP_VERSION', '1.5.2' ); 51 51 if ( ! defined( 'C7WP_NOTICES_URL' ) || C7WP_NOTICES_URL !== 'https://c7wp.com/notices.json' ) { 52 52 define( 'C7WP_NOTICES_URL', 'https://c7wp.com/notices.json' ); -
wp-commerce7/trunk/includes/beaverbuilder/load.php
r3292177 r3313519 30 30 'buyslug', 31 31 'default', 32 'collectionlist', 32 33 ]; 33 34 } else { -
wp-commerce7/trunk/includes/class-c7wp.php
r3292177 r3313519 886 886 'createaccount', 887 887 'loginform', 888 'collectionlist', 888 889 ); 889 890 … … 943 944 case 'loginform': 944 945 $output .= '<div id="c7-login-form" data-redirect-to="' . esc_attr( $atts['data'] ) . '"></div>'; 946 break; 947 948 case 'collectionlist': 949 $output .= '<div id="c7-collection-list"></div>'; 945 950 break; 946 951 -
wp-commerce7/trunk/includes/elementor/load.php
r3292177 r3313519 6 6 * Author: Michael Bourne 7 7 * ----- 8 * Last Modified: Sunday, May 11th 2025, 1:30:39pm8 * Last Modified: Thursday, June 5th 2025, 5:11:55 pm 9 9 * Modified By: Michael Bourne 10 10 * ----- … … 34 34 'joinnow', 35 35 'default', 36 'collectionlist', 36 37 ]; 37 38 } else { -
wp-commerce7/trunk/includes/gutenberg/blocks-v2/clubselector/c7wp-clubselector.js
r3292177 r3313519 44 44 default: true, 45 45 }, 46 radioGroupName: { 47 type: 'string', 48 default: '', 49 }, 46 50 }, 47 51 supports: { … … 54 58 const { displayType, clubs } = attributes; 55 59 const blockProps = useBlockProps(); 60 const radioGroupName = attributes.radioGroupName || 'club-selector'; 56 61 57 62 // Check for validation issues … … 87 92 const firstClub = clubs[0]; 88 93 const clubRoute = window.c7wp_settings?.c7wp_frontend_routes?.club || 'club'; 89 94 90 95 if (firstClub.slug && firstClub.name) { 91 96 wp.data.dispatch('core/block-editor').updateBlockAttributes(buttonBlock.clientId, { … … 99 104 // Watch for button changes and revert if modified 100 105 useEffect(() => { 106 const block = wp.data.select('core/block-editor').getBlock(clientId); 107 if (!block) return; 108 // Filter to only core/button blocks 109 const buttonBlocks = block.innerBlocks.filter(b => b.name === 'core/button'); 110 // If more than one button, remove extras 111 if (buttonBlocks.length > 1) { 112 // Keep only the first button 113 const firstButton = buttonBlocks[0]; 114 wp.data.dispatch('core/block-editor').replaceInnerBlocks( 115 clientId, 116 [firstButton], 117 false // do not update selection 118 ); 119 } 101 120 const buttonBlock = wp.data.select('core/block-editor').getBlock(clientId).innerBlocks[0]; 102 121 if (buttonBlock) { … … 106 125 const firstClub = clubs[0]; 107 126 const clubRoute = window.c7wp_settings?.c7wp_frontend_routes?.club || 'club'; 108 127 109 128 if (firstClub.slug && firstClub.name) { 110 129 const expectedUrl = `/${clubRoute}/${firstClub.slug}/`; 111 130 const expectedText = firstClub.buttonText || __('Join Club', 'wp-commerce7'); 112 113 if (currentButton.attributes.url !== expectedUrl || 131 132 if (currentButton.attributes.url !== expectedUrl || 114 133 currentButton.attributes.text !== expectedText) { 115 134 wp.data.dispatch('core/block-editor').updateBlockAttributes(buttonBlock.clientId, { … … 121 140 } 122 141 }); 123 142 124 143 return () => unsubscribe(); 125 144 } … … 145 164 const newClubs = [...clubs]; 146 165 newClubs[index] = { ...newClubs[index], [field]: value }; 147 166 148 167 if (field === 'slug') { 149 168 if (!value) { … … 154 173 return; // Don't allow empty names 155 174 } 156 175 157 176 setAttributes({ clubs: newClubs }); 158 177 }; … … 161 180 const validateSlug = (index, value) => { 162 181 if (!value) return; 163 164 const isDuplicate = clubs.some((club, i) => 182 183 const isDuplicate = clubs.some((club, i) => 165 184 i !== index && club.slug && club.slug.toLowerCase() === value.toLowerCase() 166 185 ); 167 186 168 187 if (isDuplicate) { 169 188 // Reset to previous value if duplicate … … 195 214 createElement(InspectorControls, null, 196 215 createElement(PanelBody, { title: __('Club Selector Settings'), initialOpen: true }, 216 createElement(TextControl, { 217 label: __('Radio Group Name', 'wp-commerce7'), 218 value: attributes.radioGroupName, 219 onChange: (value) => { 220 // Sanitize: allow only a-z, A-Z, 0-9, -, _ 221 const sanitized = value.replace(/[^a-zA-Z0-9_-]/g, ''); 222 setAttributes({ radioGroupName: sanitized }); 223 }, 224 help: __('This must be unique if you use more than one Club Selector block on a page.', 'wp-commerce7'), 225 placeholder: __('premierclub', 'wp-commerce7'), 226 required: true, 227 }), 197 228 createElement(RadioControl, { 198 229 label: __('Display Type'), … … 248 279 createElement('div', { ...blockProps }, 249 280 createElement('div', { className: 'club-selector-preview' }, 250 validationIssues.length > 0 && createElement('div', { 281 validationIssues.length > 0 && createElement('div', { 251 282 className: 'components-notice is-warning', 252 283 style: { marginBottom: '1em' } … … 255 286 createElement('p', null, __('The following issues need to be fixed before the block will render:')), 256 287 createElement('ul', null, 257 validationIssues.map((issue, index) => 288 validationIssues.map((issue, index) => 258 289 createElement('li', { key: index }, issue) 259 290 ) … … 270 301 createElement('input', { 271 302 type: 'radio', 272 name: 'club-selector',303 name: radioGroupName, 273 304 id: `club-${club.slug}`, 274 305 value: club.slug, … … 286 317 ) 287 318 ) : ( 288 createElement('select', { 319 createElement('select', { 289 320 className: 'club-select', 290 321 'aria-label': __('Choose your desired club') … … 318 349 const { attributes } = props; 319 350 const { displayType, clubs } = attributes; 320 351 const radioGroupName = attributes.radioGroupName || 'club-selector'; 352 321 353 // Don't render if no clubs, any club is invalid, or slugs are not unique 322 if (!clubs.length || 323 !clubs.every(club => 324 club.slug && club.slug.trim() !== '' && 325 club.name && club.name.trim() !== '' 354 if (!clubs.length || 355 !clubs.every(club => 356 club.slug && club.slug.trim() !== '' && 357 club.name && club.name.trim() !== '' && 358 club.buttonText && club.buttonText.trim() !== '' 326 359 ) || 327 !clubs.every((club, index) => 328 !clubs.some((otherClub, otherIndex) => 329 index !== otherIndex && 330 club.slug && otherClub.slug && 360 !clubs.every((club, index) => 361 !clubs.some((otherClub, otherIndex) => 362 index !== otherIndex && 363 club.slug && otherClub.slug && 331 364 club.slug.toLowerCase() === otherClub.slug.toLowerCase() 332 365 ) … … 337 370 338 371 const blockProps = useBlockProps.save(); 339 const firstClub = clubs[0];340 const clubRoute = window.c7wp_settings?.c7wp_frontend_routes?.club || 'club';341 const buttonText = firstClub.buttonText || __('Join Club', 'wp-commerce7');342 const buttonUrl = `/${clubRoute}/${firstClub.slug}/`;343 372 344 373 return ( … … 353 382 createElement('input', { 354 383 type: 'radio', 355 name: 'club-selector',384 name: radioGroupName, 356 385 id: `club-${club.slug}`, 357 386 value: club.slug, … … 369 398 ) 370 399 ) : ( 371 createElement('select', { 400 createElement('select', { 372 401 className: 'club-select', 373 402 'aria-label': __('Choose your desired club') … … 384 413 ), 385 414 createElement('div', { className: 'wp-block-buttons' }, 386 createElement(InnerBlocks.Content, { 387 template: [ 388 ['core/button', { 389 text: buttonText, 390 url: buttonUrl, 391 className: 'club-selector-button' 392 }] 393 ] 394 }), 415 createElement(InnerBlocks.Content), 395 416 ), 396 417 ) -
wp-commerce7/trunk/includes/gutenberg/load.php
r3292177 r3313519 6 6 * Author: Michael Bourne 7 7 * ----- 8 * Last Modified: Monday, April 14th 2025, 3:39:26pm8 * Last Modified: Wednesday, June 4th 2025, 4:19:48 pm 9 9 * Modified By: Michael Bourne 10 10 * ----- … … 35 35 'loginform', 36 36 'clubselector', 37 'collectionlist', 37 38 ); 38 39 $dir = 'blocks-v2'; -
wp-commerce7/trunk/includes/themeco/cornerstone/controls.php
r3167363 r3313519 31 31 array( 'value' => 'form', 'label' => __( 'General Form', 'wp-commerce7' ) ), 32 32 array( 'value' => 'joinnow', 'label' => __( 'Join/Edit Club Magic Button', 'wp-commerce7' ) ), 33 array( 'value' => 'collectionlist', 'label' => __( 'Collection List', 'wp-commerce7' ) ), 33 34 ), 34 35 ), -
wp-commerce7/trunk/includes/wpbakery/wpbakery-legacy.php
r3207744 r3313519 6 6 * Author: Michael Bourne 7 7 * ----- 8 * Last Modified: Sunday, December 8th 2024, 1:30:28pm8 * Last Modified: Thursday, June 5th 2025, 5:11:17 pm 9 9 * Modified By: Michael Bourne 10 10 * ----- … … 93 93 __( 'Login Form', 'wp-commerce7' ) => 'loginform', 94 94 __( 'Create Account Form', 'wp-commerce7' ) => 'creataccount', 95 __( 'Collection List', 'wp-commerce7' ) => 'collectionlist', 95 96 ), 96 97 'std' => 'default', … … 102 103 'heading' => __( 'Data', 'wp-commerce7' ), 103 104 'param_name' => 'data', 104 'description' => __( 'Enter the data for the content type, if applicable.', 'wp-commerce7' ),105 'description' => __( 'Enter the data (normally a slug) for the content type, if applicable.', 'wp-commerce7' ), 105 106 ), 106 107 ),
Note: See TracChangeset
for help on using the changeset viewer.