Changeset 55021 for trunk/src/wp-includes/post.php
- Timestamp:
- 12/30/2022 02:36:03 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r54961 r55021 6328 6328 * @param string|array $args Arguments for inserting an attachment. 6329 6329 * @param string|false $file Optional. Filename. 6330 * @param int $parent_post 6330 * @param int $parent_post_id Optional. Parent post ID. 6331 6331 * @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false. 6332 6332 * @param bool $fire_after_hooks Optional. Whether to fire the after insert hooks. Default true. 6333 6333 * @return int|WP_Error The attachment ID on success. The value 0 or WP_Error on failure. 6334 6334 */ 6335 function wp_insert_attachment( $args, $file = false, $parent_post = 0, $wp_error = false, $fire_after_hooks = true ) {6335 function wp_insert_attachment( $args, $file = false, $parent_post_id = 0, $wp_error = false, $fire_after_hooks = true ) { 6336 6336 $defaults = array( 6337 6337 'file' => $file, … … 6341 6341 $data = wp_parse_args( $args, $defaults ); 6342 6342 6343 if ( ! empty( $parent_post ) ) {6344 $data['post_parent'] = $parent_post ;6343 if ( ! empty( $parent_post_id ) ) { 6344 $data['post_parent'] = $parent_post_id; 6345 6345 } 6346 6346
Note: See TracChangeset
for help on using the changeset viewer.