IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
2386 | 2386 | * @return mixed Sanitized value. |
2387 | 2387 | */ |
2388 | 2388 | function sanitize_post_field( $field, $value, $post_id, $context = 'display' ) { |
| 2389 | |
2389 | 2390 | $int_fields = array( 'ID', 'post_parent', 'menu_order' ); |
2390 | 2391 | if ( in_array( $field, $int_fields, true ) ) { |
2391 | 2392 | $value = (int) $value; |
… |
… |
|
2398 | 2399 | return $value; |
2399 | 2400 | } |
2400 | 2401 | |
2401 | | if ( 'raw' === $context ) { |
2402 | | return $value; |
2403 | | } |
2404 | | |
2405 | 2402 | $prefixed = false; |
2406 | 2403 | if ( false !== strpos( $field, 'post_' ) ) { |
2407 | 2404 | $prefixed = true; |
2408 | 2405 | $field_no_prefix = str_replace( 'post_', '', $field ); |
2409 | 2406 | } |
2410 | 2407 | |
| 2408 | if ( 'raw' === $context ) { |
| 2409 | |
| 2410 | if( ! $prefixed ){ |
| 2411 | $field = "post_{$field}"; |
| 2412 | } |
| 2413 | |
| 2414 | /** This filter is documented in wp-includes/post.php */ |
| 2415 | $value = apply_filters( "{$field}", $value, $post_id, $context ); |
| 2416 | |
| 2417 | return $value; |
| 2418 | } |
| 2419 | |
2411 | 2420 | if ( 'edit' === $context ) { |
2412 | 2421 | $format_to_edit = array( 'post_content', 'post_excerpt', 'post_title', 'post_password' ); |
2413 | 2422 | |