WordPress.org

Plugin Directory

Changeset 1586887


Ignore:
Timestamp:
02/02/17 01:55:03 (7 months ago)
Author:
katzwebdesign
Message:

Version 2.0.2

Location:
contact-form-7-modules
Files:
9 added
5 edited

Legend:

Unmodified
Added
Removed
  • contact-form-7-modules/trunk/hidden.php

    r1189181 r1586887  
    55Description: Add hidden fields to the popular Contact Form 7 plugin. 
    66Author: Katz Web Services, Inc. 
    7 Author URI: http://www.katzwebservices.com 
    8 Version: 2.0 
     7Author URI: http://www.katz.co 
     8Version: 2.0.2 
    99Text Domain: cf7_modules 
    1010Domain Path: languages 
     11License: GPLv2 or later 
     12License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    1113*/ 
    12  
    13 /*  Copyright 2015 Katz Web Services, Inc. (email: info at katzwebservices.com) 
    14  
    15     This program is free software; you can redistribute it and/or modify 
    16     it under the terms of the GNU General Public License as published by 
    17     the Free Software Foundation; either version 2 of the License, or 
    18     (at your option) any later version. 
    19  
    20     This program is distributed in the hope that it will be useful, 
    21     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    22     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    23     GNU General Public License for more details. 
    24  
    25     You should have received a copy of the GNU General Public License 
    26     along with this program; if not, write to the Free Software 
    27     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    28 */ 
    29  
    30 add_action('init', 'contact_form_7_hidden_fields_textdomain'); 
    31  
    32 function contact_form_7_hidden_fields_textdomain() { 
    33     // Load the default language files 
    34     load_plugin_textdomain( 'cf7_modules', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 
    35 } 
    36  
    3714 
    3815add_action('plugins_loaded', 'contact_form_7_hidden_fields', 11); 
     
    4017function contact_form_7_hidden_fields() { 
    4118    global $pagenow; 
    42     if( class_exists('WPCF7_Shortcode') ) { 
    43         wpcf7_add_shortcode( array( 'hidden', 'hidden*' ), 'wpcf7_hidden_shortcode_handler', true ); 
     19    if ( class_exists( 'WPCF7_Shortcode' ) || class_exists('WPCF7_FormTag') ) { 
     20        if ( function_exists( 'wpcf7_add_form_tag' ) ) { 
     21            wpcf7_add_form_tag( array( 'hidden', 'hidden*' ), 'wpcf7_hidden_shortcode_handler', true ); 
     22        } else { 
     23            wpcf7_add_shortcode( array( 'hidden', 'hidden*' ), 'wpcf7_hidden_shortcode_handler', true ); 
     24        } 
    4425    } else { 
    45         if($pagenow != 'plugins.php') { return; } 
    46         add_action('admin_notices', 'cfhiddenfieldserror'); 
    47         add_action('admin_enqueue_scripts', 'contact_form_7_hidden_fields_scripts'); 
    48  
    49         function cfhiddenfieldserror() { 
    50             $out = '<div class="error" id="messages"><p>'; 
    51             if(file_exists(WP_PLUGIN_DIR.'/contact-form-7/wp-contact-form-7.php')) { 
    52                 $out .= 'The Contact Form 7 is installed, but <strong>you must activate Contact Form 7</strong> below for the Hidden Fields Module to work.'; 
    53             } else { 
    54                 $out .= 'The Contact Form 7 plugin must be installed for the Hidden Fields Module to work. <a href="'.admin_url('plugin-install.php?tab=plugin-information&plugin=contact-form-7&from=plugins&TB_iframe=true&width=600&height=550').'" class="thickbox" title="Contact Form 7">Install Now.</a>'; 
    55             } 
    56             $out .= '</p></div>'; 
    57             echo $out; 
    58         } 
    59     } 
     26        if ( $pagenow != 'plugins.php' ) { 
     27            return; 
     28        } 
     29 
     30        add_action( 'admin_notices', 'contact_form_7_hidden_fields_error' ); 
     31        add_action( 'admin_enqueue_scripts', 'contact_form_7_hidden_fields_scripts' ); 
     32    } 
     33} 
     34 
     35function contact_form_7_hidden_fields_error() { 
     36    $out = '<div class="error" id="messages"><p>'; 
     37    if ( @ file_exists( WP_PLUGIN_DIR . '/contact-form-7/wp-contact-form-7.php' ) ) { 
     38        $out .= esc_html__( 'The Contact Form 7 is installed, but you must activate Contact Form 7 below for the Hidden Fields Module to work.', 'cf7_modules' ); 
     39    } else { 
     40        $out .= esc_html__( 'The Contact Form 7 plugin must be installed for the Hidden Fields Module to work.', 'cf7_modules' ); 
     41        $install_url = esc_url_raw( admin_url( 'plugin-install.php?tab=plugin-information&plugin=contact-form-7&from=plugins&TB_iframe=true&width=600&height=550' ) ); 
     42        $out .= sprintf( ' <a href="%s" class="thickbox" title="Contact Form 7">%s</a>', $install_url, esc_html__( 'Install Now.', 'cf7_modules' ) ); 
     43    } 
     44    $out .= '</p></div>'; 
     45    echo $out; 
    6046} 
    6147 
     
    7965 */ 
    8066function wpcf7_form_elements_strip_paragraphs_and_brs($form) { 
    81     return preg_replace_callback('/<p>(<input\stype="hidden"(?:.*?))<\/p>/ism', 'wpcf7_form_elements_strip_paragraphs_and_brs_callback', $form); 
     67    return preg_replace_callback( '/<p>(<input\stype="hidden"(?:.*?))<\/p>/ism', 'wpcf7_form_elements_strip_paragraphs_and_brs_callback', $form ); 
    8268} 
    8369 
    8470function wpcf7_form_elements_strip_paragraphs_and_brs_callback($matches = array()) { 
    85     return "\n".'<!-- CF7 Modules -->'."\n".'<div style=\'display:none;\'>'.str_replace('<br>', '', str_replace('<br />', '', stripslashes_deep($matches[1]))).'</div>'."\n".'<!-- End CF7 Modules -->'."\n"; 
     71    return "\n" . '<!-- CF7 Modules -->' . "\n" . '<div style=\'display:none;\'>' . str_replace( '<br>', '', str_replace( '<br />', '', stripslashes_deep( $matches[1] ) ) ) . '</div>' . "\n" . '<!-- End CF7 Modules -->' . "\n"; 
    8672} 
    8773 
     
    9480function wpcf7_hidden_shortcode_handler( $tag ) { 
    9581 
    96     $tag = new WPCF7_Shortcode( $tag ); 
     82    if ( class_exists( 'WPCF7_FormTag' ) ) { 
     83        $tag = new WPCF7_FormTag( $tag ); 
     84    } else { 
     85        $tag = new WPCF7_Shortcode( $tag ); 
     86    } 
    9787 
    9888    if ( empty( $tag->name ) ) { 
     
    127117 
    128118    // Post data hasn't filled yet. No arrays. 
    129     if( $default_value === $value ) { 
     119    if ( $default_value === $value ) { 
    130120        $value = contact_form_7_hidden_fields_fill_user_data( $value ); 
    131121    } 
     
    173163    // Process user stuff 
    174164    if ( preg_match( '/user/ism', strtolower( trim( $value ) ) ) && is_user_logged_in() ) { 
    175         global $current_user; 
    176         get_currentuserinfo(); 
     165 
     166        $current_user = wp_get_current_user(); 
    177167 
    178168        switch ( $value ) { 
     
    273263} 
    274264 
    275 add_filter('wpcf7_hidden_field_value_example', 'wpcf7_hidden_field_add_query_arg'); 
    276 function wpcf7_hidden_field_add_query_arg($value = '') { 
    277     if(isset($_GET['category'])) { 
    278         return $_GET['category']; 
    279     } 
    280     return $value; 
    281 } 
    282  
    283265 
    284266/* Tag generator */ 
     
    290272function wpcf7_add_tag_generator_hidden() { 
    291273 
    292     if( class_exists('WPCF7_TagGenerator') ) { 
     274    if ( class_exists( 'WPCF7_TagGenerator' ) ) { 
    293275 
    294276        $tag_generator = WPCF7_TagGenerator::get_instance(); 
    295         $tag_generator->add( 'hidden', __( 'hidden', 'cf7_modules' ), 'wpcf7_tg_pane_hidden' ); 
     277        $tag_generator->add( 'hidden', _x( 'hidden', 'the name of the field button in CF7', 'cf7_modules' ), 'wpcf7_tg_pane_hidden' ); 
    296278 
    297279    } 
     
    303285 
    304286    $description = __( "Generate a form tag for a hidden field. For more details, see %s.", 'contact-form-7' ); 
    305     $desc_link = wpcf7_link( __( 'https://wordpress.org/plugins/contact-form-7-modules/', 'contact-form-7' ), __( 'the plugin page on WordPress.org', 'contact-form-7' ), array('target' => '_blank' ) ); 
    306 ?> 
    307 <div class="control-box"> 
    308     <fieldset> 
    309         <legend><?php printf( esc_html( $description ), $desc_link ); ?></legend> 
    310  
    311         <table class="form-table"> 
    312             <tbody> 
    313                 <tr> 
    314                     <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label></th> 
    315                     <td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td> 
    316                 </tr> 
    317  
    318                 <tr> 
    319                     <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'ID attribute', 'contact-form-7' ) ); ?> (<?php echo esc_html( __( 'optional', 'cf7_modules' ) ); ?>)</label></th> 
    320                     <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td> 
    321                 </tr> 
    322                 <tr> 
    323                     <th scope="row"> 
    324                         <?php _e('Value', 'cf7_modules'); ?> 
    325                     </th> 
    326                     <td> 
    327                         <input type="text" name="values" class="oneline" /> 
    328                         <div> 
    329                             <input type="checkbox" name="watermark" class="option" />&nbsp;<?php echo esc_html( __( 'Use this text as watermark?', 'cf7_modules' ) ); ?> 
    330                         </div> 
    331                     </td> 
    332                 </tr> 
    333                 <tr> 
    334                     <th scope="row"> 
    335                         <?php _e('Dynamic Values', 'cf7_modules'); ?> 
    336                     </th> 
    337                     <td> 
    338                         <span class="howto" style="font-size:1em;"><?php _e('To use dynamic data from the post or page the form is embedded on, you can use the following values:', 'cf7_modules'); ?></span> 
    339  
    340                         <ul> 
    341                             <li><?php _e('<code>post_title</code>: The title of the post/page', 'cf7_modules'); ?></li> 
    342                             <li><?php _e('<code>post_url</code>: The URL of the post/page', 'cf7_modules'); ?></li> 
    343                             <li><?php _e('<code>post_category</code>: The categories the post is in, comma-separated', 'cf7_modules'); ?></li> 
    344                             <li><?php _e('<code>post_date</code>: The date the post/page was created', 'cf7_modules'); ?></li> 
    345                             <li><?php _e('<code>post_author</code>: The name of the author of the post/page', 'cf7_modules'); ?></li> 
    346                         </ul> 
    347                         <span class="howto"><?php _e('The following values will be replaced if an user is logged in:', 'cf7_modules'); ?></span> 
    348                         <ul> 
    349                             <li><?php _e('<code>user_name</code>: User Login', 'cf7_modules'); ?></li> 
    350                             <li><?php _e('<code>user_id</code>: User ID', 'cf7_modules'); ?></li> 
    351                             <li><?php _e('<code>user_email</code>: User Email Address', 'cf7_modules'); ?></li> 
    352                             <li><?php _e('<code>user_display_name</code>: Display Name (Generally the first and last name of the user)', 'cf7_modules'); ?></li> 
    353                         </ul> 
    354                     </td> 
    355                 </tr> 
    356             </tbody> 
    357         </table> 
    358     </fieldset> 
    359 </div> 
    360     <div class="insert-box"> 
    361         <input type="text" name="hidden" class="tag code" readonly="readonly" onfocus="this.select()" /> 
    362  
    363         <div class="submitbox"> 
    364             <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" /> 
    365         </div> 
    366  
    367         <br class="clear" /> 
    368  
    369         <p class="description mail-tag"><label for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( "To use the value input through this field in a mail field, you need to insert the corresponding mail-tag (%s) into the field on the Mail tab.", 'contact-form-7' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?><input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>" /></label></p> 
    370     </div> 
    371 <?php 
    372 } 
     287    $desc_link   = wpcf7_link( 'https://wordpress.org/plugins/contact-form-7-modules/', __( 'the plugin page on WordPress.org', 'contact-form-7' ), array( 'target' => '_blank' ) ); 
     288    ?> 
     289    <div class="control-box"> 
     290        <fieldset> 
     291            <legend><?php printf( esc_html( $description ), $desc_link ); ?></legend> 
     292 
     293            <table class="form-table"> 
     294                <tbody> 
     295                <tr> 
     296                    <th scope="row"><label 
     297                                for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'contact-form-7' ) ); ?></label> 
     298                    </th> 
     299                    <td><input type="text" name="name" class="tg-name oneline" 
     300                               id="<?php echo esc_attr( $args['content'] . '-name' ); ?>"/></td> 
     301                </tr> 
     302 
     303                <tr> 
     304                    <th scope="row"><label 
     305                                for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'ID attribute', 'contact-form-7' ) ); ?> 
     306                            (<?php echo esc_html( __( 'optional', 'cf7_modules' ) ); ?>)</label></th> 
     307                    <td><input type="text" name="id" class="idvalue oneline option" 
     308                               id="<?php echo esc_attr( $args['content'] . '-id' ); ?>"/></td> 
     309                </tr> 
     310                <tr> 
     311                    <th scope="row"> 
     312                        <?php _e( 'Value', 'cf7_modules' ); ?> 
     313                    </th> 
     314                    <td> 
     315                        <input type="text" name="values" class="oneline"/> 
     316                        <div> 
     317                            <input type="checkbox" name="watermark" 
     318                                   class="option"/>&nbsp;<?php echo esc_html( __( 'Use this text as watermark?', 'cf7_modules' ) ); ?> 
     319                        </div> 
     320                    </td> 
     321                </tr> 
     322                <tr> 
     323                    <th scope="row"> 
     324                        <?php _e( 'Dynamic Values', 'cf7_modules' ); ?> 
     325                    </th> 
     326                    <td> 
     327                        <span class="howto" 
     328                              style="font-size:1em;"><?php _e( 'To use dynamic data from the post or page the form is embedded on, you can use the following values:', 'cf7_modules' ); ?></span> 
     329 
     330                        <ul> 
     331                            <li><?php _e( '<code>post_title</code>: The title of the post/page', 'cf7_modules' ); ?></li> 
     332                            <li><?php _e( '<code>post_url</code>: The URL of the post/page', 'cf7_modules' ); ?></li> 
     333                            <li><?php _e( '<code>post_category</code>: The categories the post is in, comma-separated', 'cf7_modules' ); ?></li> 
     334                            <li><?php _e( '<code>post_date</code>: The date the post/page was created', 'cf7_modules' ); ?></li> 
     335                            <li><?php _e( '<code>post_author</code>: The name of the author of the post/page', 'cf7_modules' ); ?></li> 
     336                        </ul> 
     337                        <span class="howto"><?php _e( 'The following values will be replaced if an user is logged in:', 'cf7_modules' ); ?></span> 
     338                        <ul> 
     339                            <li><?php _e( '<code>user_name</code>: User Login', 'cf7_modules' ); ?></li> 
     340                            <li><?php _e( '<code>user_id</code>: User ID', 'cf7_modules' ); ?></li> 
     341                            <li><?php _e( '<code>user_email</code>: User Email Address', 'cf7_modules' ); ?></li> 
     342                            <li><?php _e( '<code>user_display_name</code>: Display Name (Generally the first and last name of the user)', 'cf7_modules' ); ?></li> 
     343                        </ul> 
     344                    </td> 
     345                </tr> 
     346                </tbody> 
     347            </table> 
     348        </fieldset> 
     349    </div> 
     350 
     351    <div class="insert-box"> 
     352        <input type="text" name="hidden" class="tag code" readonly="readonly" onfocus="this.select()"/> 
     353 
     354        <div class="submitbox"> 
     355            <input type="button" class="button button-primary insert-tag" 
     356                   value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>"/> 
     357        </div> 
     358 
     359        <br class="clear"/> 
     360 
     361        <p class="description mail-tag"><label 
     362                    for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( "To use the value input through this field in a mail field, you need to insert the corresponding mail-tag (%s) into the field on the Mail tab.", 'contact-form-7' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?> 
     363                <input type="text" class="mail-tag code hidden" readonly="readonly" 
     364                       id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"/></label></p> 
     365    </div> 
     366    <?php 
     367} 
  • contact-form-7-modules/trunk/languages/en_US.po

    r876093 r1586887  
    22msgstr "" 
    33"Project-Id-Version: Contact Form 7 Modules: Send All Fields\n" 
    4 "POT-Creation-Date: 2014-03-15 17:07-0700\n" 
    5 "PO-Revision-Date: 2014-03-15 17:07-0700\n" 
    6 "Last-Translator: Zack Katz <support@katz.co>\n" 
     4"POT-Creation-Date: 2017-02-01 18:49-0700\n" 
     5"PO-Revision-Date: 2017-02-01 18:49-0700\n" 
     6"Last-Translator: Katz Web Services, Inc. <support@katz.co>\n" 
    77"Language-Team: Zack Katz <support@katz.co>\n" 
    88"Language: en_US\n" 
     
    1010"Content-Type: text/plain; charset=UTF-8\n" 
    1111"Content-Transfer-Encoding: 8bit\n" 
    12 "X-Generator: Poedit 1.6.4\n" 
     12"X-Generator: Poedit 1.8.5\n" 
    1313"X-Poedit-Basepath: ..\n" 
    1414"X-Poedit-SourceCharset: UTF-8\n" 
    1515"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;" 
    16 "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;" 
    17 "_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 
     16"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;" 
     17"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n" 
    1818"Plural-Forms: nplurals=2; plural=(n != 1);\n" 
    1919"X-Poedit-SearchPath-0: .\n" 
    2020 
    21 #: hidden.php:267 
    22 msgid "Hidden field" 
     21#: hidden.php:38 
     22msgid "" 
     23"The Contact Form 7 is installed, but you must activate Contact Form 7 below " 
     24"for the Hidden Fields Module to work." 
     25msgstr "" 
     26 
     27#: hidden.php:40 
     28msgid "" 
     29"The Contact Form 7 plugin must be installed for the Hidden Fields Module to " 
     30"work." 
     31msgstr "" 
     32 
     33#: hidden.php:42 
     34msgid "Install Now." 
    2335msgstr "" 
    2436 
    2537#: hidden.php:277 
     38msgctxt "the name of the field button in CF7" 
     39msgid "hidden" 
     40msgstr "" 
     41 
     42#: hidden.php:286 
     43#, php-format 
     44msgid "Generate a form tag for a hidden field. For more details, see %s." 
     45msgstr "" 
     46 
     47#: hidden.php:287 
     48msgid "the plugin page on WordPress.org" 
     49msgstr "" 
     50 
     51#: hidden.php:297 
    2652msgid "Name" 
    2753msgstr "" 
    2854 
    29 #: hidden.php:280 hidden.php:286 
     55#: hidden.php:305 
     56msgid "ID attribute" 
     57msgstr "" 
     58 
     59#: hidden.php:306 
    3060msgid "optional" 
    3161msgstr "" 
    3262 
    33 #: hidden.php:286 
    34 msgid "Default value" 
     63#: hidden.php:312 
     64msgid "Value" 
    3565msgstr "" 
    3666 
    37 #: hidden.php:287 
     67#: hidden.php:318 
    3868msgid "Use this text as watermark?" 
    3969msgstr "" 
    4070 
    41 #: hidden.php:292 
     71#: hidden.php:324 
    4272msgid "Dynamic Values" 
    4373msgstr "" 
    4474 
    45 #: hidden.php:293 
     75#: hidden.php:328 
    4676msgid "" 
    4777"To use dynamic data from the post or page the form is embedded on, you can " 
     
    4979msgstr "" 
    5080 
    51 #: hidden.php:295 
     81#: hidden.php:331 
    5282msgid "<code>post_title</code>: The title of the post/page" 
    5383msgstr "" 
    5484 
    55 #: hidden.php:296 
     85#: hidden.php:332 
    5686msgid "<code>post_url</code>: The URL of the post/page" 
    5787msgstr "" 
    5888 
    59 #: hidden.php:297 
     89#: hidden.php:333 
    6090msgid "" 
    6191"<code>post_category</code>: The categories the post is in, comma-separated" 
    6292msgstr "" 
    6393 
    64 #: hidden.php:298 
     94#: hidden.php:334 
    6595msgid "<code>post_date</code>: The date the post/page was created" 
    6696msgstr "" 
    6797 
    68 #: hidden.php:299 
     98#: hidden.php:335 
    6999msgid "<code>post_author</code>: The name of the author of the post/page" 
    70100msgstr "" 
    71101 
    72 #: hidden.php:301 
     102#: hidden.php:337 
    73103msgid "The following values will be replaced if an user is logged in:" 
    74104msgstr "" 
    75105 
    76 #: hidden.php:303 
     106#: hidden.php:339 
    77107msgid "<code>user_name</code>: User Login" 
    78108msgstr "" 
    79109 
    80 #: hidden.php:304 
     110#: hidden.php:340 
    81111msgid "<code>user_id</code>: User ID" 
    82112msgstr "" 
    83113 
    84 #: hidden.php:305 
     114#: hidden.php:341 
    85115msgid "<code>user_email</code>: User Email Address" 
    86116msgstr "" 
    87117 
    88 #: hidden.php:306 
     118#: hidden.php:342 
    89119msgid "" 
    90120"<code>user_display_name</code>: Display Name (Generally the first and last " 
     
    92122msgstr "" 
    93123 
    94 #: hidden.php:312 
    95 msgid "Copy this code and paste it into the form left." 
     124#: hidden.php:356 
     125msgid "Insert Tag" 
    96126msgstr "" 
    97127 
    98 #: hidden.php:314 
    99 msgid "And, put this code into the Mail fields below." 
     128#: hidden.php:362 
     129#, php-format 
     130msgid "" 
     131"To use the value input through this field in a mail field, you need to " 
     132"insert the corresponding mail-tag (%s) into the field on the Mail tab." 
    100133msgstr "" 
    101  
    102 #: send-all-fields.php:110 
    103 msgid "All Fields" 
    104 msgstr "" 
    105  
    106 #: send-all-fields.php:118 
    107 #, php-format 
    108 msgid "Add all fields to your email with %s[all-fields]%s" 
    109 msgstr "" 
    110  
    111 #: send-all-fields.php:120 
    112 msgid "" 
    113 "Put this code into the Mail fields below to output all submitted fields in " 
    114 "the email." 
    115 msgstr "" 
  • contact-form-7-modules/trunk/readme.txt

    r1189181 r1586887  
    11=== Contact Form 7 Modules === 
    2 Tags: Contact Form 7, form, forms, contactform7, contact form, hidden fields, hidden, cf7, cforms ii, cforms, Contact Forms 7, Contact Forms, contacted, contacts 
     2Tags: Contact Form 7, cf7, Contact Forms 7, hidden fields, all fields 
    33Requires at least: 2.8 
    4 Tested up to: 4.2.2 
     4Tested up to: 4.7.2 
    55Stable tag: trunk 
    66Contributors: katzwebdesign, katzwebservices 
    77Donate link: https://katz.co/contact-form-7-hidden-fields/ 
     8License: GPLv2 or later 
    89 
    910Contact Form 7 - Add useful modules such as hidden fields and "send all fields" to the Contact Form 7 plugin 
     
    1314### Add Hidden Fields to Contact Form 7 
    1415 
    15 The Contact Form 7 plugin has over <em>8.4 million</em> downloads, yet the great plugin still lacks a simple feature: <strong>hidden fields</strong>. This plugin adds hidden fields to Contact Form 7 once and for all. 
     16The Contact Form 7 plugin has over <em>1 million</em> active installations, yet the great plugin still lacks a simple feature: <strong>hidden fields</strong>. This plugin adds hidden fields to Contact Form 7 once and for all. 
    1617 
    1718#### Inserting dynamic values 
     
    5354<h4>Visit the official <a href="https://katz.co/contact-form-7-hidden-fields/">Contact Form 7 Modules plugin page</a> for more support & additional information</h4> 
    5455 
     56== Screenshots == 
     57 
     581. The Hidden fields tag generator 
     592. The `[all-fields]` Mail tag 
     60 
    5561== Installation == 
    5662 
     
    61671. Follow the instructions on the page 
    6268 
    63 == Screenshots == 
    64  
    65 1. The Hidden fields tag generator 
    66 2. The `[all-fields]` Mail tag 
    67  
    6869== Frequently Asked Questions == 
    6970 
     
    9091 
    9192* This plugin is released under a GPL license. 
    92  
    93 = Is the plugin available in other languages? = 
    94  
    95 Not yet, so [help translate the plugin!](https://www.transifex.com/projects/p/contact-form-7-modules/) 
    9693 
    9794= How do I send empty values with the `[all-fields]` shortcode? = 
     
    115112== Changelog == 
    116113 
     114= 2.0.1 & 2.0.2 on February 1, 2017 = 
     115 
     116* Confirmed compatibility with WordPress 4.7.2 
     117* Updated to work with Contact Form 7 4.6 
     118    * Fixed: `[hidden]` shortcodes not being replaced in emails 
     119    * Fixed: PHP warning related to deprecated function 
     120* Fixed: Removed use of deprecated `get_currentuserinfo()` function 
     121* Updated translations 
     122 
    117123= 2.0 on June 28, 2015 = 
    118124* **Requires Contact Form 7 4.2 or higher** 
  • contact-form-7-modules/trunk/send-all-fields.php

    r1189181 r1586887  
    55Description: Send all submitted fields in the message body using one simple tag: <code>[all-fields]</code> 
    66Author: Katz Web Services, Inc. 
    7 Author URI: http://www.katzwebservices.com 
    8 Version: 2.0 
     7Author URI: http://www.katz.co 
     8Version: 2.0.2 
    99Text Domain: cf7_modules 
    1010Domain Path: languages 
     11License: GPLv2 or later 
     12License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    1113*/ 
    12  
    13 /*  Copyright 2015 Katz Web Services, Inc. (email: info at katzwebservices.com) 
    14  
    15     This program is free software; you can redistribute it and/or modify 
    16     it under the terms of the GNU General Public License as published by 
    17     the Free Software Foundation; either version 2 of the License, or 
    18     (at your option) any later version. 
    19  
    20     This program is distributed in the hope that it will be useful, 
    21     but WITHOUT ANY WARRANTY; without even the implied warranty of 
    22     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    23     GNU General Public License for more details. 
    24  
    25     You should have received a copy of the GNU General Public License 
    26     along with this program; if not, write to the Free Software 
    27     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    28 */ 
    29  
    30 add_action('init', 'contact_form_7_all_fields_textdomain'); 
    31  
    32 function contact_form_7_all_fields_textdomain() { 
    33     // Load the default language files 
    34     load_plugin_textdomain( 'cf7_modules', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 
    35 } 
    3614 
    3715add_filter('wpcf7_mail_components', 'all_fields_wpcf7_before_send_mail'); 
    3816 
    3917function all_fields_wpcf7_before_send_mail($array) { 
    40     $debug = false;  global $wpdb; 
     18    $debug = false; 
    4119 
    42     if($debug) { print_r($array); } 
    43     if($debug) { print_r($_POST); } 
     20    if ( $debug ) { 
     21        print_r( $array ); 
     22    } 
     23    if ( $debug ) { 
     24        print_r( $_POST ); 
     25    } 
    4426 
    4527    $post = $_POST; 
    4628 
    4729    $html = false; 
    48     if(wpautop($array['body']) == $array['body']) { $html = true; } 
     30    if ( wpautop( $array['body'] ) == $array['body'] ) { 
     31        $html = true; 
     32    } 
    4933 
    50     foreach($post as $k => $v) { 
    51         if(substr($k, 0, 6) == '_wpcf7' || strpos($k, 'all-fields') || $k === '_wpnonce') { 
    52             unset($post["{$k}"]); 
     34    foreach ( $post as $k => $v ) { 
     35        if ( substr( $k, 0, 6 ) == '_wpcf7' || strpos( $k, 'all-fields' ) || $k === '_wpnonce' ) { 
     36            unset( $post["{$k}"] ); 
    5337        } 
    5438    } 
    55     if($debug) { print_r($post); } 
     39    if ( $debug ) { 
     40        print_r( $post ); 
     41    } 
    5642 
    5743    $postbody = ''; 
    5844 
    59     if($html) { 
    60         $postbody = apply_filters( 'wpcf7_send_all_fields_format_before' , '<dl>', 'html'); 
    61     } else { 
    62         $postbody = apply_filters( 'wpcf7_send_all_fields_format_before' , '', 'text'); 
    63     } 
     45    if ( $html ) { 
     46        $postbody = apply_filters( 'wpcf7_send_all_fields_format_before', '<dl>', 'html' ); 
     47    } else { 
     48        $postbody = apply_filters( 'wpcf7_send_all_fields_format_before', '', 'text' ); 
     49    } 
    6450 
    65     foreach($post as $k => $v) { 
     51    foreach ( $post as $k => $v ) { 
    6652 
    67         // Remove dupe content. The Hidden and Values are both sent. 
    68         if(preg_match('/hidden\-/', $k)) { continue; } 
    69  
    70         // If there's no value for the field, don't send it. 
    71         if(empty($v) && false === apply_filters( 'wpcf7_send_all_fields_send_empty_fields' , false )) { 
    72             continue; 
    73         } 
    74  
    75         if(is_array($v)) { 
    76             $v = implode(', ', $v); 
     53        // Remove dupe content. The Hidden and Values are both sent. 
     54        if ( preg_match( '/hidden\-/', $k ) ) { 
     55            continue; 
    7756        } 
    7857 
    79         // Make the fields easier to read. Thanks, @hitolonen 
    80         $k = apply_filters( 'wpcf7_send_all_fields_format_key', true ) ? ucwords(str_replace("-", " ", str_replace("_", " ", $k))) : $k; 
     58        // If there's no value for the field, don't send it. 
     59        if ( empty( $v ) && false === apply_filters( 'wpcf7_send_all_fields_send_empty_fields', false ) ) { 
     60            continue; 
     61        } 
    8162 
    82         // Sanitize! 
    83         $k = esc_attr($k); 
    84         $v = esc_attr($v); 
     63        if ( is_array( $v ) ) { 
     64            $v = implode( ', ', $v ); 
     65        } 
    8566 
    86         if($html) { 
    87             $postbody .= apply_filters( 'wpcf7_send_all_fields_format_item', "<dt style='font-size:1.2em;'><font size='3'><strong style='font-weight:bold;'>{$k}</strong>:</font></dt><dd style='padding:0 0 .5em 1.5em; margin:0;'>{$v}</dd>", $k, $v, 'html'); 
     67        // Make the fields easier to read. Thanks, @hitolonen 
     68        $k = apply_filters( 'wpcf7_send_all_fields_format_key', true ) ? ucwords( str_replace( "-", " ", str_replace( "_", " ", $k ) ) ) : $k; 
     69 
     70        // Sanitize! 
     71        $k = esc_attr( $k ); 
     72        $v = esc_attr( $v ); 
     73 
     74        if ( $html ) { 
     75            $postbody .= apply_filters( 'wpcf7_send_all_fields_format_item', "<dt style='font-size:1.2em;'><font size='3'><strong style='font-weight:bold;'>{$k}</strong>:</font></dt><dd style='padding:0 0 .5em 1.5em; margin:0;'>{$v}</dd>", $k, $v, 'html' ); 
    8876        } else { 
    89             $postbody .= apply_filters( 'wpcf7_send_all_fields_format_item', "{$k}: {$v}\n", $k, $v, 'text'); 
     77            $postbody .= apply_filters( 'wpcf7_send_all_fields_format_item', "{$k}: {$v}\n", $k, $v, 'text' ); 
    9078        } 
    9179    } 
    92     if($html) { 
    93         $postbody .= apply_filters( 'wpcf7_send_all_fields_format_after' , '</dl>', 'html'); 
     80    if ( $html ) { 
     81        $postbody .= apply_filters( 'wpcf7_send_all_fields_format_after', '</dl>', 'html' ); 
    9482    } else { 
    95         $postbody .= apply_filters( 'wpcf7_send_all_fields_format_after' , '', 'text'); 
     83        $postbody .= apply_filters( 'wpcf7_send_all_fields_format_after', '', 'text' ); 
    9684    } 
    9785 
    98     if($debug) { print_r($postbody); } 
     86    if ( $debug ) { 
     87        print_r( $postbody ); 
     88    } 
    9989 
    100     $array['body'] = str_replace('<p>[all-fields]</p>', $postbody, str_replace('[all-fields]', $postbody, $array['body'])); 
     90    $array['body'] = str_replace( '<p>[all-fields]</p>', $postbody, str_replace( '[all-fields]', $postbody, $array['body'] ) ); 
    10191 
    102     if($debug) { die(); } else { return $array; } 
     92    if ( $debug ) { 
     93        die(); 
     94    } else { 
     95        return $array; 
     96    } 
    10397} 
    10498 
Note: See TracChangeset for help on using the changeset viewer.