Changeset 1302055
- Timestamp:
- 12/07/2015 10:40:32 AM (9 years ago)
- Location:
- types/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
types/trunk/embedded/classes/class.wpcf-post-types.php
r1187593 r1302055 29 29 { 30 30 add_action('admin_init', array($this, 'admin_init')); 31 add_action('admin_head-nav-menus.php', array($this, 'add_filters')); 32 add_filter('wp_setup_nav_menu_item', array( $this, 'setup_archive_item')); 33 add_filter('wp_nav_menu_objects', array( $this, 'maybe_make_current')); 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 } 34 37 } 35 38 /** … … 320 323 public function add_archive_checkbox( $posts, $args, $post_type ) 321 324 { 325 326 327 328 329 330 331 332 322 333 global $_nav_menu_placeholder, $wp_rewrite; 323 334 $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1; … … 326 337 'ID' => 0, 327 338 'object_id' => $_nav_menu_placeholder, 328 'post_title' => $post_type ['args']->labels->all_items,339 'post_title' => $post_type->labels->all_items, 329 340 'post_type' => 'nav_menu_item', 330 341 'post_excerpt' => '', 331 342 'post_content' => '', 332 343 'type' => 'post_type_archive', 333 'object' => $post_type ['args']->slug,344 'object' => $post_type->slug, 334 345 ) ); 335 346 -
types/trunk/embedded/frontend.php
r1222646 r1302055 245 245 $params['field_value'] = addslashes( stripslashes( strval( $params['field_value'] ) ) ); 246 246 } 247 248 // Set values 249 if ( is_array( $params['field_value'] ) ) { 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 } 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 270 250 271 251 $field['name'] = wpcf_translate( 'field ' . $field['id'] . ' name', $field['name'] ); -
types/trunk/embedded/includes/fields/checkbox.php
r1181030 r1302055 28 28 * 29 29 * @param type $field 30 31 30 32 */ 31 33 function wpcf_fields_checkbox_meta_box_form($field, $field_object) … … 195 197 // Show the translated value if we have one. 196 198 $field = wpcf_fields_get_field_by_slug( $params['field']['slug'], $option_name ); 199 200 201 197 202 $output = wpcf_translate( 'field ' . $field['id'] . ' checkbox value', $output ); 198 203 } elseif ( $params['field']['data']['display'] == 'value' … … 200 205 if ( !empty( $params['field']['data']['display_value_selected'] ) ) { 201 206 $output = $params['field']['data']['display_value_selected']; 207 208 209 202 210 $output = wpcf_translate( 'field ' . $params['field']['id'] . ' checkbox value selected', 203 211 $output ); … … 206 214 && !empty( $params['field']['data']['display_value_not_selected'] ) ) { 207 215 $output = $params['field']['data']['display_value_not_selected']; 216 217 218 208 219 $output = wpcf_translate( 'field ' . $params['field']['id'] . ' checkbox value not selected', $output ); 209 220 } else { -
types/trunk/embedded/includes/fields/checkboxes.php
r1181030 r1302055 27 27 * 28 28 * @param type $field 29 30 29 31 */ 30 32 function wpcf_fields_checkboxes_meta_box_form( $field, $field_object ) { … … 186 188 && !empty( $option['set_value'] ) && !empty( $value ) ) { 187 189 $value = $option['set_value']; 190 191 192 188 193 $value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' value', 189 194 $value ); … … 191 196 if ( isset( $option['display_value_selected'] ) && !empty( $value ) ) { 192 197 $value = $option['display_value_selected']; 198 199 200 193 201 $value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' display value selected', 194 202 $value ); 195 203 } else { 196 204 $value = $option['display_value_not_selected']; 205 206 207 197 208 $value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $name . ' display value not selected', 198 209 $value ); … … 261 272 && $option['value'] != '__wpcf_unchecked' ) { 262 273 $output = $option['data']['set_value']; 274 275 276 263 277 $output = wpcf_translate( 'field ' . $params['field']['id'] 264 278 . ' option ' . $option['key'] . ' value', $output ); … … 272 286 if ( isset( $option['data']['display_value_selected'] ) ) { 273 287 $output = $option['data']['display_value_selected']; 288 289 290 274 291 $output = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option['key'] . ' display value selected', 275 292 $output ); … … 282 299 } else if ( isset( $option['data']['display_value_not_selected'] ) ) { 283 300 $output = $option['data']['display_value_not_selected']; 301 302 303 284 304 $output = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' . $option['key'] . ' display value not selected', 285 305 $output ); -
types/trunk/embedded/includes/fields/radio.php
r1181030 r1302055 19 19 * 20 20 * @param type $field 21 22 21 23 */ 22 24 function wpcf_fields_radio_meta_box_form( $field ) { … … 163 165 if ( isset( $option['value'] ) 164 166 && stripslashes( $option['value'] ) == stripslashes( $params['field_value'] ) ) { 165 $field_value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' 166 . $option_key . ' title', $option['title'] ); 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']; 167 172 if ( isset( $params['field']['data']['display'] ) 168 173 && $params['field']['data']['display'] != 'db' 169 174 && !empty( $option['display_value'] ) ) { 170 $field_value = wpcf_translate( 'field ' . $params['field']['id'] . ' option ' 171 . $option_key . ' display value', 172 $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']; 173 180 } 174 181 } -
types/trunk/embedded/includes/fields/select.php
r762199 r1302055 18 18 * 19 19 * @param type $field 20 21 20 22 */ 21 23 function wpcf_fields_select_meta_box_form($field) { … … 74 76 if (isset($option['value']) 75 77 && $option['value'] == $params['field_value']) { 76 $field_value = wpcf_translate('field ' . $params['field']['id'] . ' option ' 77 . $option_key . ' title', $option['title']); 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']; 78 83 } 79 84 } -
types/trunk/embedded/includes/wpml.php
r1269117 r1302055 1029 1029 function wpcf_wpml_field_is_copy( $field ) { 1030 1030 if ( !defined( 'WPML_TM_VERSION' ) ) return false; 1031 return isset( $field['wpml_action'] ) && $field['wpml_action']=== 1;1031 return isset( $field['wpml_action'] ) && === 1; 1032 1032 } 1033 1033 … … 1040 1040 function wpcf_wpml_field_is_translated( $field ) { 1041 1041 if ( !defined( 'WPML_TM_VERSION' ) ) return false; 1042 return isset( $field['wpml_action'] ) && $field['wpml_action']=== 2;1042 return isset( $field['wpml_action'] ) && === 2; 1043 1043 } 1044 1044 -
types/trunk/wpcf.php
r1302047 r1302055 231 231 { 232 232 $reserved = array( 233 233 234 'attachment', 234 235 'attachment_id', … … 240 241 'category__and', 241 242 'category__in', 243 242 244 'category__not_in', 243 'category_name',244 245 'comments_per_page', 245 246 'comments_popup', … … 254 255 'format', 255 256 'hour', 257 256 258 'link_category', 257 259 'm', 258 260 'minute', 261 259 262 'monthnum', 260 'mode',261 263 'more', 262 264 'name', … … 275 277 'perm', 276 278 'post', 279 277 280 'post__in', 281 278 282 'post__not_in', 279 'post_format', 280 'post_mime_type', 283 'posts', 284 'posts_per_archive_page', 285 'posts_per_page', 281 286 'post_status', 282 287 'post_tag', 283 288 'post_type', 284 'posts',285 'posts_per_archive_page',286 'posts_per_page',287 289 'preview', 288 290 'robots', … … 297 299 'tag', 298 300 'tag__and', 301 299 302 'tag__in', 300 303 'tag__not_in', 301 'tag_id',302 304 'tag_slug__and', 303 305 'tag_slug__in', … … 310 312 'withoutcomments', 311 313 'year', 312 'lang',313 // 'comments',314 // 'blog',315 // 'files'316 314 ); 317 315
Note: See TracChangeset
for help on using the changeset viewer.