Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/post-duplicator.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* Creates a copy of a post object, accordingly to an options array.
*
* @param WP_Post $post The original post object.
* @param array $options The options overriding the default ones.

Check failure on line 51 in src/post-duplicator.php

View workflow job for this annotation

GitHub Actions / Check code style

@param annotation of method \Yoast\WP\Duplicate_Post\Post_Duplicator::create_duplicate() does not specify type hint for items of its traversable parameter $options.
*
* @return int|WP_Error The copy ID, or a WP_Error object on failure.
*/
Expand Down Expand Up @@ -130,9 +130,9 @@
* This is needed for the Block editor when a post is copied with its date,
* so that the current publish date is shown instead of "Immediately".
*
* @param array $data The array of post data.

Check failure on line 133 in src/post-duplicator.php

View workflow job for this annotation

GitHub Actions / Check code style

@param annotation of method \Yoast\WP\Duplicate_Post\Post_Duplicator::set_modified() does not specify type hint for items of its traversable parameter $data.
*
* @return array The updated array of post data.

Check failure on line 135 in src/post-duplicator.php

View workflow job for this annotation

GitHub Actions / Check code style

@return annotation of method \Yoast\WP\Duplicate_Post\Post_Duplicator::set_modified() does not specify type hint for items of its traversable return value.
*/
public function set_modified( $data ) {
$data['post_modified'] = \current_time( 'mysql' );
Expand Down Expand Up @@ -173,6 +173,8 @@
\update_post_meta( $new_post_id, '_dp_creation_date_gmt', \current_time( 'mysql', 1 ) );
}

wp_save_post_revision( $new_post_id );

Check failure on line 176 in src/post-duplicator.php

View workflow job for this annotation

GitHub Actions / Check code style

Function wp_save_post_revision() should be referenced via a fully qualified name.

return $new_post_id;
}

Expand All @@ -181,7 +183,7 @@
*
* @param int $new_id New post ID.
* @param WP_Post $post The original post object.
* @param array $options The options array.

Check failure on line 186 in src/post-duplicator.php

View workflow job for this annotation

GitHub Actions / Check code style

@param annotation of method \Yoast\WP\Duplicate_Post\Post_Duplicator::copy_post_taxonomies() does not specify type hint for items of its traversable parameter $options.
*
* @return void
*/
Expand Down
Loading