Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_insert_attachment_data

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
3998            *
3999            * @since 3.9.0
4000            * @since 5.4.1 `$unsanitized_postarr` argument added.
4001            *
4002            * @param array $data                An array of slashed, sanitized, and processed attachment post data.
4003            * @param array $postarr             An array of slashed and sanitized attachment post data, but not processed.
4004            * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed attachment post data
4005            *                                   as originally passed to wp_insert_post().
4006            */
4007           $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_postarr );
4008      } else {
4009           /**
4010            * Filters slashed post data just before it is inserted into the database.
4011            *
4012            * @since 2.7.0
4013            * @since 5.4.1 `$unsanitized_postarr` argument added.
4014            *
4015            * @param array $data                An array of slashed, sanitized, and processed post data.
4016            * @param array $postarr             An array of sanitized (and slashed) but otherwise unmodified post data.