Version Description
- Release date: 2015-12-07
- Fixed compatibility with WPML related to custom field translations.
- Fixed compatibility with WordPress 4.4 related to menu management.
- Added 'action' to the list of reserved words that can not be used to name post types or taxonomies.
Download this release
Release Info
| Developer | jadpm |
| Plugin | |
| Version | 1.8.11 |
| Comparing to | |
| See all releases | |
Code changes from version 1.8.10 to 1.8.11
- embedded/bootstrap.php +1 -1
- embedded/classes/class.wpcf-post-types.php +16 -5
- embedded/frontend.php +3 -23
- embedded/includes/fields/checkbox.php +11 -0
- embedded/includes/fields/checkboxes.php +20 -0
- embedded/includes/fields/radio.php +12 -5
- embedded/includes/fields/select.php +7 -2
- embedded/includes/wpml.php +2 -2
- embedded/plugin.php +1 -1
- embedded/readme.txt +2 -2
- readme.txt +9 -2
- wpcf.php +12 -14
embedded/bootstrap.php
CHANGED
|
@@ -156,7 +156,7 @@ function wpcf_embedded_init() {
|
|
| 156 |
// Define necessary constants if plugin is not present
|
| 157 |
// This ones are skipped if used as embedded code!
|
| 158 |
if ( !defined( 'WPCF_VERSION' ) ) {
|
| 159 |
-
define( 'WPCF_VERSION', '1.8.
|
| 160 |
define( 'WPCF_META_PREFIX', 'wpcf-' );
|
| 161 |
}
|
| 162 |
|
| 156 |
// Define necessary constants if plugin is not present
|
| 157 |
// This ones are skipped if used as embedded code!
|
| 158 |
if ( !defined( 'WPCF_VERSION' ) ) {
|
| 159 |
+
define( 'WPCF_VERSION', '1.8.11' );
|
| 160 |
define( 'WPCF_META_PREFIX', 'wpcf-' );
|
| 161 |
}
|
| 162 |
|
embedded/classes/class.wpcf-post-types.php
CHANGED
|
@@ -28,9 +28,12 @@ class WPCF_Post_Types
|
|
| 28 |
function __construct()
|
| 29 |
{
|
| 30 |
add_action('admin_init', array($this, 'admin_init'));
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
/**
|
| 36 |
* Check has some custom fields to display.
|
|
@@ -319,18 +322,26 @@ class WPCF_Post_Types
|
|
| 319 |
|
| 320 |
public function add_archive_checkbox( $posts, $args, $post_type )
|
| 321 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
global $_nav_menu_placeholder, $wp_rewrite;
|
| 323 |
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
|
| 324 |
|
| 325 |
array_unshift( $posts, (object) array(
|
| 326 |
'ID' => 0,
|
| 327 |
'object_id' => $_nav_menu_placeholder,
|
| 328 |
-
'post_title' => $
|
| 329 |
'post_type' => 'nav_menu_item',
|
| 330 |
'post_excerpt' => '',
|
| 331 |
'post_content' => '',
|
| 332 |
'type' => 'post_type_archive',
|
| 333 |
-
'object' => $
|
| 334 |
) );
|
| 335 |
|
| 336 |
return $posts;
|
| 28 |
function __construct()
|
| 29 |
{
|
| 30 |
add_action('admin_init', array($this, 'admin_init'));
|
| 31 |
+
global $wp_version;
|
| 32 |
+
if ( version_compare( $wp_version, '4.4' ) < 0 ) {
|
| 33 |
+
add_action('admin_head-nav-menus.php', array($this, 'add_filters'));
|
| 34 |
+
add_filter('wp_setup_nav_menu_item', array( $this, 'setup_archive_item'));
|
| 35 |
+
add_filter('wp_nav_menu_objects', array( $this, 'maybe_make_current'));
|
| 36 |
+
}
|
| 37 |
}
|
| 38 |
/**
|
| 39 |
* Check has some custom fields to display.
|
| 322 |
|
| 323 |
public function add_archive_checkbox( $posts, $args, $post_type )
|
| 324 |
{
|
| 325 |
+
if (
|
| 326 |
+
is_array( $post_type )
|
| 327 |
+
&& isset( $post_type['args'] )
|
| 328 |
+
) {
|
| 329 |
+
$post_type_object = $post_type['args'];
|
| 330 |
+
} else {
|
| 331 |
+
$post_type_object = $post_type;
|
| 332 |
+
}
|
| 333 |
global $_nav_menu_placeholder, $wp_rewrite;
|
| 334 |
$_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
|
| 335 |
|
| 336 |
array_unshift( $posts, (object) array(
|
| 337 |
'ID' => 0,
|
| 338 |
'object_id' => $_nav_menu_placeholder,
|
| 339 |
+
'post_title' => $post_type_object->labels->all_items,
|
| 340 |
'post_type' => 'nav_menu_item',
|
| 341 |
'post_excerpt' => '',
|
| 342 |
'post_content' => '',
|
| 343 |
'type' => 'post_type_archive',
|
| 344 |
+
'object' => $post_type_object->slug,
|
| 345 |
) );
|
| 346 |
|
| 347 |
return $posts;
|
embedded/frontend.php
CHANGED
|
@@ -244,29 +244,9 @@ function types_render_field_single( $field, $params, $content = null, $code = ''
|
|
| 244 |
if ( is_string( $params['field_value'] ) ) {
|
| 245 |
$params['field_value'] = addslashes( stripslashes( strval( $params['field_value'] ) ) );
|
| 246 |
}
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
foreach ( $params['field_value'] as $f_key => $f_value ) {
|
| 251 |
-
if ((isset($field['data']['repetitive'])) && ($field['data']['repetitive'])) {
|
| 252 |
-
//Repetitive fields, used meta ID for proper string translation unique identification
|
| 253 |
-
$params['field_value'] = wpcf_translate( 'field ' . $field['id'] . ' value '.$meta_id, $params['field_value'] );
|
| 254 |
-
} else {
|
| 255 |
-
//Non-repetitive fields, use post ID
|
| 256 |
-
$params['field_value'] = wpcf_translate( 'field ' . $field['id'] . ' value '.$post->ID, $params['field_value'] );
|
| 257 |
-
}
|
| 258 |
-
}
|
| 259 |
-
} else {
|
| 260 |
-
if ((isset($field['data']['repetitive'])) && ($field['data']['repetitive'])) {
|
| 261 |
-
|
| 262 |
-
//Repetitive fields, used meta ID for proper string translation unique identification
|
| 263 |
-
$params['field_value'] = wpcf_translate( 'field ' . $field['id'] . ' value '.$meta_id, $params['field_value'] );
|
| 264 |
-
|
| 265 |
-
} else {
|
| 266 |
-
//Non-repetitive fields, use post ID
|
| 267 |
-
$params['field_value'] = wpcf_translate( 'field ' . $field['id'] . ' value '.$post->ID, $params['field_value'] );
|
| 268 |
-
}
|
| 269 |
-
}
|
| 270 |
|
| 271 |
$field['name'] = wpcf_translate( 'field ' . $field['id'] . ' name', $field['name'] );
|
| 272 |
$params['field'] = $field;
|
| 244 |
if ( is_string( $params['field_value'] ) ) {
|
| 245 |
$params['field_value'] = addslashes( stripslashes( strval( $params['field_value'] ) ) );
|
| 246 |
}
|
| 247 |
+
|
| 248 |
+
// Note that $params['field_value'] does NOT need translating
|
| 249 |
+
// When a variable string or label output needs translating we do it on 'wpcf_fields_type_' . $field['type'] . '_value_display' on a field type basis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
|
| 251 |
$field['name'] = wpcf_translate( 'field ' . $field['id'] . ' name', $field['name'] );
|
| 252 |
$params['field'] = $field;
|
embedded/includes/fields/checkbox.php
CHANGED
|
@@ -27,6 +27,8 @@ function wpcf_fields_checkbox()
|
|
| 27 |
* Form data for post edit page.
|
| 28 |
*
|
| 29 |
* @param type $field
|
|
|
|
|
|
|
| 30 |
*/
|
| 31 |
function wpcf_fields_checkbox_meta_box_form($field, $field_object)
|
| 32 |
{
|
|
@@ -194,17 +196,26 @@ function wpcf_fields_checkbox_view($params)
|
|
| 194 |
$output = $params['field_value'];
|
| 195 |
// Show the translated value if we have one.
|
| 196 |
$field = wpcf_fields_get_field_by_slug( $params['field']['slug'], $option_name );
|
|
|
|
|
|
|
|
|
|
| 197 |
$output = wpcf_translate( 'field ' . $field['id'] . ' checkbox value', $output );
|
| 198 |
} elseif ( $params['field']['data']['display'] == 'value'
|
| 199 |
&& $params['field_value'] != '' ) {
|
| 200 |
if ( !empty( $params['field']['data']['display_value_selected'] ) ) {
|
| 201 |
$output = $params['field']['data']['display_value_selected'];
|
|
|
|
|
|
|
|
|
|
| 202 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' checkbox value selected',
|
| 203 |
$output );
|
| 204 |
}
|
| 205 |
} elseif ( $params['field']['data']['display'] == 'value'
|
| 206 |
&& !empty( $params['field']['data']['display_value_not_selected'] ) ) {
|
| 207 |
$output = $params['field']['data']['display_value_not_selected'];
|
|
|
|
|
|
|
|
|
|
| 208 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' checkbox value not selected', $output );
|
| 209 |
} else {
|
| 210 |
return '__wpcf_skip_empty';
|
| 27 |
* Form data for post edit page.
|
| 28 |
*
|
| 29 |
* @param type $field
|
| 30 |
+
*
|
| 31 |
+
* @deprecated seems
|
| 32 |
*/
|
| 33 |
function wpcf_fields_checkbox_meta_box_form($field, $field_object)
|
| 34 |
{
|
| 196 |
$output = $params['field_value'];
|
| 197 |
// Show the translated value if we have one.
|
| 198 |
$field = wpcf_fields_get_field_by_slug( $params['field']['slug'], $option_name );
|
| 199 |
+
// We need to translate here because the stored value is on the original language
|
| 200 |
+
// When updaing the value in the Field group, we might have problems
|
| 201 |
+
// @wpmlhere
|
| 202 |
$output = wpcf_translate( 'field ' . $field['id'] . ' checkbox value', $output );
|
| 203 |
} elseif ( $params['field']['data']['display'] == 'value'
|
| 204 |
&& $params['field_value'] != '' ) {
|
| 205 |
if ( !empty( $params['field']['data']['display_value_selected'] ) ) {
|
| 206 |
$output = $params['field']['data']['display_value_selected'];
|
| 207 |
+
// We need to translate here because the stored value is on the original language
|
| 208 |
+
// When updaing the value in the Field group, we might have problems
|
| 209 |
+
// @wpmlhere
|
| 210 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' checkbox value selected',
|
| 211 |
$output );
|
| 212 |
}
|
| 213 |
} elseif ( $params['field']['data']['display'] == 'value'
|
| 214 |
&& !empty( $params['field']['data']['display_value_not_selected'] ) ) {
|
| 215 |
$output = $params['field']['data']['display_value_not_selected'];
|
| 216 |
+
// We need to translate here because the stored value is on the original language
|
| 217 |
+
// When updaing the value in the Field group, we might have problems
|
| 218 |
+
// @wpmlhere
|
| 219 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' checkbox value not selected', $output );
|
| 220 |
} else {
|
| 221 |
return '__wpcf_skip_empty';
|
embedded/includes/fields/checkboxes.php
CHANGED
|
@@ -26,6 +26,8 @@ add_filter( 'wpv_condition_end',
|
|
| 26 |
* Form data for post edit page.
|
| 27 |
*
|
| 28 |
* @param type $field
|
|
|
|
|
|
|
| 29 |
*/
|
| 30 |
function wpcf_fields_checkboxes_meta_box_form( $field, $field_object ) {
|
| 31 |
$options = array();
|
|
@@ -185,15 +187,24 @@ function wpcf_fields_checkboxes_view( $params ) {
|
|
| 185 |
if ( $option['display'] == 'db'
|
| 186 |
&& !empty( $option['set_value'] ) && !empty( $value ) ) {
|
| 187 |
$value = $option['set_value'];
|
|
|
|
|
|
|
|
|
|
| 188 |
$value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' value',
|
| 189 |
$value );
|
| 190 |
} else if ( $option['display'] == 'value' ) {
|
| 191 |
if ( isset( $option['display_value_selected'] ) && !empty( $value ) ) {
|
| 192 |
$value = $option['display_value_selected'];
|
|
|
|
|
|
|
|
|
|
| 193 |
$value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' display value selected',
|
| 194 |
$value );
|
| 195 |
} else {
|
| 196 |
$value = $option['display_value_not_selected'];
|
|
|
|
|
|
|
|
|
|
| 197 |
$value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' display value not selected',
|
| 198 |
$value );
|
| 199 |
}
|
|
@@ -260,6 +271,9 @@ function wpcf_fields_checkboxes_view( $params ) {
|
|
| 260 |
if ( !empty( $option['data']['set_value'] )
|
| 261 |
&& $option['value'] != '__wpcf_unchecked' ) {
|
| 262 |
$output = $option['data']['set_value'];
|
|
|
|
|
|
|
|
|
|
| 263 |
$output = wpcf_translate( 'field ' . $params['field']['id']
|
| 264 |
. ' option ' . $option['key'] . ' value', $output );
|
| 265 |
}
|
|
@@ -271,6 +285,9 @@ function wpcf_fields_checkboxes_view( $params ) {
|
|
| 271 |
if ( $option['value'] != '__wpcf_unchecked' ) {
|
| 272 |
if ( isset( $option['data']['display_value_selected'] ) ) {
|
| 273 |
$output = $option['data']['display_value_selected'];
|
|
|
|
|
|
|
|
|
|
| 274 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option['key'] . ' display value selected',
|
| 275 |
$output );
|
| 276 |
}
|
|
@@ -281,6 +298,9 @@ function wpcf_fields_checkboxes_view( $params ) {
|
|
| 281 |
*/
|
| 282 |
} else if ( isset( $option['data']['display_value_not_selected'] ) ) {
|
| 283 |
$output = $option['data']['display_value_not_selected'];
|
|
|
|
|
|
|
|
|
|
| 284 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option['key'] . ' display value not selected',
|
| 285 |
$output );
|
| 286 |
}
|
| 26 |
* Form data for post edit page.
|
| 27 |
*
|
| 28 |
* @param type $field
|
| 29 |
+
*
|
| 30 |
+
* @deprecated seems
|
| 31 |
*/
|
| 32 |
function wpcf_fields_checkboxes_meta_box_form( $field, $field_object ) {
|
| 33 |
$options = array();
|
| 187 |
if ( $option['display'] == 'db'
|
| 188 |
&& !empty( $option['set_value'] ) && !empty( $value ) ) {
|
| 189 |
$value = $option['set_value'];
|
| 190 |
+
// We need to translate here because the stored value is on the original language
|
| 191 |
+
// When updaing the value in the Field group, we might have problems
|
| 192 |
+
// @wpmlhere
|
| 193 |
$value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' value',
|
| 194 |
$value );
|
| 195 |
} else if ( $option['display'] == 'value' ) {
|
| 196 |
if ( isset( $option['display_value_selected'] ) && !empty( $value ) ) {
|
| 197 |
$value = $option['display_value_selected'];
|
| 198 |
+
// We need to translate here because the stored value is on the original language
|
| 199 |
+
// When updaing the value in the Field group, we might have problems
|
| 200 |
+
// @wpmlhere
|
| 201 |
$value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' display value selected',
|
| 202 |
$value );
|
| 203 |
} else {
|
| 204 |
$value = $option['display_value_not_selected'];
|
| 205 |
+
// We need to translate here because the stored value is on the original language
|
| 206 |
+
// When updaing the value in the Field group, we might have problems
|
| 207 |
+
// @wpmlhere
|
| 208 |
$value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' display value not selected',
|
| 209 |
$value );
|
| 210 |
}
|
| 271 |
if ( !empty( $option['data']['set_value'] )
|
| 272 |
&& $option['value'] != '__wpcf_unchecked' ) {
|
| 273 |
$output = $option['data']['set_value'];
|
| 274 |
+
// We need to translate here because the stored value is on the original language
|
| 275 |
+
// When updaing the value in the Field group, we might have problems
|
| 276 |
+
// @wpmlhere
|
| 277 |
$output = wpcf_translate( 'field ' . $params['field']['id']
|
| 278 |
. ' option ' . $option['key'] . ' value', $output );
|
| 279 |
}
|
| 285 |
if ( $option['value'] != '__wpcf_unchecked' ) {
|
| 286 |
if ( isset( $option['data']['display_value_selected'] ) ) {
|
| 287 |
$output = $option['data']['display_value_selected'];
|
| 288 |
+
// We need to translate here because the stored value is on the original language
|
| 289 |
+
// When updaing the value in the Field group, we might have problems
|
| 290 |
+
// @wpmlhere
|
| 291 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option['key'] . ' display value selected',
|
| 292 |
$output );
|
| 293 |
}
|
| 298 |
*/
|
| 299 |
} else if ( isset( $option['data']['display_value_not_selected'] ) ) {
|
| 300 |
$output = $option['data']['display_value_not_selected'];
|
| 301 |
+
// We need to translate here because the stored value is on the original language
|
| 302 |
+
// When updaing the value in the Field group, we might have problems
|
| 303 |
+
// @wpmlhere
|
| 304 |
$output = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option['key'] . ' display value not selected',
|
| 305 |
$output );
|
| 306 |
}
|
embedded/includes/fields/radio.php
CHANGED
|
@@ -18,6 +18,8 @@ function wpcf_fields_radio() {
|
|
| 18 |
* Form data for post edit page.
|
| 19 |
*
|
| 20 |
* @param type $field
|
|
|
|
|
|
|
| 21 |
*/
|
| 22 |
function wpcf_fields_radio_meta_box_form( $field ) {
|
| 23 |
$options = array();
|
|
@@ -162,14 +164,19 @@ function wpcf_fields_radio_view( $params ) {
|
|
| 162 |
foreach ( $field['data']['options'] as $option_key => $option ) {
|
| 163 |
if ( isset( $option['value'] )
|
| 164 |
&& stripslashes( $option['value'] ) == stripslashes( $params['field_value'] ) ) {
|
| 165 |
-
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
| 167 |
if ( isset( $params['field']['data']['display'] )
|
| 168 |
&& $params['field']['data']['display'] != 'db'
|
| 169 |
&& !empty( $option['display_value'] ) ) {
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
|
|
|
|
|
|
| 173 |
}
|
| 174 |
}
|
| 175 |
}
|
| 18 |
* Form data for post edit page.
|
| 19 |
*
|
| 20 |
* @param type $field
|
| 21 |
+
*
|
| 22 |
+
* @deprecated seems
|
| 23 |
*/
|
| 24 |
function wpcf_fields_radio_meta_box_form( $field ) {
|
| 25 |
$options = array();
|
| 164 |
foreach ( $field['data']['options'] as $option_key => $option ) {
|
| 165 |
if ( isset( $option['value'] )
|
| 166 |
&& stripslashes( $option['value'] ) == stripslashes( $params['field_value'] ) ) {
|
| 167 |
+
// We need to translate here because the stored value is on the original language
|
| 168 |
+
// When updaing the value in the Field group, we might have problems
|
| 169 |
+
// @wpmlhere
|
| 170 |
+
$field_value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option_key . ' title', $option['title'] );
|
| 171 |
+
//$field_value = $option['title'];
|
| 172 |
if ( isset( $params['field']['data']['display'] )
|
| 173 |
&& $params['field']['data']['display'] != 'db'
|
| 174 |
&& !empty( $option['display_value'] ) ) {
|
| 175 |
+
// We need to translate here because the stored value is on the original language
|
| 176 |
+
// When updaing the value in the Field group, we might have problems
|
| 177 |
+
// @wpmlhere
|
| 178 |
+
$field_value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option_key . ' display value', $option['display_value'] );
|
| 179 |
+
//$field_value = $option['display_value'];
|
| 180 |
}
|
| 181 |
}
|
| 182 |
}
|
embedded/includes/fields/select.php
CHANGED
|
@@ -17,6 +17,8 @@ function wpcf_fields_select() {
|
|
| 17 |
* Form data for post edit page.
|
| 18 |
*
|
| 19 |
* @param type $field
|
|
|
|
|
|
|
| 20 |
*/
|
| 21 |
function wpcf_fields_select_meta_box_form($field) {
|
| 22 |
$options = array();
|
|
@@ -73,8 +75,11 @@ function wpcf_fields_select_view($params) {
|
|
| 73 |
foreach ($field['data']['options'] as $option_key => $option) {
|
| 74 |
if (isset($option['value'])
|
| 75 |
&& $option['value'] == $params['field_value']) {
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
| 78 |
}
|
| 79 |
}
|
| 80 |
$output = $field_value;
|
| 17 |
* Form data for post edit page.
|
| 18 |
*
|
| 19 |
* @param type $field
|
| 20 |
+
*
|
| 21 |
+
* @deprecated seems
|
| 22 |
*/
|
| 23 |
function wpcf_fields_select_meta_box_form($field) {
|
| 24 |
$options = array();
|
| 75 |
foreach ($field['data']['options'] as $option_key => $option) {
|
| 76 |
if (isset($option['value'])
|
| 77 |
&& $option['value'] == $params['field_value']) {
|
| 78 |
+
// We need to translate here because the stored value is on the original language
|
| 79 |
+
// When updaing the value in the Field group, we might have problems
|
| 80 |
+
// @wpmlhere
|
| 81 |
+
$field_value = wpcf_translate('field ' . $params['field']['id'] . ' option ' . $option_key . ' title', $option['title']);
|
| 82 |
+
//$field_value = $option['title'];
|
| 83 |
}
|
| 84 |
}
|
| 85 |
$output = $field_value;
|
embedded/includes/wpml.php
CHANGED
|
@@ -1028,7 +1028,7 @@ function wpcf_wpml_is_translated_profile_page( $field ) {
|
|
| 1028 |
*/
|
| 1029 |
function wpcf_wpml_field_is_copy( $field ) {
|
| 1030 |
if ( !defined( 'WPML_TM_VERSION' ) ) return false;
|
| 1031 |
-
return isset( $field['wpml_action'] ) && $field['wpml_action'] === 1;
|
| 1032 |
}
|
| 1033 |
|
| 1034 |
/**
|
|
@@ -1039,7 +1039,7 @@ function wpcf_wpml_field_is_copy( $field ) {
|
|
| 1039 |
*/
|
| 1040 |
function wpcf_wpml_field_is_translated( $field ) {
|
| 1041 |
if ( !defined( 'WPML_TM_VERSION' ) ) return false;
|
| 1042 |
-
return isset( $field['wpml_action'] ) && $field['wpml_action'] === 2;
|
| 1043 |
}
|
| 1044 |
|
| 1045 |
/**
|
| 1028 |
*/
|
| 1029 |
function wpcf_wpml_field_is_copy( $field ) {
|
| 1030 |
if ( !defined( 'WPML_TM_VERSION' ) ) return false;
|
| 1031 |
+
return isset( $field['wpml_action'] ) && intval( $field['wpml_action'] ) === 1;
|
| 1032 |
}
|
| 1033 |
|
| 1034 |
/**
|
| 1039 |
*/
|
| 1040 |
function wpcf_wpml_field_is_translated( $field ) {
|
| 1041 |
if ( !defined( 'WPML_TM_VERSION' ) ) return false;
|
| 1042 |
+
return isset( $field['wpml_action'] ) && intval( $field['wpml_action'] ) === 2;
|
| 1043 |
}
|
| 1044 |
|
| 1045 |
/**
|
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.8.
|
| 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.8.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.
|
| 8 |
-
Stable tag: 1.8.
|
| 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.4
|
| 8 |
+
Stable tag: 1.8.11
|
| 9 |
|
| 10 |
The Embedded version lets you create custom types, taxonomies and fields for your theme or plugin, without requiring any plugin.
|
| 11 |
|
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.
|
| 8 |
-
Stable tag: 1.8.
|
| 9 |
|
| 10 |
The complete and reliable plugin for managing custom post types, custom taxonomies and custom fields.
|
| 11 |
|
|
@@ -155,6 +155,13 @@ Additionally, Types is the only plugin that lets you define parent/child relatio
|
|
| 155 |
|
| 156 |
== Changelog ==
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
= 1.8.10 =
|
| 159 |
|
| 160 |
* Release date: 2015-11-18
|
| 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.4
|
| 8 |
+
Stable tag: 1.8.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.8.11 =
|
| 159 |
+
|
| 160 |
+
* Release date: 2015-12-07
|
| 161 |
+
* Fixed compatibility with WPML related to custom field translations.
|
| 162 |
+
* Fixed compatibility with WordPress 4.4 related to menu management.
|
| 163 |
+
* Added 'action' to the list of reserved words that can not be used to name post types or taxonomies.
|
| 164 |
+
|
| 165 |
= 1.8.10 =
|
| 166 |
|
| 167 |
* Release date: 2015-11-18
|
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.8.
|
| 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.8.
|
| 20 |
}
|
| 21 |
|
| 22 |
define( 'WPCF_REPOSITORY', 'http://api.wp-types.com/' );
|
|
@@ -230,6 +230,7 @@ function wpcf_is_reserved_name($name, $context, $check_pages = true)
|
|
| 230 |
function wpcf_reserved_names()
|
| 231 |
{
|
| 232 |
$reserved = array(
|
|
|
|
| 233 |
'attachment',
|
| 234 |
'attachment_id',
|
| 235 |
'author',
|
|
@@ -239,8 +240,8 @@ function wpcf_reserved_names()
|
|
| 239 |
'category',
|
| 240 |
'category__and',
|
| 241 |
'category__in',
|
| 242 |
-
'category__not_in',
|
| 243 |
'category_name',
|
|
|
|
| 244 |
'comments_per_page',
|
| 245 |
'comments_popup',
|
| 246 |
'cpage',
|
|
@@ -253,11 +254,12 @@ function wpcf_reserved_names()
|
|
| 253 |
'fields',
|
| 254 |
'format',
|
| 255 |
'hour',
|
|
|
|
| 256 |
'link_category',
|
| 257 |
'm',
|
| 258 |
'minute',
|
| 259 |
-
'monthnum',
|
| 260 |
'mode',
|
|
|
|
| 261 |
'more',
|
| 262 |
'name',
|
| 263 |
'nav_menu',
|
|
@@ -274,16 +276,16 @@ function wpcf_reserved_names()
|
|
| 274 |
'pb',
|
| 275 |
'perm',
|
| 276 |
'post',
|
| 277 |
-
'post__in',
|
| 278 |
-
'post__not_in',
|
| 279 |
'post_format',
|
|
|
|
| 280 |
'post_mime_type',
|
| 281 |
-
'
|
| 282 |
-
'post_tag',
|
| 283 |
-
'post_type',
|
| 284 |
'posts',
|
| 285 |
'posts_per_archive_page',
|
| 286 |
'posts_per_page',
|
|
|
|
|
|
|
|
|
|
| 287 |
'preview',
|
| 288 |
'robots',
|
| 289 |
's',
|
|
@@ -296,9 +298,9 @@ function wpcf_reserved_names()
|
|
| 296 |
'subpost_id',
|
| 297 |
'tag',
|
| 298 |
'tag__and',
|
|
|
|
| 299 |
'tag__in',
|
| 300 |
'tag__not_in',
|
| 301 |
-
'tag_id',
|
| 302 |
'tag_slug__and',
|
| 303 |
'tag_slug__in',
|
| 304 |
'taxonomy',
|
|
@@ -309,10 +311,6 @@ function wpcf_reserved_names()
|
|
| 309 |
'withcomments',
|
| 310 |
'withoutcomments',
|
| 311 |
'year',
|
| 312 |
-
'lang',
|
| 313 |
-
// 'comments',
|
| 314 |
-
// 'blog',
|
| 315 |
-
// 'files'
|
| 316 |
);
|
| 317 |
|
| 318 |
return apply_filters( 'wpcf_reserved_names', $reserved );
|
| 5 |
Description: Define custom post types, custom taxonomies and custom fields.
|
| 6 |
Author: OnTheGoSystems
|
| 7 |
Author URI: http://www.onthegosystems.com
|
| 8 |
+
Version: 1.8.11
|
| 9 |
*/
|
| 10 |
/**
|
| 11 |
*
|
| 16 |
/**
|
| 17 |
* make sure that WPCF_VERSION in embedded/bootstrap.php is the same!
|
| 18 |
*/
|
| 19 |
+
define( 'WPCF_VERSION', '1.8.11' );
|
| 20 |
}
|
| 21 |
|
| 22 |
define( 'WPCF_REPOSITORY', 'http://api.wp-types.com/' );
|
| 230 |
function wpcf_reserved_names()
|
| 231 |
{
|
| 232 |
$reserved = array(
|
| 233 |
+
'action',
|
| 234 |
'attachment',
|
| 235 |
'attachment_id',
|
| 236 |
'author',
|
| 240 |
'category',
|
| 241 |
'category__and',
|
| 242 |
'category__in',
|
|
|
|
| 243 |
'category_name',
|
| 244 |
+
'category__not_in',
|
| 245 |
'comments_per_page',
|
| 246 |
'comments_popup',
|
| 247 |
'cpage',
|
| 254 |
'fields',
|
| 255 |
'format',
|
| 256 |
'hour',
|
| 257 |
+
'lang',
|
| 258 |
'link_category',
|
| 259 |
'm',
|
| 260 |
'minute',
|
|
|
|
| 261 |
'mode',
|
| 262 |
+
'monthnum',
|
| 263 |
'more',
|
| 264 |
'name',
|
| 265 |
'nav_menu',
|
| 276 |
'pb',
|
| 277 |
'perm',
|
| 278 |
'post',
|
|
|
|
|
|
|
| 279 |
'post_format',
|
| 280 |
+
'post__in',
|
| 281 |
'post_mime_type',
|
| 282 |
+
'post__not_in',
|
|
|
|
|
|
|
| 283 |
'posts',
|
| 284 |
'posts_per_archive_page',
|
| 285 |
'posts_per_page',
|
| 286 |
+
'post_status',
|
| 287 |
+
'post_tag',
|
| 288 |
+
'post_type',
|
| 289 |
'preview',
|
| 290 |
'robots',
|
| 291 |
's',
|
| 298 |
'subpost_id',
|
| 299 |
'tag',
|
| 300 |
'tag__and',
|
| 301 |
+
'tag_id',
|
| 302 |
'tag__in',
|
| 303 |
'tag__not_in',
|
|
|
|
| 304 |
'tag_slug__and',
|
| 305 |
'tag_slug__in',
|
| 306 |
'taxonomy',
|
| 311 |
'withcomments',
|
| 312 |
'withoutcomments',
|
| 313 |
'year',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
);
|
| 315 |
|
| 316 |
return apply_filters( 'wpcf_reserved_names', $reserved );
|
