@@ 2004-2045 (lines=42) @@ | ||
2001 | } else { |
|
2002 | $value = esc_attr($value); |
|
2003 | } |
|
2004 | } elseif ( 'db' == $context ) { |
|
2005 | if ( $prefixed ) { |
|
2006 | ||
2007 | /** |
|
2008 | * Filters the value of a specific post field before saving. |
|
2009 | * |
|
2010 | * The dynamic portion of the hook name, `$field`, refers to the post |
|
2011 | * field name. |
|
2012 | * |
|
2013 | * @since 2.3.0 |
|
2014 | * |
|
2015 | * @param mixed $value Value of the post field. |
|
2016 | */ |
|
2017 | $value = apply_filters( "pre_{$field}", $value ); |
|
2018 | ||
2019 | /** |
|
2020 | * Filters the value of a specific field before saving. |
|
2021 | * |
|
2022 | * The dynamic portion of the hook name, `$field_no_prefix`, refers |
|
2023 | * to the post field name. |
|
2024 | * |
|
2025 | * @since 2.3.0 |
|
2026 | * |
|
2027 | * @param mixed $value Value of the post field. |
|
2028 | */ |
|
2029 | $value = apply_filters( "{$field_no_prefix}_save_pre", $value ); |
|
2030 | } else { |
|
2031 | $value = apply_filters( "pre_post_{$field}", $value ); |
|
2032 | ||
2033 | /** |
|
2034 | * Filters the value of a specific post field before saving. |
|
2035 | * |
|
2036 | * The dynamic portion of the hook name, `$field`, refers to the post |
|
2037 | * field name. |
|
2038 | * |
|
2039 | * @since 2.3.0 |
|
2040 | * |
|
2041 | * @param mixed $value Value of the post field. |
|
2042 | */ |
|
2043 | $value = apply_filters( "{$field}_pre", $value ); |
|
2044 | } |
|
2045 | } else { |
|
2046 | ||
2047 | // Use display filters by default. |
|
2048 | if ( $prefixed ) { |
@@ 1464-1504 (lines=41) @@ | ||
1461 | $value = esc_html($value); // textarea_escaped |
|
1462 | else |
|
1463 | $value = esc_attr($value); |
|
1464 | } elseif ( 'db' == $context ) { |
|
1465 | ||
1466 | /** |
|
1467 | * Filters a term field value before it is sanitized. |
|
1468 | * |
|
1469 | * The dynamic portion of the filter name, `$field`, refers to the term field. |
|
1470 | * |
|
1471 | * @since 2.3.0 |
|
1472 | * |
|
1473 | * @param mixed $value Value of the term field. |
|
1474 | * @param string $taxonomy Taxonomy slug. |
|
1475 | */ |
|
1476 | $value = apply_filters( "pre_term_{$field}", $value, $taxonomy ); |
|
1477 | ||
1478 | /** |
|
1479 | * Filters a taxonomy field before it is sanitized. |
|
1480 | * |
|
1481 | * The dynamic portions of the filter name, `$taxonomy` and `$field`, refer |
|
1482 | * to the taxonomy slug and field name, respectively. |
|
1483 | * |
|
1484 | * @since 2.3.0 |
|
1485 | * |
|
1486 | * @param mixed $value Value of the taxonomy field. |
|
1487 | */ |
|
1488 | $value = apply_filters( "pre_{$taxonomy}_{$field}", $value ); |
|
1489 | ||
1490 | // Back compat filters |
|
1491 | if ( 'slug' == $field ) { |
|
1492 | /** |
|
1493 | * Filters the category nicename before it is sanitized. |
|
1494 | * |
|
1495 | * Use the {@see 'pre_$taxonomy_$field'} hook instead. |
|
1496 | * |
|
1497 | * @since 2.0.3 |
|
1498 | * |
|
1499 | * @param string $value The category nicename. |
|
1500 | */ |
|
1501 | $value = apply_filters( 'pre_category_nicename', $value ); |
|
1502 | } |
|
1503 | ||
1504 | } elseif ( 'rss' == $context ) { |
|
1505 | ||
1506 | /** |
|
1507 | * Filters the term field for use in RSS. |