Make WordPress Core

Ticket #25376: 25376-sanitize.diff

File 25376-sanitize.diff, 4.6 KB (added by DrewAPicture, 11 years ago)
  • src/wp-includes/post.php

     
    20112011                        /**
    20122012                         * Filter the value of a specific post field to edit.
    20132013                         *
    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.
    20162015                         *
    20172016                         * @since 2.3.0
    20182017                         *
     
    20202019                         * @param int   $post_id Post ID.
    20212020                         */
    20222021                        $value = apply_filters( "edit_{$field}", $value, $post_id );
    2023 
    2024                         /**
    2025                          * Filter the value of a specific post field to edit.
    2026                          *
    2027                          * 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'.
    2030                          *
    2031                          * @since 2.3.0
    2032                          * @deprecated 2.3.0 Use "edit_post_$field" instead.
    2033                          *
    2034                          * @param mixed $value   Value of the post field.
    2035                          * @param int   $post_id Post ID.
    2036                          */
    20372022                        $value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id );
    20382023                } 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-prefixed
    2044                          * post field. For example, 'title' instead of 'post_title'.
    2045                          *
    2046                          * @since 2.3.0
    2047                          *
    2048                          * @param mixed $value   Value of the un-prefixed post field.
    2049                          * @param int   $post_id Post ID.
    2050                          */
    20512024                        $value = apply_filters( "edit_post_{$field}", $value, $post_id );
    20522025                }
    20532026
     
    20632036                if ( $prefixed ) {
    20642037
    20652038                        /**
    2066                          * Filter the value of a specific field before saving.
     2039                         * Filter the value of a specific post field before saving.
    20672040                         *
    2068                          * The dynamic portion of the hook name, $field, refers to the
    2069                          * prefixed post field name. For example, 'post_title'.
     2041                         * The dynamic portion of the hook name, $field, refers to the post field name.
    20702042                         *
    20712043                         * @since 2.3.0
    20722044                         *
    20732045                         * @param mixed $value Value of the post field.
    20742046                         */
    20752047                        $value = apply_filters( "pre_{$field}", $value );
    2076 
    2077                         /**
    2078                          * Filter the value of a specific field before saving.
    2079                          *
    2080                          * 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'.
    2083                          *
    2084                          * @since 2.3.0
    2085                          * @deprecated 2.3.0 Use "pre_post_{$field}" instead.
    2086                          *
    2087                          * @param mixed $value Value of the post field.
    2088                          */
    20892048                        $value = apply_filters( "{$field_no_prefix}_save_pre", $value );
    20902049                } 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-prefixed
    2096                          * post field name. For example, 'title' instead of 'post_title'.
    2097                          *
    2098                          * @since 2.3.0
    2099                          *
    2100                          * @param mixed $value Value of the post field.
    2101                          */
    21022050                        $value = apply_filters( "pre_post_{$field}", $value );
    2103 
    2104                         /**
    2105                          * Filter the value of a specific field before saving.
    2106                          *
    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'.
    2109                          *
    2110                          * @since 2.3.0
    2111                          * @deprecated 2.3.0 Use "pre_post_{$field}" instead.
    2112                          *
    2113                          * @param mixed $value Value of the post field.
    2114                          */
    21152051                        $value = apply_filters( "{$field}_pre", $value );
    21162052                }
    21172053        } else {
     
    21222058                        /**
    21232059                         * Filter the value of a specific post field for display.
    21242060                         *
    2125                          * The dynamic hook name, $field, refers to the prefixed post field
    2126                          * name. For example, 'post_title'.
     2061                         * The dynamic portion of the hook name, $field, refers to the post field name.
    21272062                         *
    2128                          * @since
     2063                         * @since 2.3.0
    21292064                         *
    21302065                         * @param mixed  $value   Value of the prefixed post field.
    21312066                         * @param int    $post_id Post ID.
     
    21352070                         */
    21362071                        $value = apply_filters( $field, $value, $post_id, $context );
    21372072                } 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-prefixed
    2143                          * post field name. For example, 'title' instead of 'post_title'.'
    2144                          *
    2145                          * @since
    2146                          *
    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. Possible
    2150                          *                        values include 'raw', 'edit', 'db', 'display',
    2151                          *                        'attribute' and 'js'.
    2152                          */
    21532073                        $value = apply_filters( "post_{$field}", $value, $post_id, $context );
    21542074                }
    21552075        }