Plugin Directory

Changeset 3313519


Ignore:
Timestamp:
06/17/2025 10:37:42 PM (9 months ago)
Author:
michaelbourne
Message:

Version 1.5.2

Location:
wp-commerce7/trunk
Files:
9 added
9 edited

Legend:

Unmodified
Added
Removed
  • wp-commerce7/trunk/README.txt

    r3292181 r3313519  
    44Tags: commerce7
    55Requires at least: 6.0
    6 Tested up to: 6.8
    7 Stable tag: 1.5.0
     6Tested up to: 6.8.1
     7Stable tag: 1.5.2
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     
    7373== Changelog ==
    7474
    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 =
    7682* Added: Club selector block for Gutenberg.
    7783* Added: Admin notice management.
     
    212218== Upgrade Notice ==
    213219
     220= 1.5.1 =
     221You may need to resave existing Club Selector blocks if you've used them already.
     222
    214223= 1.5.0 =
    215224Check out the new Club Selector block for Gutenberg!
  • wp-commerce7/trunk/commerce7-for-wordpress.php

    r3292177 r3313519  
    1212 * Plugin Name: Commerce7 for WordPress
    1313 * Description: Integrate Commerce7 functionality into your WordPress site easily
    14  * Version: 1.5.0
     14 * Version: 1.5.2
    1515 * Author: URSA6 & 5forests
    1616 * Author URI: https://5forests.com
     
    1818 * Requires at least: 6.0
    1919 * Tested up to: 6.8
    20  * Stable tag: 1.5.0
     20 * Stable tag: 1.5.2
    2121 * Requires PHP: 7.4
    2222 * License: GPL3
     
    2828 * Author: Michael Bourne
    2929 * -----
    30  * Last Modified: Sunday, May 11th 2025, 1:50:44 pm
     30 * Last Modified: Thursday, June 5th 2025, 5:16:01 pm
    3131 * Modified By: Michael Bourne
    3232 * -----
     
    4848defined( 'C7WP_ROOT' ) || define( 'C7WP_ROOT', __DIR__ );
    4949defined( 'C7WP_URI' ) || define( 'C7WP_URI', plugin_dir_url( __FILE__ ) );
    50 defined( 'C7WP_VERSION' ) || define( 'C7WP_VERSION', '1.5.0' );
     50defined( 'C7WP_VERSION' ) || define( 'C7WP_VERSION', '1.5.2' );
    5151if ( ! defined( 'C7WP_NOTICES_URL' ) || C7WP_NOTICES_URL !== 'https://c7wp.com/notices.json' ) {
    5252    define( 'C7WP_NOTICES_URL', 'https://c7wp.com/notices.json' );
  • wp-commerce7/trunk/includes/beaverbuilder/load.php

    r3292177 r3313519  
    3030        'buyslug',
    3131        'default',
     32        'collectionlist',
    3233    ];
    3334} else {
  • wp-commerce7/trunk/includes/class-c7wp.php

    r3292177 r3313519  
    886886            'createaccount',
    887887            'loginform',
     888            'collectionlist',
    888889        );
    889890
     
    943944                case 'loginform':
    944945                    $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>';
    945950                    break;
    946951
  • wp-commerce7/trunk/includes/elementor/load.php

    r3292177 r3313519  
    66 * Author: Michael Bourne
    77 * -----
    8  * Last Modified: Sunday, May 11th 2025, 1:30:39 pm
     8 * Last Modified: Thursday, June 5th 2025, 5:11:55 pm
    99 * Modified By: Michael Bourne
    1010 * -----
     
    3434        'joinnow',
    3535        'default',
     36        'collectionlist',
    3637    ];
    3738} else {
  • wp-commerce7/trunk/includes/gutenberg/blocks-v2/clubselector/c7wp-clubselector.js

    r3292177 r3313519  
    4444                default: true,
    4545            },
     46            radioGroupName: {
     47                type: 'string',
     48                default: '',
     49            },
    4650        },
    4751        supports: {
     
    5458            const { displayType, clubs } = attributes;
    5559            const blockProps = useBlockProps();
     60            const radioGroupName = attributes.radioGroupName || 'club-selector';
    5661
    5762            // Check for validation issues
     
    8792                    const firstClub = clubs[0];
    8893                    const clubRoute = window.c7wp_settings?.c7wp_frontend_routes?.club || 'club';
    89                    
     94
    9095                    if (firstClub.slug && firstClub.name) {
    9196                        wp.data.dispatch('core/block-editor').updateBlockAttributes(buttonBlock.clientId, {
     
    99104            // Watch for button changes and revert if modified
    100105            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                }
    101120                const buttonBlock = wp.data.select('core/block-editor').getBlock(clientId).innerBlocks[0];
    102121                if (buttonBlock) {
     
    106125                            const firstClub = clubs[0];
    107126                            const clubRoute = window.c7wp_settings?.c7wp_frontend_routes?.club || 'club';
    108                            
     127
    109128                            if (firstClub.slug && firstClub.name) {
    110129                                const expectedUrl = `/${clubRoute}/${firstClub.slug}/`;
    111130                                const expectedText = firstClub.buttonText || __('Join Club', 'wp-commerce7');
    112                                
    113                                 if (currentButton.attributes.url !== expectedUrl || 
     131
     132                                if (currentButton.attributes.url !== expectedUrl ||
    114133                                    currentButton.attributes.text !== expectedText) {
    115134                                    wp.data.dispatch('core/block-editor').updateBlockAttributes(buttonBlock.clientId, {
     
    121140                        }
    122141                    });
    123                    
     142
    124143                    return () => unsubscribe();
    125144                }
     
    145164                const newClubs = [...clubs];
    146165                newClubs[index] = { ...newClubs[index], [field]: value };
    147                
     166
    148167                if (field === 'slug') {
    149168                    if (!value) {
     
    154173                    return; // Don't allow empty names
    155174                }
    156                
     175
    157176                setAttributes({ clubs: newClubs });
    158177            };
     
    161180            const validateSlug = (index, value) => {
    162181                if (!value) return;
    163                
    164                 const isDuplicate = clubs.some((club, i) => 
     182
     183                const isDuplicate = clubs.some((club, i) =>
    165184                    i !== index && club.slug && club.slug.toLowerCase() === value.toLowerCase()
    166185                );
    167                
     186
    168187                if (isDuplicate) {
    169188                    // Reset to previous value if duplicate
     
    195214                    createElement(InspectorControls, null,
    196215                        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                            }),
    197228                            createElement(RadioControl, {
    198229                                label: __('Display Type'),
     
    248279                    createElement('div', { ...blockProps },
    249280                        createElement('div', { className: 'club-selector-preview' },
    250                             validationIssues.length > 0 && createElement('div', { 
     281                            validationIssues.length > 0 && createElement('div', {
    251282                                className: 'components-notice is-warning',
    252283                                style: { marginBottom: '1em' }
     
    255286                                    createElement('p', null, __('The following issues need to be fixed before the block will render:')),
    256287                                    createElement('ul', null,
    257                                         validationIssues.map((issue, index) => 
     288                                        validationIssues.map((issue, index) =>
    258289                                            createElement('li', { key: index }, issue)
    259290                                        )
     
    270301                                                    createElement('input', {
    271302                                                        type: 'radio',
    272                                                         name: 'club-selector',
     303                                                        name: radioGroupName,
    273304                                                        id: `club-${club.slug}`,
    274305                                                        value: club.slug,
     
    286317                                )
    287318                            ) : (
    288                                 createElement('select', { 
     319                                createElement('select', {
    289320                                    className: 'club-select',
    290321                                    'aria-label': __('Choose your desired club')
     
    318349            const { attributes } = props;
    319350            const { displayType, clubs } = attributes;
    320            
     351            const radioGroupName = attributes.radioGroupName || 'club-selector';
     352
    321353            // 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() !== ''
    326359                ) ||
    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 &&
    331364                        club.slug.toLowerCase() === otherClub.slug.toLowerCase()
    332365                    )
     
    337370
    338371            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}/`;
    343372
    344373            return (
     
    353382                                            createElement('input', {
    354383                                                type: 'radio',
    355                                                 name: 'club-selector',
     384                                                name: radioGroupName,
    356385                                                id: `club-${club.slug}`,
    357386                                                value: club.slug,
     
    369398                        )
    370399                    ) : (
    371                         createElement('select', { 
     400                        createElement('select', {
    372401                            className: 'club-select',
    373402                            'aria-label': __('Choose your desired club')
     
    384413                    ),
    385414                    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),
    395416                    ),
    396417                )
  • wp-commerce7/trunk/includes/gutenberg/load.php

    r3292177 r3313519  
    66 * Author: Michael Bourne
    77 * -----
    8  * Last Modified: Monday, April 14th 2025, 3:39:26 pm
     8 * Last Modified: Wednesday, June 4th 2025, 4:19:48 pm
    99 * Modified By: Michael Bourne
    1010 * -----
     
    3535        'loginform',
    3636        'clubselector',
     37        'collectionlist',
    3738    );
    3839    $dir = 'blocks-v2';
  • wp-commerce7/trunk/includes/themeco/cornerstone/controls.php

    r3167363 r3313519  
    3131          array( 'value' => 'form', 'label' => __( 'General Form', 'wp-commerce7' ) ),
    3232          array( 'value' => 'joinnow', 'label' => __( 'Join/Edit Club Magic Button', 'wp-commerce7' ) ),
     33          array( 'value' => 'collectionlist', 'label' => __( 'Collection List', 'wp-commerce7' ) ),
    3334        ),
    3435      ),
  • wp-commerce7/trunk/includes/wpbakery/wpbakery-legacy.php

    r3207744 r3313519  
    66 * Author: Michael Bourne
    77 * -----
    8  * Last Modified: Sunday, December 8th 2024, 1:30:28 pm
     8 * Last Modified: Thursday, June 5th 2025, 5:11:17 pm
    99 * Modified By: Michael Bourne
    1010 * -----
     
    9393                        __( 'Login Form', 'wp-commerce7' )                  => 'loginform',
    9494                        __( 'Create Account Form', 'wp-commerce7' )         => 'creataccount',
     95                        __( 'Collection List', 'wp-commerce7' )               => 'collectionlist',
    9596                    ),
    9697                    'std'         => 'default',
     
    102103                    'heading'     => __( 'Data', 'wp-commerce7' ),
    103104                    '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' ),
    105106                ),
    106107            ),
Note: See TracChangeset for help on using the changeset viewer.