Ticket #25376: 25376-sanitize.2.diff
File 25376-sanitize.2.diff, 4.5 KB (added by , 11 years ago) |
---|
-
src/wp-includes/post.php
2011 2011 /** 2012 2012 * Filter the value of a specific post field to edit. 2013 2013 * 2014 * The dynamic portion of the hook name, $field, refers to the prefixed 2015 * post field name. For example, 'post_title'. 2014 * The dynamic portion of the hook name, $field, refers to the post field name. 2016 2015 * 2017 2016 * @since 2.3.0 2018 2017 * … … 2025 2024 * Filter the value of a specific post field to edit. 2026 2025 * 2027 2026 * The dynamic portion of the hook name, $field_no_prefix, refers to 2028 * the post field name with no prefix. For example, 'title' instead 2029 * of 'post_title'. 2027 * the post field name. 2030 2028 * 2031 2029 * @since 2.3.0 2032 * @deprecated 2.3.0 Use "edit_post_$field" instead.2033 2030 * 2034 2031 * @param mixed $value Value of the post field. 2035 2032 * @param int $post_id Post ID. 2036 2033 */ 2037 2034 $value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id ); 2038 2035 } else { 2039 2040 /**2041 * Filter the value of a specific post field to edit.2042 *2043 * The dynamic portion of the hook name, $field, refers to the un-prefixed2044 * post field. For example, 'title' instead of 'post_title'.2045 *2046 * @since 2.3.02047 *2048 * @param mixed $value Value of the un-prefixed post field.2049 * @param int $post_id Post ID.2050 */2051 2036 $value = apply_filters( "edit_post_{$field}", $value, $post_id ); 2052 2037 } 2053 2038 … … 2063 2048 if ( $prefixed ) { 2064 2049 2065 2050 /** 2066 * Filter the value of a specific field before saving.2051 * Filter the value of a specific post field before saving. 2067 2052 * 2068 * The dynamic portion of the hook name, $field, refers to the 2069 * prefixed post field name. For example, 'post_title'. 2053 * The dynamic portion of the hook name, $field, refers to the post field name. 2070 2054 * 2071 2055 * @since 2.3.0 2072 2056 * … … 2078 2062 * Filter the value of a specific field before saving. 2079 2063 * 2080 2064 * The dynamic portion of the hook name, $field_no_prefix, refers 2081 * to the un-prefixed post field name. For example, 'title' instead 2082 * of 'post_title'. 2065 * to the post field name. 2083 2066 * 2084 2067 * @since 2.3.0 2085 * @deprecated 2.3.0 Use "pre_post_{$field}" instead.2086 2068 * 2087 2069 * @param mixed $value Value of the post field. 2088 2070 */ 2089 2071 $value = apply_filters( "{$field_no_prefix}_save_pre", $value ); 2090 2072 } else { 2091 2092 /**2093 * Filter the value of a specific field before saving.2094 *2095 * The dynamic portion of the hook name, $field, refers to the un-prefixed2096 * post field name. For example, 'title' instead of 'post_title'.2097 *2098 * @since 2.3.02099 *2100 * @param mixed $value Value of the post field.2101 */2102 2073 $value = apply_filters( "pre_post_{$field}", $value ); 2103 2074 2104 2075 /** 2105 * Filter the value of a specific field before saving.2076 * Filter the value of a specific post field before saving. 2106 2077 * 2107 * The dynamic portion of the hook name, $field, refers to the un-prefixed 2108 * post field name. For example, 'title' instead of 'post_title'. 2078 * The dynamic portion of the hook name, $field, refers to the post field name. 2109 2079 * 2110 2080 * @since 2.3.0 2111 * @deprecated 2.3.0 Use "pre_post_{$field}" instead.2112 2081 * 2113 2082 * @param mixed $value Value of the post field. 2114 2083 */ … … 2122 2091 /** 2123 2092 * Filter the value of a specific post field for display. 2124 2093 * 2125 * The dynamic hook name, $field, refers to the prefixed post field 2126 * name. For example, 'post_title'. 2094 * The dynamic portion of the hook name, $field, refers to the post field name. 2127 2095 * 2128 * @since 2096 * @since 2.3.0 2129 2097 * 2130 2098 * @param mixed $value Value of the prefixed post field. 2131 2099 * @param int $post_id Post ID. … … 2135 2103 */ 2136 2104 $value = apply_filters( $field, $value, $post_id, $context ); 2137 2105 } else { 2138 2139 /**2140 * Filter the value of a specific post field for display.2141 *2142 * The dynamic portion of the hook name, $field, refers to the un-prefixed2143 * post field name. For example, 'title' instead of 'post_title'.'2144 *2145 * @since2146 *2147 * @param mixed $value Value of the un-prefixed post field.2148 * @param int $post_id Post ID.2149 * @param string $context Context for how to sanitize the field. Possible2150 * values include 'raw', 'edit', 'db', 'display',2151 * 'attribute' and 'js'.2152 */2153 2106 $value = apply_filters( "post_{$field}", $value, $post_id, $context ); 2154 2107 } 2155 2108 }