Version Description
- Release date: 2015-08-05
- Fixed a problem when saving HTML in meta fields.
Download this release
Release Info
Developer | jadpm |
Plugin | Toolset Types – Custom Post Types, Custom Fields and Taxonomies |
Version | 1.7.11 |
Comparing to | |
See all releases |
Code changes from version 1.7.10 to 1.7.11
- embedded/bootstrap.php +1 -1
- embedded/classes/field.php +14 -9
- embedded/classes/loader.php +26 -3
- embedded/classes/repeater.php +2 -1
- embedded/classes/usermeta_field.php +2 -1
- embedded/classes/usermeta_repeater.php +2 -1
- embedded/frontend.php +2 -26
- embedded/includes/fields-post.php +0 -47
- embedded/includes/fields/wysiwyg.php +15 -23
- embedded/includes/usermeta-post.php +0 -45
- embedded/plugin.php +1 -1
- embedded/readme.txt +2 -2
- embedded/usermeta-init.php +0 -22
- includes/settings.php +2 -4
- readme.txt +7 -2
- wpcf.php +2 -2
embedded/bootstrap.php
CHANGED
@@ -133,7 +133,7 @@ function wpcf_embedded_init() {
|
|
133 |
// Define necessary constants if plugin is not present
|
134 |
// This ones are skipped if used as embedded code!
|
135 |
if ( !defined( 'WPCF_VERSION' ) ) {
|
136 |
-
define( 'WPCF_VERSION', '1.7.
|
137 |
define( 'WPCF_META_PREFIX', 'wpcf-' );
|
138 |
}
|
139 |
|
133 |
// Define necessary constants if plugin is not present
|
134 |
// This ones are skipped if used as embedded code!
|
135 |
if ( !defined( 'WPCF_VERSION' ) ) {
|
136 |
+
define( 'WPCF_VERSION', '1.7.11' );
|
137 |
define( 'WPCF_META_PREFIX', 'wpcf-' );
|
138 |
}
|
139 |
|
embedded/classes/field.php
CHANGED
@@ -358,7 +358,8 @@ class WPCF_Field
|
|
358 |
/**
|
359 |
* apply filters
|
360 |
*/
|
361 |
-
|
|
|
362 |
/**
|
363 |
* Save field if needed
|
364 |
*/
|
@@ -404,6 +405,18 @@ class WPCF_Field
|
|
404 |
|
405 |
return $value;
|
406 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
|
408 |
/**
|
409 |
* Use these hooks to add future functionality.
|
@@ -713,15 +726,7 @@ class WPCF_Field
|
|
713 |
if ( isset( $params['raw'] ) && $params['raw'] == 'true' ) {
|
714 |
return $html;
|
715 |
} else {
|
716 |
-
$html = htmlspecialchars( $html );
|
717 |
-
}
|
718 |
-
if (
|
719 |
-
isset( $params['unfiltered_html'] )
|
720 |
-
&& $params['unfiltered_html'] === false
|
721 |
-
) {
|
722 |
$html = stripslashes( $html );
|
723 |
-
} else {
|
724 |
-
$html = htmlspecialchars_decode( stripslashes( $html ) );
|
725 |
}
|
726 |
// Process shortcodes too
|
727 |
$html = do_shortcode( $html );
|
358 |
/**
|
359 |
* apply filters
|
360 |
*/
|
361 |
+
$_value = $this->_filter_save_postmeta_value( $value );
|
362 |
+
$_value = $this->_filter_save_value( $_value );
|
363 |
/**
|
364 |
* Save field if needed
|
365 |
*/
|
405 |
|
406 |
return $value;
|
407 |
}
|
408 |
+
|
409 |
+
function _filter_save_postmeta_value( $value )
|
410 |
+
{
|
411 |
+
$value = apply_filters( 'wpcf_fields_postmeta_value_save', $value, $this->cf['type'], $this->cf['slug'], $this->cf, $this );
|
412 |
+
return $value;
|
413 |
+
}
|
414 |
+
|
415 |
+
function _filter_save_usermeta_value( $value )
|
416 |
+
{
|
417 |
+
$value = apply_filters( 'wpcf_fields_usermeta_value_save', $value, $this->cf['type'], $this->cf['slug'], $this->cf, $this );
|
418 |
+
return $value;
|
419 |
+
}
|
420 |
|
421 |
/**
|
422 |
* Use these hooks to add future functionality.
|
726 |
if ( isset( $params['raw'] ) && $params['raw'] == 'true' ) {
|
727 |
return $html;
|
728 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
729 |
$html = stripslashes( $html );
|
|
|
|
|
730 |
}
|
731 |
// Process shortcodes too
|
732 |
$html = do_shortcode( $html );
|
embedded/classes/loader.php
CHANGED
@@ -33,7 +33,8 @@ class WPCF_Loader
|
|
33 |
add_action( 'admin_print_scripts',
|
34 |
array('WPCF_Loader', 'renderJsSettings'), 5 );
|
35 |
add_filter( 'the_posts', array('WPCF_Loader', 'wpcf_cache_complete_postmeta') );
|
36 |
-
add_filter( '
|
|
|
37 |
}
|
38 |
|
39 |
/**
|
@@ -41,10 +42,32 @@ class WPCF_Loader
|
|
41 |
*
|
42 |
*/
|
43 |
|
44 |
-
public static function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
if ( is_array( $value ) ) {
|
46 |
// Recursion
|
47 |
-
$value = array_map( array( 'WPCF_Loader', '
|
48 |
} else {
|
49 |
$value = wp_filter_post_kses( $value );
|
50 |
}
|
33 |
add_action( 'admin_print_scripts',
|
34 |
array('WPCF_Loader', 'renderJsSettings'), 5 );
|
35 |
add_filter( 'the_posts', array('WPCF_Loader', 'wpcf_cache_complete_postmeta') );
|
36 |
+
add_filter( 'wpcf_fields_postmeta_value_save', array( 'WPCF_Loader', 'wpcf_sanitize_postmeta_values_on_save' ) );
|
37 |
+
add_filter( 'wpcf_fields_usermeta_value_save', array( 'WPCF_Loader', 'wpcf_sanitize_usermeta_values_on_save' ) );
|
38 |
}
|
39 |
|
40 |
/**
|
42 |
*
|
43 |
*/
|
44 |
|
45 |
+
public static function wpcf_sanitize_postmeta_values_on_save( $value ) {
|
46 |
+
if (
|
47 |
+
current_user_can( 'unfiltered_html' )
|
48 |
+
&& wpcf_get_settings('postmeta_unfiltered_html') != 'off'
|
49 |
+
) {
|
50 |
+
return $value;
|
51 |
+
}
|
52 |
+
if ( is_array( $value ) ) {
|
53 |
+
// Recursion
|
54 |
+
$value = array_map( array( 'WPCF_Loader', 'wpcf_sanitize_postmeta_values_on_save' ), $value );
|
55 |
+
} else {
|
56 |
+
$value = wp_filter_post_kses( $value );
|
57 |
+
}
|
58 |
+
return $value;
|
59 |
+
}
|
60 |
+
|
61 |
+
public static function wpcf_sanitize_usermeta_values_on_save( $value ) {
|
62 |
+
if (
|
63 |
+
current_user_can( 'unfiltered_html' )
|
64 |
+
&& wpcf_get_settings('usermeta_unfiltered_html') != 'off'
|
65 |
+
) {
|
66 |
+
return $value;
|
67 |
+
}
|
68 |
if ( is_array( $value ) ) {
|
69 |
// Recursion
|
70 |
+
$value = array_map( array( 'WPCF_Loader', 'wpcf_sanitize_usermeta_values_on_save' ), $value );
|
71 |
} else {
|
72 |
$value = wp_filter_post_kses( $value );
|
73 |
}
|
embedded/classes/repeater.php
CHANGED
@@ -129,7 +129,8 @@ class WPCF_Repeater extends WPCF_Field
|
|
129 |
$meta_value, $this );
|
130 |
|
131 |
// Apply other filters
|
132 |
-
|
|
|
133 |
|
134 |
// Adding each field will return $mid
|
135 |
if ( count($data) == $i++ ) {
|
129 |
$meta_value, $this );
|
130 |
|
131 |
// Apply other filters
|
132 |
+
$_meta_value = $this->_filter_save_postmeta_value( $meta_value );
|
133 |
+
$_meta_value = $this->_filter_save_value( $_meta_value );
|
134 |
|
135 |
// Adding each field will return $mid
|
136 |
if ( count($data) == $i++ ) {
|
embedded/classes/usermeta_field.php
CHANGED
@@ -92,7 +92,8 @@ class WPCF_Usermeta_Field extends WPCF_Field
|
|
92 |
}
|
93 |
|
94 |
// Apply filters
|
95 |
-
$_value = $this->
|
|
|
96 |
if ( !empty( $_value ) || is_numeric( $_value ) ) {
|
97 |
// Save field
|
98 |
$mid = update_user_meta( $this->currentUID, $this->slug, $_value );
|
92 |
}
|
93 |
|
94 |
// Apply filters
|
95 |
+
$_value = $this->_filter_save_usermeta_value( $value );
|
96 |
+
$_value = $this->_filter_save_value( $_value );
|
97 |
if ( !empty( $_value ) || is_numeric( $_value ) ) {
|
98 |
// Save field
|
99 |
$mid = update_user_meta( $this->currentUID, $this->slug, $_value );
|
embedded/classes/usermeta_repeater.php
CHANGED
@@ -92,7 +92,8 @@ class WPCF_Usermeta_Repeater extends WPCF_Usermeta_Field
|
|
92 |
}
|
93 |
|
94 |
// Apply filters
|
95 |
-
|
|
|
96 |
|
97 |
// Adding each field will return $mid
|
98 |
// $unique = false
|
92 |
}
|
93 |
|
94 |
// Apply filters
|
95 |
+
$_meta_value = $this->_filter_save_usermeta_value( $meta_value );
|
96 |
+
$_meta_value = $this->_filter_save_value( $_meta_value );
|
97 |
|
98 |
// Adding each field will return $mid
|
99 |
// $unique = false
|
embedded/frontend.php
CHANGED
@@ -126,8 +126,6 @@ function types_render_field( $field_id = null, $params = array(), $content = nul
|
|
126 |
// Get field
|
127 |
$field = types_get_field( $field_id );
|
128 |
|
129 |
-
$params['unfiltered_html'] = wpcf_postmeta_fields_can_unfiltered_html( $post_id );
|
130 |
-
|
131 |
// If field not found return empty string
|
132 |
if ( empty( $field ) ) {
|
133 |
|
@@ -330,14 +328,8 @@ function types_render_field_single( $field, $params, $content = null, $code = ''
|
|
330 |
$params['field_value'], $field['type'], $field['slug'],
|
331 |
$field['name'], $params ) );
|
332 |
|
333 |
-
|
334 |
-
|
335 |
-
&& $params['unfiltered_html'] === false
|
336 |
-
) {
|
337 |
-
return stripslashes( strval( $output ) );
|
338 |
-
} else {
|
339 |
-
return htmlspecialchars_decode( stripslashes( strval( $output ) ) );
|
340 |
-
}
|
341 |
}
|
342 |
|
343 |
function wpcf_frontend_compat_html_output( $output, $field, $content, $params ) {
|
@@ -506,22 +498,6 @@ function wpcf_frontend_wrap_field_value( $field, $content, $params = array() ) {
|
|
506 |
}
|
507 |
}
|
508 |
|
509 |
-
function wpcf_postmeta_fields_can_unfiltered_html( $post_id = '' ) {
|
510 |
-
$return = true;
|
511 |
-
if ( empty( $post_id ) ) {
|
512 |
-
return $return;
|
513 |
-
}
|
514 |
-
$can_unfiltered_html = wpcf_get_post_meta( $post_id, '_wpcf_postmeta_fields_unfiltered_html', true );
|
515 |
-
if (
|
516 |
-
$can_unfiltered_html == 'off'
|
517 |
-
|| wpcf_get_settings('postmeta_unfiltered_html') == 'off'
|
518 |
-
|| ! apply_filters( 'wpcf_filter_wpcf_postmeta_fields_unfiltered_html', true, $post_id )
|
519 |
-
) {
|
520 |
-
$return = false;
|
521 |
-
}
|
522 |
-
return $return;
|
523 |
-
}
|
524 |
-
|
525 |
// Add a filter to handle Views queries with checkboxes.
|
526 |
|
527 |
add_filter( 'wpv_filter_query', 'wpcf_views_query', 12, 2 ); // after custom fields.
|
126 |
// Get field
|
127 |
$field = types_get_field( $field_id );
|
128 |
|
|
|
|
|
129 |
// If field not found return empty string
|
130 |
if ( empty( $field ) ) {
|
131 |
|
328 |
$params['field_value'], $field['type'], $field['slug'],
|
329 |
$field['name'], $params ) );
|
330 |
|
331 |
+
return stripslashes( strval( $output ) );
|
332 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
}
|
334 |
|
335 |
function wpcf_frontend_compat_html_output( $output, $field, $content, $params ) {
|
498 |
}
|
499 |
}
|
500 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
// Add a filter to handle Views queries with checkboxes.
|
502 |
|
503 |
add_filter( 'wpv_filter_query', 'wpcf_views_query', 12, 2 ); // after custom fields.
|
embedded/includes/fields-post.php
CHANGED
@@ -154,16 +154,6 @@ function wpcf_add_meta_boxes( $post_type, $post ) {
|
|
154 |
// Get groups
|
155 |
$groups = wpcf_admin_post_get_post_groups_fields( $post );
|
156 |
|
157 |
-
if ( current_user_can( 'unfiltered_html' ) ) {
|
158 |
-
add_meta_box( "wpcf-group-postmeta-fields-can-unfiltered-html",
|
159 |
-
wpcf_translate( 'group postmeta-fields-can-unfiltered-html name', 'Types fields - unfiltered HTML' ),
|
160 |
-
'wpcf_admin_postmeta_fields_can_unfiltered_html_meta_box',
|
161 |
-
$post_type,
|
162 |
-
'normal',
|
163 |
-
'low'
|
164 |
-
);
|
165 |
-
}
|
166 |
-
|
167 |
foreach ( $groups as $group ) {
|
168 |
|
169 |
$only_preview = '';
|
@@ -228,31 +218,6 @@ function wpcf_add_meta_boxes( $post_type, $post ) {
|
|
228 |
}
|
229 |
}
|
230 |
|
231 |
-
function wpcf_admin_postmeta_fields_can_unfiltered_html_meta_box( $post ) {
|
232 |
-
$can_unfiltered_html = wpcf_get_post_meta( $post->ID, '_wpcf_postmeta_fields_unfiltered_html', true );
|
233 |
-
$can_unfiltered_html = empty( $can_unfiltered_html ) ? 'on' : $can_unfiltered_html;
|
234 |
-
$disabled = '';
|
235 |
-
if ( wpcf_get_settings('postmeta_unfiltered_html') == 'off' ) {
|
236 |
-
$can_unfiltered_html = 'off';
|
237 |
-
$disabled = ' disabled="disabled"';
|
238 |
-
}
|
239 |
-
?>
|
240 |
-
<input type="radio" id="wpcf_postmeta_fields_can_unfiltered_html_on" name="_wpcf_postmeta_fields_unfiltered_html" value="on" <?php checked( $can_unfiltered_html, 'on' ); echo $disabled; ?> />
|
241 |
-
<label for="wpcf_postmeta_fields_can_unfiltered_html_on">
|
242 |
-
<?php _e( 'Enable unfiltered HTML in Types custom fields on this post', 'wpcf' ); ?>
|
243 |
-
</label>
|
244 |
-
<br />
|
245 |
-
<input type="radio" id="wpcf_postmeta_fields_can_unfiltered_html_off" name="_wpcf_postmeta_fields_unfiltered_html" value="off" <?php checked( $can_unfiltered_html, 'off' ); echo $disabled; ?> />
|
246 |
-
<label for="wpcf_postmeta_fields_can_unfiltered_html_off">
|
247 |
-
<?php _e( 'Disable unfiltered HTML in Types custom fields on this post', 'wpcf' ); ?>
|
248 |
-
</label>
|
249 |
-
<!--
|
250 |
-
<hr />
|
251 |
-
Documentation link
|
252 |
-
-->
|
253 |
-
<?php
|
254 |
-
}
|
255 |
-
|
256 |
/**
|
257 |
* Renders meta box content (preview).
|
258 |
*
|
@@ -604,18 +569,6 @@ function wpcf_admin_post_meta_box( $post, $group, $echo = '', $open_style_editor
|
|
604 |
function wpcf_admin_post_save_post_hook( $post_ID, $post )
|
605 |
{
|
606 |
|
607 |
-
if ( current_user_can( 'unfiltered_html' ) ) {
|
608 |
-
if (
|
609 |
-
isset( $_POST['_wpcf_postmeta_fields_unfiltered_html'] )
|
610 |
-
&& in_array( $_POST['_wpcf_postmeta_fields_unfiltered_html'], array( 'on', 'off' ) )
|
611 |
-
) {
|
612 |
-
$unfiltered_html = $_POST['_wpcf_postmeta_fields_unfiltered_html'];
|
613 |
-
update_post_meta( $post_ID, '_wpcf_postmeta_fields_unfiltered_html', $unfiltered_html );
|
614 |
-
}
|
615 |
-
} else {
|
616 |
-
update_post_meta( $post_ID, '_wpcf_postmeta_fields_unfiltered_html', 'off' );
|
617 |
-
}
|
618 |
-
|
619 |
if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) {
|
620 |
|
621 |
global $wpcf;
|
154 |
// Get groups
|
155 |
$groups = wpcf_admin_post_get_post_groups_fields( $post );
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
foreach ( $groups as $group ) {
|
158 |
|
159 |
$only_preview = '';
|
218 |
}
|
219 |
}
|
220 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
/**
|
222 |
* Renders meta box content (preview).
|
223 |
*
|
569 |
function wpcf_admin_post_save_post_hook( $post_ID, $post )
|
570 |
{
|
571 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) {
|
573 |
|
574 |
global $wpcf;
|
embedded/includes/fields/wysiwyg.php
CHANGED
@@ -128,33 +128,26 @@ function wpcf_fields_wysiwyg_view( $params ) {
|
|
128 |
$output .= '>';
|
129 |
}
|
130 |
|
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 |
-
|
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 |
-
|
154 |
-
|
155 |
-
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
|
|
|
|
|
|
|
|
|
|
157 |
}
|
|
|
158 |
if ( preg_match_all('/playlist[^\]]+/', $output, $matches ) ) {
|
159 |
foreach( $matches[0] as $one ) {
|
160 |
$re = '/'.$one.'/';
|
@@ -164,7 +157,6 @@ function wpcf_fields_wysiwyg_view( $params ) {
|
|
164 |
}
|
165 |
add_shortcode( 'playlist', 'wp_playlist_shortcode' );
|
166 |
|
167 |
-
$output .= $content;
|
168 |
if ( !empty( $params['style'] ) || !empty( $params['class'] ) ) {
|
169 |
$output .= '</div>';
|
170 |
}
|
128 |
$output .= '>';
|
129 |
}
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
remove_shortcode('playlist', 'wp_playlist_shortcode');
|
132 |
|
133 |
+
$content = stripslashes( $params['field_value'] );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
+
if ( isset( $params['suppress_filters'] ) && $params['suppress_filters'] == 'true' ) {
|
136 |
+
$the_content_filters = array(
|
137 |
+
'wptexturize', 'convert_smilies', 'convert_chars', 'wpautop',
|
138 |
+
'shortcode_unautop', 'prepend_attachment', 'capital_P_dangit', 'do_shortcode');
|
139 |
+
foreach ($the_content_filters as $func) {
|
140 |
+
if ( function_exists( $func ) ) {
|
141 |
+
$content = call_user_func($func, $content);
|
142 |
+
}
|
143 |
}
|
144 |
+
$output .= $content;
|
145 |
+
} else {
|
146 |
+
$filter_state = new WPCF_WP_filter_state( 'the_content' );
|
147 |
+
$output .= apply_filters( 'the_content', $content );
|
148 |
+
$filter_state->restore( );
|
149 |
}
|
150 |
+
|
151 |
if ( preg_match_all('/playlist[^\]]+/', $output, $matches ) ) {
|
152 |
foreach( $matches[0] as $one ) {
|
153 |
$re = '/'.$one.'/';
|
157 |
}
|
158 |
add_shortcode( 'playlist', 'wp_playlist_shortcode' );
|
159 |
|
|
|
160 |
if ( !empty( $params['style'] ) || !empty( $params['class'] ) ) {
|
161 |
$output .= '</div>';
|
162 |
}
|
embedded/includes/usermeta-post.php
CHANGED
@@ -24,39 +24,6 @@ function wpcf_admin_userprofile_init($user_id){
|
|
24 |
$groups = wpcf_admin_usermeta_get_groups_fields();
|
25 |
$wpcf_active = false;
|
26 |
$profile_only_preview = '';
|
27 |
-
|
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 |
|
61 |
foreach ( $groups as $group ) {
|
62 |
if ( !empty( $group['fields'] ) ) {
|
@@ -358,18 +325,6 @@ function wpcf_admin_profile_js_validation(){
|
|
358 |
*/
|
359 |
function wpcf_admin_userprofilesave_init($user_id){
|
360 |
|
361 |
-
if ( current_user_can( 'unfiltered_html' ) ) {
|
362 |
-
if (
|
363 |
-
isset( $_POST['_wpcf_usermeta_fields_unfiltered_html'] )
|
364 |
-
&& in_array( $_POST['_wpcf_usermeta_fields_unfiltered_html'], array( 'on', 'off' ) )
|
365 |
-
) {
|
366 |
-
$unfiltered_html = $_POST['_wpcf_usermeta_fields_unfiltered_html'];
|
367 |
-
update_user_meta( $user_id, '_wpcf_usermeta_fields_unfiltered_html', $unfiltered_html );
|
368 |
-
}
|
369 |
-
} else {
|
370 |
-
update_user_meta( $user_id, '_wpcf_usermeta_fields_unfiltered_html', 'off' );
|
371 |
-
}
|
372 |
-
|
373 |
if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) {
|
374 |
|
375 |
global $wpcf;
|
24 |
$groups = wpcf_admin_usermeta_get_groups_fields();
|
25 |
$wpcf_active = false;
|
26 |
$profile_only_preview = '';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
foreach ( $groups as $group ) {
|
29 |
if ( !empty( $group['fields'] ) ) {
|
325 |
*/
|
326 |
function wpcf_admin_userprofilesave_init($user_id){
|
327 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
if ( defined( 'WPTOOLSET_FORMS_VERSION' ) ) {
|
329 |
|
330 |
global $wpcf;
|
embedded/plugin.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
-
Version: 1.7.
|
9 |
*/
|
10 |
/**
|
11 |
*
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
+
Version: 1.7.11
|
9 |
*/
|
10 |
/**
|
11 |
*
|
embedded/readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: http://wp-types.com
|
|
4 |
Tags: CMS, custom field, custom fields, custom post type, custom post types, field, fields post, post type, post types, taxonomies, taxonomy
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
-
Tested up to: 4.2.
|
8 |
-
Stable tag: 1.7.
|
9 |
|
10 |
The Embedded version lets you create custom types, taxonomies and fields for your theme or plugin, without requiring any plugin.
|
11 |
|
4 |
Tags: CMS, custom field, custom fields, custom post type, custom post types, field, fields post, post type, post types, taxonomies, taxonomy
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
+
Tested up to: 4.2.4
|
8 |
+
Stable tag: 1.7.11
|
9 |
|
10 |
The Embedded version lets you create custom types, taxonomies and fields for your theme or plugin, without requiring any plugin.
|
11 |
|
embedded/usermeta-init.php
CHANGED
@@ -421,9 +421,6 @@ function types_render_usermeta( $field_id, $params, $content = null, $code = ''
|
|
421 |
// Get field
|
422 |
$field = wpcf_fields_get_field_by_slug( $field_id, 'wpcf-usermeta' );
|
423 |
|
424 |
-
$params['unfiltered_html'] = wpcf_usermeta_fields_can_unfiltered_html( $user_id );
|
425 |
-
|
426 |
-
|
427 |
// If field not found return empty string
|
428 |
if ( empty( $field ) ) {
|
429 |
|
@@ -599,9 +596,6 @@ function types_render_usermeta_field( $field_id, $params, $content = null,
|
|
599 |
|
600 |
// Set field
|
601 |
$wpcf->usermeta_field->set( $user_id, $field );
|
602 |
-
|
603 |
-
$params['unfiltered_html'] = wpcf_usermeta_fields_can_unfiltered_html( $user_id );
|
604 |
-
|
605 |
|
606 |
// See if repetitive
|
607 |
if ( wpcf_admin_is_repetitive( $field ) ) {
|
@@ -685,22 +679,6 @@ function types_render_usermeta_field( $field_id, $params, $content = null,
|
|
685 |
return $wpcf->usermeta_field->html( $html, $params );
|
686 |
}
|
687 |
|
688 |
-
function wpcf_usermeta_fields_can_unfiltered_html( $user_id ) {
|
689 |
-
$return = true;
|
690 |
-
if ( empty( $user_id ) ) {
|
691 |
-
return $return;
|
692 |
-
}
|
693 |
-
$can_unfiltered_html = get_user_meta( $user_id, '_wpcf_usermeta_fields_unfiltered_html', true );
|
694 |
-
if (
|
695 |
-
$can_unfiltered_html == 'off'
|
696 |
-
|| wpcf_get_settings('usermeta_unfiltered_html') == 'off'
|
697 |
-
|| ! apply_filters( 'wpcf_filter_wpcf_usermeta_fields_unfiltered_html', true, $user_id )
|
698 |
-
) {
|
699 |
-
$return = false;
|
700 |
-
}
|
701 |
-
return $return;
|
702 |
-
}
|
703 |
-
|
704 |
/**
|
705 |
* Add fields to user profile
|
706 |
*/
|
421 |
// Get field
|
422 |
$field = wpcf_fields_get_field_by_slug( $field_id, 'wpcf-usermeta' );
|
423 |
|
|
|
|
|
|
|
424 |
// If field not found return empty string
|
425 |
if ( empty( $field ) ) {
|
426 |
|
596 |
|
597 |
// Set field
|
598 |
$wpcf->usermeta_field->set( $user_id, $field );
|
|
|
|
|
|
|
599 |
|
600 |
// See if repetitive
|
601 |
if ( wpcf_admin_is_repetitive( $field ) ) {
|
679 |
return $wpcf->usermeta_field->html( $html, $params );
|
680 |
}
|
681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
/**
|
683 |
* Add fields to user profile
|
684 |
*/
|
includes/settings.php
CHANGED
@@ -141,8 +141,7 @@ function wpcf_admin_general_settings_form() {
|
|
141 |
'#options' => array(
|
142 |
'on' => array(
|
143 |
'#value' => 'on',
|
144 |
-
'#title' => __("Enable saving unfiltered HTML in Types custom fields for users with higher roles
|
145 |
-
'#description' => __('Note that when a user with a low level role saves a post, he will disable unfiltered HTML.', 'wpcf'),
|
146 |
),
|
147 |
'off' => array(
|
148 |
'#value' => 'off',
|
@@ -161,8 +160,7 @@ function wpcf_admin_general_settings_form() {
|
|
161 |
'#options' => array(
|
162 |
'on' => array(
|
163 |
'#value' => 'on',
|
164 |
-
'#title' => __("Enable saving unfiltered HTML in Types usermeta fields for users with higher roles
|
165 |
-
'#description' => __('Note that when a user with a low level role edits his own profile, he will disable unfiltered HTML.', 'wpcf'),
|
166 |
),
|
167 |
'off' => array(
|
168 |
'#value' => 'off',
|
141 |
'#options' => array(
|
142 |
'on' => array(
|
143 |
'#value' => 'on',
|
144 |
+
'#title' => __("Enable saving unfiltered HTML in Types custom fields for users with higher roles", 'wpcf'),
|
|
|
145 |
),
|
146 |
'off' => array(
|
147 |
'#value' => 'off',
|
160 |
'#options' => array(
|
161 |
'on' => array(
|
162 |
'#value' => 'on',
|
163 |
+
'#title' => __("Enable saving unfiltered HTML in Types usermeta fields for users with higher roles", 'wpcf'),
|
|
|
164 |
),
|
165 |
'off' => array(
|
166 |
'#value' => 'off',
|
readme.txt
CHANGED
@@ -4,8 +4,8 @@ Donate link: http://wp-types.com
|
|
4 |
Tags: CMS, custom field, custom fields, custom post type, custom post types, field, fields post, post type, post types, taxonomies, taxonomy
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
-
Tested up to: 4.2.
|
8 |
-
Stable tag: 1.7.
|
9 |
|
10 |
The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
|
11 |
|
@@ -155,6 +155,11 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
155 |
|
156 |
== Changelog ==
|
157 |
|
|
|
|
|
|
|
|
|
|
|
158 |
= 1.7.10 =
|
159 |
|
160 |
* Release date: 2015-08-04
|
4 |
Tags: CMS, custom field, custom fields, custom post type, custom post types, field, fields post, post type, post types, taxonomies, taxonomy
|
5 |
License: GPLv2
|
6 |
Requires at least: 3.4
|
7 |
+
Tested up to: 4.2.4
|
8 |
+
Stable tag: 1.7.11
|
9 |
|
10 |
The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
|
11 |
|
155 |
|
156 |
== Changelog ==
|
157 |
|
158 |
+
= 1.7.11 =
|
159 |
+
|
160 |
+
* Release date: 2015-08-05
|
161 |
+
* Fixed a problem when saving HTML in meta fields.
|
162 |
+
|
163 |
= 1.7.10 =
|
164 |
|
165 |
* Release date: 2015-08-04
|
wpcf.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
-
Version: 1.7.
|
9 |
*/
|
10 |
/**
|
11 |
*
|
@@ -16,7 +16,7 @@ if ( !defined( 'WPCF_VERSION' ) ) {
|
|
16 |
/**
|
17 |
* make sure that WPCF_VERSION in embedded/bootstrap.php is the same!
|
18 |
*/
|
19 |
-
define( 'WPCF_VERSION', '1.7.
|
20 |
}
|
21 |
|
22 |
define( 'WPCF_REPOSITORY', 'http://api.wp-types.com/' );
|
5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
6 |
Author: OnTheGoSystems
|
7 |
Author URI: http://www.onthegosystems.com
|
8 |
+
Version: 1.7.11
|
9 |
*/
|
10 |
/**
|
11 |
*
|
16 |
/**
|
17 |
* make sure that WPCF_VERSION in embedded/bootstrap.php is the same!
|
18 |
*/
|
19 |
+
define( 'WPCF_VERSION', '1.7.11' );
|
20 |
}
|
21 |
|
22 |
define( 'WPCF_REPOSITORY', 'http://api.wp-types.com/' );
|