Changeset 1211931
- Timestamp:
- 08/03/2015 04:28:49 PM (9 years ago)
- Location:
- types/trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
types/trunk/embedded/bootstrap.php
r1202977 r1211931 134 134 // This ones are skipped if used as embedded code! 135 135 if ( !defined( 'WPCF_VERSION' ) ) { 136 define( 'WPCF_VERSION', '1.7. 7' );136 define( 'WPCF_VERSION', '1.7.' ); 137 137 define( 'WPCF_META_PREFIX', 'wpcf-' ); 138 138 } -
types/trunk/embedded/classes/field.php
r1181030 r1211931 716 716 $html = htmlspecialchars( $html ); 717 717 } 718 719 720 721 722 723 724 725 718 726 // Process shortcodes too 719 $html = do_shortcode( htmlspecialchars_decode( stripslashes( $html ) ));727 $html = do_shortcode( ); 720 728 return $html; 721 729 } -
types/trunk/embedded/classes/loader.php
r1181030 r1211931 34 34 array('WPCF_Loader', 'renderJsSettings'), 5 ); 35 35 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 } 37 57 38 58 /** -
types/trunk/embedded/frontend.php
r1181030 r1211931 126 126 // Get field 127 127 $field = types_get_field( $field_id ); 128 129 128 130 129 131 // If field not found return empty string … … 328 330 $params['field_value'], $field['type'], $field['slug'], 329 331 $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 } 331 341 } 332 342 … … 495 505 return stripslashes( strval( $content ) ); 496 506 } 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 497 523 } 498 524 … … 658 684 return $clause; 659 685 } 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 343 343 'images_remote_cache_time' => '36', 344 344 'help_box' => 'by_types', 345 346 345 347 ); 346 348 $settings = wp_parse_args( get_option( 'wpcf_settings', array() ), $defaults ); -
types/trunk/embedded/includes/fields-post.php
r1181030 r1211931 154 154 // Get groups 155 155 $groups = wpcf_admin_post_get_post_groups_fields( $post ); 156 157 158 159 160 161 162 163 164 165 156 166 157 167 foreach ( $groups as $group ) { … … 217 227 } 218 228 } 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 219 254 } 220 255 … … 570 605 { 571 606 607 608 609 610 611 612 613 614 615 616 617 572 618 573 619 if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) { -
types/trunk/embedded/includes/fields/wysiwyg.php
r1181030 r1211931 129 129 } 130 130 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; 158 168 if ( !empty( $params['style'] ) || !empty( $params['class'] ) ) { 159 169 $output .= '</div>'; … … 161 171 return $output; 162 172 } 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 26 26 $profile_only_preview = ''; 27 27 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 29 61 foreach ( $groups as $group ) { 30 62 if ( !empty( $group['fields'] ) ) { … … 327 359 function wpcf_admin_userprofilesave_init($user_id){ 328 360 361 362 363 364 365 366 367 368 369 370 371 372 329 373 if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) { 330 374 -
types/trunk/embedded/plugin.php
r1202977 r1211931 6 6 Author: OnTheGoSystems 7 7 Author URI: http://www.onthegosystems.com 8 Version: 1.7. 78 Version: 1.7. 9 9 */ 10 10 /** -
types/trunk/embedded/readme.txt
r1178330 r1211931 5 5 License: GPLv2 6 6 Requires at least: 3.4 7 Tested up to: 4.2. 28 Stable tag: 1. 6.6.67 Tested up to: 4.2. 8 Stable tag: 1. 9 9 10 10 The 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 422 422 $field = wpcf_fields_get_field_by_slug( $field_id, 'wpcf-usermeta' ); 423 423 424 425 424 426 425 427 // If field not found return empty string … … 598 600 // Set field 599 601 $wpcf->usermeta_field->set( $user_id, $field ); 602 603 600 604 601 605 … … 680 684 // $wpcf->usermeta_field->set( $user_id, $field ); 681 685 return $wpcf->usermeta_field->html( $html, $params ); 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 682 702 } 683 703 -
types/trunk/includes/settings.php
r1120400 r1211931 92 92 '#title' => __("When importing, add texts to WPML's String Translation table", 93 93 'wpcf'), 94 '#inline' => true,94 '#inline' => e, 95 95 '#default_value' => !empty($settings['register_translations_on_import']), 96 96 '#after' => '<br />', … … 133 133 '#inline' => false, 134 134 '#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 135 174 ); 136 175 $form['submit'] = array( … … 201 240 $settings = wpcf_get_settings(); 202 241 $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) { 204 243 if (!isset($data[$setting])) { 205 244 $settings[$setting] = 0; -
types/trunk/readme.txt
r1202977 r1211931 5 5 License: GPLv2 6 6 Requires at least: 3.4 7 Tested up to: 4.2. 28 Stable tag: 1.7. 77 Tested up to: 4.2. 8 Stable tag: 1.7. 9 9 10 10 The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields. … … 155 155 156 156 == Changelog == 157 158 159 160 161 162 157 163 158 164 = 1.7.7 = -
types/trunk/wpcf.php
r1202977 r1211931 6 6 Author: OnTheGoSystems 7 7 Author URI: http://www.onthegosystems.com 8 Version: 1.7. 78 Version: 1.7. 9 9 */ 10 10 /** … … 17 17 * make sure that WPCF_VERSION in embedded/bootstrap.php is the same! 18 18 */ 19 define( 'WPCF_VERSION', '1.7. 7' );19 define( 'WPCF_VERSION', '1.7.' ); 20 20 } 21 21
Note: See TracChangeset
for help on using the changeset viewer.