Plugin Directory

Changeset 3029162


Ignore:
Timestamp:
01/31/2024 01:15:54 AM (2 years ago)
Author:
buzztone
Message:

Release Version 2.6.2

Location:
contact-form-7-skins
Files:
214 added
4 edited

Legend:

Unmodified
Added
Removed
  • contact-form-7-skins/trunk/includes/admin.php

    r2720992 r3029162  
    7070        // Get the current contact form 7 id
    7171        $form_id = (int) CF7_Skins_Contact::get_form_id( $cf7 );
    72        
     72
    7373        // Update the post meta
    74         if( isset( $_POST['cf7s-template'] ) ) {
     74        if ( isset( $_POST['cf7s-template'] ) ) {
    7575            update_post_meta( $form_id, 'cf7s_template', sanitize_text_field( $_POST['cf7s-template'] ) );
    7676        }
    7777
    78         if( isset( $_POST['cf7s-style'] ) ) {
    79             update_post_meta( $form_id, 'cf7s_style', sanitize_text_field( $_POST['cf7s-style'] ) );
     78        // For new created form, set 'default' style
     79        if ( isset( $_POST['cf7s-style'] ) ) {
     80            if ( metadata_exists( 'post', $form_id, 'cf7s_style' ) ) { // edited form
     81                update_post_meta( $form_id, 'cf7s_style', sanitize_text_field( $_POST['cf7s-style'] ) );
     82            } else { // new form
     83                // Check if a styles is selected, or set 'default' if not selected.
     84                $style = empty( $_POST['cf7s-style'] ) ? 'default' : sanitize_text_field( $_POST['cf7s-style'] );
     85                update_post_meta( $form_id, 'cf7s_style', $style );
     86            }
    8087        }
    8188
    8289        // Update metabox state
    83         if( isset( $_POST['cf7s-postbox'] ) ) {
     90        if ( isset( $_POST['cf7s-postbox'] ) ) {
    8491            update_post_meta( $form_id, 'cf7s_postbox', sanitize_text_field( $_POST['cf7s-postbox'] ) );
    8592        }
  • contact-form-7-skins/trunk/includes/cf7-connect.php

    r2881648 r3029162  
    2727        add_action( 'cf7skins_enqueue_styles', array( $this, 'enqueue_skins_style' ), 9, 1 );
    2828        add_filter( 'wpcf7_form_tag', array( $this, 'add_shortcode_id' ), 1, 2 );
    29         add_filter( 'wpcf7_autop_or_not', array( $this, 'disable_wpcf7_autop' ), 1, 1 ); // @since 2.5.4       
     29        add_filter( 'wpcf7_autop_or_not', array( $this, 'disable_wpcf7_autop' ), 1, 2 ); // @since 2.5.4
    3030    }
    3131   
     
    389389    /**
    390390     * Disable wpcf7_autop to avoid additional <p /> tag in form
    391      *
    392      * @filter 'wpcf7_autop_or_not' contact-form-7/includes/formatting.php
    393      *
    394      * @param $bool (boolean) use wpcf7_autop or not
     391     * CF7 uses this filter for sending mail, without autop enabled,
     392     * message will be sent inline.
     393     *
     394     * @filter 'wpcf7_autop_or_not' at contact-form-7/includes/formatting.php
     395     * and at includes/mail.php
     396     *
     397     * @param $wpcf7_autop (boolean) use wpcf7_autop or not
     398     * @param $options (array) see 'wpcf7_autop_or_not' filter $options
     399     *
     400     * @return (bool) $wpcf7_autop
    395401     *
    396402     * @since 2.5.4
    397403     */
    398     function disable_wpcf7_autop( $bool ) {
    399         return false;
    400     }   
     404    function disable_wpcf7_autop( $wpcf7_autop, $options = false ) {
     405
     406        if ( is_array( $options ) ) { // for CF7 5.8 or greater
     407
     408            if ( 'mail' === $options['for'] ) { // enable autop to add new line in sent mail content
     409                return true;
     410           
     411            } elseif ( 'form' === $options['for'] ) { // disable autop in backend/frontend form
     412                return false;
     413            }
     414
     415        } else { // for lower CF7
     416
     417            if ( is_admin() ) { // disable CF7 autop while editing/creating form
     418                return false;
     419            }
     420        }
     421
     422        return $wpcf7_autop; // autop enabled by default
     423    }
    401424
    402425    /**
  • contact-form-7-skins/trunk/index.php

    r3018535 r3029162  
    44 * Plugin URI:  http://cf7skins.com
    55 * Description: Adds drag & drop Visual Editor with Templates & Styles to Contact Form 7. Requires Contact Form 7.
    6  * Version:     2.6.1
     6 * Version:     2.6.2
    77 * Author:      Neil Murray
    88 * Author URI:  http://cf7skins.com
     
    3131 * @since 0.1.0
    3232 */
    33 define( 'CF7SKINS_VERSION', '2.6.1' );
     33define( 'CF7SKINS_VERSION', '2.6.2' );
    3434define( 'CF7SKINS_OPTIONS', 'cf7skins' ); // Database option names
    3535define( 'CF7SKINS_FEATURE_FILTER', false ); // @since 0.4.0
  • contact-form-7-skins/trunk/readme.txt

    r3018535 r3029162  
    55Tested up to: 6.4
    66Requires PHP: 7.4
    7 Stable tag: 2.6.1
     7Stable tag: 2.6.2
    88Author URI: https://cf7skins.com
    99License: GPLv2 or later
     
    116116
    117117== Changelog ==
     118
     119= 2.6.2 - 2024-01-23 =
     120
     121FIX: Ensure CF7 HTML emails send with line breaks
     122TWEAK: Pre-select "Default" CF7 Skins Style when new form is created
    118123
    119124= 2.6.1 - 2024-01-09 =
Note: See TracChangeset for help on using the changeset viewer.