Plugin Directory

Changeset 1211931

Timestamp:
08/03/2015 04:28:49 PM (9 years ago)
Author:
jadpm
Message:

Prepare Types 1.7.8 release

Location:
types/trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • types/trunk/embedded/bootstrap.php

    r1202977 r1211931  
    134134    // This ones are skipped if used as embedded code!
    135135    if ( !defined( 'WPCF_VERSION' ) ) {
    136         define( 'WPCF_VERSION', '1.7.7' );
     136        define( 'WPCF_VERSION', '1.7.' );
    137137        define( 'WPCF_META_PREFIX', 'wpcf-' );
    138138    }
  • types/trunk/embedded/classes/field.php

    r1181030 r1211931  
    716716            $html = htmlspecialchars( $html );
    717717        }
     718
     719
     720
     721
     722
     723
     724
     725
    718726        // Process shortcodes too
    719         $html = do_shortcode( htmlspecialchars_decode( stripslashes( $html ) ) );
     727        $html = do_shortcode( );
    720728        return $html;
    721729    }
  • types/trunk/embedded/classes/loader.php

    r1181030 r1211931  
    3434                array('WPCF_Loader', 'renderJsSettings'), 5 );
    3535        add_filter( 'the_posts', array('WPCF_Loader', 'wpcf_cache_complete_postmeta') );
    36     }
     36        add_filter( 'wpcf_fields_value_save', array( 'WPCF_Loader', 'wpcf_sanitize_values_on_save' ) );
     37    }
     38   
     39    /**
     40    * Sanitize fields values on save
     41    *
     42    */
     43   
     44    public static function wpcf_sanitize_values_on_save( $value ) {
     45        if ( is_array( $value ) ) {
     46            // Recursion
     47            $value = array_map( array( 'WPCF_Loader', 'wpcf_sanitize_values_on_save' ), $value );
     48        } else {
     49            if ( current_user_can( 'unfiltered_html' ) ) {
     50                $value = wp_filter_post_kses( $value );
     51            } else {
     52                $value = wp_filter_kses( $value );
     53            }
     54        }
     55        return $value;
     56    }
    3757
    3858    /**
  • types/trunk/embedded/frontend.php

    r1181030 r1211931  
    126126    // Get field
    127127    $field = types_get_field( $field_id );
     128
     129
    128130
    129131    // If field not found return empty string
     
    328330        $params['field_value'], $field['type'], $field['slug'],
    329331        $field['name'], $params ) );
    330     return htmlspecialchars_decode( stripslashes( strval( $output ) ) );
     332   
     333    if (
     334        isset( $params['unfiltered_html'] )
     335        && $params['unfiltered_html'] === false
     336    ) {
     337        return stripslashes( strval( $output ) );
     338    } else {
     339        return htmlspecialchars_decode( stripslashes( strval( $output ) ) );
     340    }
    331341}
    332342
     
    495505        return stripslashes( strval( $content ) );
    496506    }
     507
     508
     509
     510
     511
     512
     513
     514
     515
     516
     517
     518
     519
     520
     521
     522
    497523}
    498524
     
    658684    return $clause;
    659685}
     686
     687
     688
     689
     690
     691
     692
     693
     694
     695
     696
     697
     698
     699
     700
     701
     702
     703
     704
     705
     706
     707
     708
     709
     710
     711
     712
     713
     714
     715
     716
     717
     718
     719
     720
     721
     722
     723
     724
     725
     726
     727
     728
     729
     730
     731
     732
     733
     734
     735
     736
     737
     738
     739
     740
     741
     742
     743
     744
     745
     746
     747
     748
     749
     750
     751
     752
     753
     754
     755
     756
     757
     758
     759
     760
     761
     762
     763
     764
     765
     766
     767
     768
     769
     770
     771
     772
     773
     774
     775
  • types/trunk/embedded/functions.php

    r1181030 r1211931  
    343343        'images_remote_cache_time' => '36',
    344344        'help_box' => 'by_types',
     345
     346
    345347    );
    346348    $settings = wp_parse_args( get_option( 'wpcf_settings', array() ), $defaults );
  • types/trunk/embedded/includes/fields-post.php

    r1181030 r1211931  
    154154    // Get groups
    155155    $groups = wpcf_admin_post_get_post_groups_fields( $post );
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
    156166
    157167    foreach ( $groups as $group ) {
     
    217227        }
    218228    }
     229
     230
     231
     232
     233
     234
     235
     236
     237
     238
     239
     240
     241
     242
     243
     244
     245
     246
     247
     248
     249
     250
     251
     252
     253
    219254}
    220255
     
    570605{
    571606
     607
     608
     609
     610
     611
     612
     613
     614
     615
     616
     617
    572618
    573619    if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) {
  • types/trunk/embedded/includes/fields/wysiwyg.php

    r1181030 r1211931  
    129129    }
    130130
    131     if ( isset( $params['suppress_filters'] ) && $params['suppress_filters'] == 'true' ) {
    132         $the_content_filters = array(
    133             'wptexturize', 'convert_smilies', 'convert_chars', 'wpautop',
    134             'shortcode_unautop', 'prepend_attachment', 'capital_P_dangit', 'do_shortcode');
    135         $content = htmlspecialchars_decode( stripslashes( $params['field_value'] ) );
    136         foreach ($the_content_filters as $func) {
    137             if (  function_exists( $func ) ) {
    138                 $content = call_user_func($func, $content);
    139             }
    140         }
    141         $output .= $content;
    142     } else {
    143         /**
    144          * remove_shortcode playlist to avoid htmlspecialchars_decode on json
    145          * data
    146          */
    147         remove_shortcode('playlist', 'wp_playlist_shortcode');
    148         $output .= apply_filters( 'the_content', htmlspecialchars_decode( stripslashes( $params['field_value'] ) ) );
    149         if ( preg_match_all('/playlist[^\]]+/', $output, $matches ) ) {
    150             foreach( $matches[0] as $one ) {
    151                 $re = '/'.$one.'/';
    152                 $one = preg_replace('/\&\#(8221|8243);/', '"', $one);
    153                 $output = preg_replace($re, $one, $output);
    154             }
    155         }
    156         add_shortcode( 'playlist', 'wp_playlist_shortcode' );
    157     }
     131    // We'll only run a limited number of filters.
     132    // We need to do this to avoid issues after the WP 4.2.3 shortcode API changes.
     133   
     134    $the_content_filters = array(
     135        'wptexturize', 'convert_smilies', 'convert_chars', 'wpautop',
     136        'shortcode_unautop', 'prepend_attachment', 'capital_P_dangit', 'do_shortcode');
     137   
     138    /**
     139     * remove_shortcode playlist to avoid htmlspecialchars_decode on json
     140     * data
     141     */
     142    remove_shortcode('playlist', 'wp_playlist_shortcode');
     143   
     144    if (
     145        isset( $params['unfiltered_html'] )
     146        && $params['unfiltered_html'] === false
     147    ) {
     148        $content = stripslashes( $params['field_value'] );
     149    } else {
     150        $content = htmlspecialchars_decode( stripslashes( $params['field_value'] ) );
     151    }
     152   
     153    foreach ($the_content_filters as $func) {
     154        if (  function_exists( $func ) ) {
     155            $content = call_user_func($func, $content);
     156        }
     157    }
     158    if ( preg_match_all('/playlist[^\]]+/', $output, $matches ) ) {
     159        foreach( $matches[0] as $one ) {
     160            $re = '/'.$one.'/';
     161            $one = preg_replace('/\&\#(8221|8243);/', '"', $one);
     162            $output = preg_replace($re, $one, $output);
     163        }
     164    }
     165    add_shortcode( 'playlist', 'wp_playlist_shortcode' );
     166
     167    $output .= $content;
    158168    if ( !empty( $params['style'] ) || !empty( $params['class'] ) ) {
    159169        $output .= '</div>';
     
    161171    return $output;
    162172}
     173
     174
     175
     176
     177
     178
     179
     180
     181
     182
     183
     184
     185
     186
     187
     188
     189
     190
     191
     192
     193
     194
     195
     196
     197
     198
     199
     200
     201
     202
     203
     204
     205
     206
     207
  • types/trunk/embedded/includes/usermeta-post.php

    r1181030 r1211931  
    2626    $profile_only_preview = '';
    2727
    28 
     28    if ( current_user_can( 'unfiltered_html' ) ) {
     29        $can_unfiltered_html = get_user_meta( $user_id->ID, '_wpcf_usermeta_fields_unfiltered_html', true );
     30        $can_unfiltered_html = empty( $can_unfiltered_html ) ? 'on' : $can_unfiltered_html;
     31        $disabled = '';
     32        if ( wpcf_get_settings('usermeta_unfiltered_html') == 'off' ) {
     33            $can_unfiltered_html = 'off';
     34            $disabled = ' disabled="disabled"';
     35        }
     36        ?>
     37        <h3><?php _e( 'Types usermeta fields - unfiltered HTML', 'wpcf' ) ?></h3>
     38        <table class="form-table">
     39            <tbody>
     40                <tr>
     41                    <th>
     42                        <?php _e( 'Unfiltered HTML', 'wpcf' ) ?>
     43                    </th>
     44                    <td>
     45                        <input id="wpcf_postmeta_fields_can_unfiltered_html_on" type="radio" name="_wpcf_usermeta_fields_unfiltered_html" value="on" <?php checked( $can_unfiltered_html, 'on' ); echo $disabled; ?> />
     46                        <label for="wpcf_postmeta_fields_can_unfiltered_html_on">
     47                            <?php _e( 'Enable unfiltered HTML in Types usermeta fields for this user', 'wpcf' ); ?>
     48                        </label>
     49                        <br />
     50                        <input id="wpcf_postmeta_fields_can_unfiltered_html_off" type="radio" name="_wpcf_usermeta_fields_unfiltered_html" value="off" <?php checked( $can_unfiltered_html, 'off' ); echo $disabled; ?> />
     51                        <label for="wpcf_postmeta_fields_can_unfiltered_html_off">
     52                            <?php _e( 'Disable unfiltered HTML in Types usermeta fields for this user', 'wpcf' ); ?>
     53                        </label>
     54                    </td>
     55                </tr>
     56            </tbody>
     57        </table>
     58        <?php
     59    }
     60   
    2961    foreach ( $groups as $group ) {
    3062        if ( !empty( $group['fields'] ) ) {
     
    327359function wpcf_admin_userprofilesave_init($user_id){
    328360
     361
     362
     363
     364
     365
     366
     367
     368
     369
     370
     371
     372
    329373    if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) {
    330374
  • types/trunk/embedded/plugin.php

    r1202977 r1211931  
    66  Author: OnTheGoSystems
    77  Author URI: http://www.onthegosystems.com
    8   Version: 1.7.7
     8  Version: 1.7.
    99 */
    1010/**
  • types/trunk/embedded/readme.txt

    r1178330 r1211931  
    55License: GPLv2
    66Requires at least: 3.4
    7 Tested up to: 4.2.2
    8 Stable tag: 1.6.6.6
     7Tested up to: 4.2.
     8Stable tag: 1.
    99
    1010The Embedded version lets you create custom types, taxonomies and fields for your theme or plugin, without requiring any plugin.
  • types/trunk/embedded/usermeta-init.php

    r1181030 r1211931  
    422422    $field = wpcf_fields_get_field_by_slug( $field_id, 'wpcf-usermeta' );
    423423
     424
     425
    424426
    425427    // If field not found return empty string
     
    598600    // Set field
    599601    $wpcf->usermeta_field->set( $user_id, $field );
     602
     603
    600604
    601605
     
    680684//    $wpcf->usermeta_field->set( $user_id, $field );
    681685    return $wpcf->usermeta_field->html( $html, $params );
     686
     687
     688
     689
     690
     691
     692
     693
     694
     695
     696
     697
     698
     699
     700
     701
    682702}
    683703
  • types/trunk/includes/settings.php

    r1120400 r1211931  
    9292            '#title' => __("When importing, add texts to WPML's String Translation table",
    9393                    'wpcf'),
    94             '#inline' => true,
     94            '#inline' => e,
    9595            '#default_value' => !empty($settings['register_translations_on_import']),
    9696            '#after' => '<br />',
     
    133133        '#inline' => false,
    134134        '#default_value' => $settings['help_box'],
     135
     136
     137
     138
     139
     140
     141
     142
     143
     144
     145
     146
     147
     148
     149
     150
     151
     152
     153
     154
     155
     156
     157
     158
     159
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
     170
     171
     172
     173
    135174    );
    136175    $form['submit'] = array(
     
    201240    $settings = wpcf_get_settings();
    202241    $data = $_POST['wpcf_settings'];
    203     foreach (array('register_translations_on_import','help_box') as $setting) {
     242    foreach (array('register_translations_on_import','help_box') as $setting) {
    204243        if (!isset($data[$setting])) {
    205244            $settings[$setting] = 0;
  • types/trunk/readme.txt

    r1202977 r1211931  
    55License: GPLv2
    66Requires at least: 3.4
    7 Tested up to: 4.2.2
    8 Stable tag: 1.7.7
     7Tested up to: 4.2.
     8Stable tag: 1.7.
    99
    1010The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
     
    155155
    156156== Changelog ==
     157
     158
     159
     160
     161
     162
    157163
    158164= 1.7.7 =
  • types/trunk/wpcf.php

    r1202977 r1211931  
    66  Author: OnTheGoSystems
    77  Author URI: http://www.onthegosystems.com
    8   Version: 1.7.7
     8  Version: 1.7.
    99 */
    1010/**
     
    1717     * make sure that WPCF_VERSION in embedded/bootstrap.php is the same!
    1818     */
    19     define( 'WPCF_VERSION', '1.7.7' );
     19    define( 'WPCF_VERSION', '1.7.' );
    2020}
    2121
Note: See TracChangeset for help on using the changeset viewer.