From 2238c7fb7f0fca16583cb924d501e55f526ec8cd Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 8 Feb 2014 00:43:16 +0000 Subject: [PATCH] Add a filter `wp_insert_attachment_data` in `wp_insert_attachment()`. This is similar to the `wp_insert_post_data` filter in `wp_insert_post()`. Fixes #20547. git-svn-id: https://develop.svn.wordpress.org/trunk@27130 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index f6f10f197c..1ad8393c6f 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -4093,6 +4093,7 @@ function wp_insert_attachment($object, $file = false, $parent = 0) { // expected_slashed (everything!) $data = compact( array( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'guid' ) ); + $data = apply_filters( 'wp_insert_attachment_data', $data, $object ); $data = wp_unslash( $data ); if ( $update ) {