Plugin Directory

Changeset 3786176


Ignore:
Timestamp:
11/05/2026 02:12:26 PM (3 days ago)
Author:
codepeople
Message:

New version 5.5.2.8
Modifications in the changelogs.

Location:
calculated-fields-form
Files:
521 added
5 edited

Legend:

Unmodified
Added
Removed
  • calculated-fields-form/trunk/README.txt

    r3783682 r3786176  
    55Requires at least: 3.0.5
    66Tested up to: 7.1
    7 Stable tag: 5.5.2.7
     7Stable tag: 5.5.2.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    479479== Changelog ==
    480480
     481= 5.5.2.8 =
     482
     483* Replaces PHP closures with private static methods.
     484
    481485= 5.5.2.7 =
    482486
    … …  
    499503* Adds a mechanism to validate the submitted price.
    500504* Improves the Stripe integration module.
    501 
    502 = 5.5.2.3 =
    503 
    504 * Fixes an issue with the Akismet integration.
    505 * Includes additional verification rules in the Stripe integration.
    506 * Modifies the forms submissions to enclose each submission data in its own context.
  • calculated-fields-form/trunk/changelog.txt

    r3783682 r3786176  
    11== Changelog ==
     2
     3= 5.5.2.8 =
     4
     5* Replaces PHP closures with private static methods.
    26
    37= 5.5.2.7 =
  • calculated-fields-form/trunk/cp_calculatedfieldsf_free.php

    r3783682 r3786176  
    44 * Plugin URI: https://cff.dwbooster.com
    55 * Description: Create forms with field values calculated based in other form field values.
    6  * Version: 5.5.2.7
     6 * Version: 5.5.2.8
    77 * Text Domain: calculated-fields-form
    88 * Author: CodePeople
    … …  
    2626
    2727// Defining main constants.
    28 define( 'CP_CALCULATEDFIELDSF_VERSION', '5.5.2.7' );
     28define( 'CP_CALCULATEDFIELDSF_VERSION', '5.5.2.8' );
    2929define( 'CP_CALCULATEDFIELDSF_TIMEOUT', 30 );
    3030define( 'CP_CALCULATEDFIELDSF_MAIN_FILE_PATH', __FILE__ );
  • calculated-fields-form/trunk/inc/cpcff_submissions.inc.php

    r3783682 r3786176  
    303303                                }
    304304
    305                                 $_resolve_title = static function ( $key ) use ( &$fields_list ) {
    306                                         if (
    307                                                 ! empty( $fields_list[ $key ] ) &&
    308                                                 property_exists( $fields_list[ $key ], 'title' ) &&
    309                                                 ! empty( $fields_list[ $key ]->title )
    310                                         ) {
    311                                                 return preg_replace( array( '/^\s+/', '/\s*\:*\s*$/' ), '', $fields_list[ $key ]->title );
    312                                         }
    313                                         return $key;
    314                                 };
    315 
    316                                 $_format_value = static function ( $value ) {
    317                                         if ( is_array( $value ) ) $value = implode( ', ', $value );
    318                                         return preg_replace( '/^\s*\:*\s*/', '', $value );
    319                                 };
    320 
    321                                 $_emit = static function ( $title, $value ) use ( &$summary, $chln ) {
    322                                         $summary .= ( $title !== '' ? $title . ": " : '' ) . $value . $chln;
    323                                 };
    324 
    325305                                foreach ( $data as $field_name => $field_value ) {
    326306                                        $field_name = strtolower( $field_name );
    … …  
    334314                                                                // Skip file-companion sub-keys; the file field itself emits one line via its joined filenames (cp_calculatedfieldsf_platinum.php:654).
    335315                                                                if ( preg_match( '/^fieldname\d+_(url|path|link|paths|urls|links|name)$/', $sub_key ) ) continue;
    336                                                                 $_emit( $_resolve_title( $sub_key ), $_format_value( $sub_value ) );
     316                                                                $summary .= self::_summary_line( $sub_key, $sub_value, $fields_list, $chln );
    337317                                                        }
    338318                                                }
    339319                                        } else {
    340                                                 $_emit( $_resolve_title( $field_name ), $_format_value( $field_value ) );
     320                                                $summary .= self::_summary_line( $field_name, $field_value, $fields_list, $chln );
    341321                                        }
    342322                                }
    … …  
    400380
    401381                /*********************************** PRIVATE METHODS  ********************************************/
     382
     383                /**
     384                 * Resolves a summary label from the form fields, falling back to the field name.
     385                 */
     386                static private function _summary_title( $key, $fields_list ) {
     387                        if (
     388                                ! empty( $fields_list[ $key ] ) &&
     389                                property_exists( $fields_list[ $key ], 'title' ) &&
     390                                ! empty( $fields_list[ $key ]->title )
     391                        ) {
     392                                return preg_replace( array( '/^\s+/', '/\s*\:*\s*$/' ), '', $fields_list[ $key ]->title );
     393                        }
     394                        return $key;
     395                }
     396
     397                /**
     398                 * Formats a submitted value for the summary.
     399                 */
     400                static private function _summary_value( $value ) {
     401                        if ( is_array( $value ) ) $value = implode( ', ', $value );
     402                        return preg_replace( '/^\s*\:*\s*/', '', $value );
     403                }
     404
     405                /**
     406                 * Builds a summary line using named methods instead of variable function calls.
     407                 */
     408                static private function _summary_line( $key, $value, $fields_list, $chln ) {
     409                        $title = self::_summary_title( $key, $fields_list );
     410                        $value = self::_summary_value( $value );
     411                        return ( $title !== '' ? $title . ": " : '' ) . $value . $chln;
     412                }
    402413
    403414                /**
  • calculated-fields-form/trunk/js/fbuilder-pro-public.jquery.js

    r3783682 r3786176  
    1         $.fbuilder['version'] = '5.5.2.7';
     1        $.fbuilder['version'] = '5.5.2.8';
    22        $.fbuilder['controls'] = $.fbuilder['controls'] || {};
    33        $.fbuilder['forms'] = $.fbuilder['forms'] || {};
Note: See TracChangeset for help on using the changeset viewer.