diff --git a/includes/Admin/Admin.php b/includes/Admin/Admin.php index 459a1406b799..586c1ed5a5ba 100644 --- a/includes/Admin/Admin.php +++ b/includes/Admin/Admin.php @@ -128,10 +128,14 @@ public function admin_body_class( $class ) { * @since 1.0.0 * * @param string|mixed $content Default post content. - * @param WP_Post $post Post object. + * @param WP_Post|null $post Post object. * @return string|mixed Pre-filled post content if applicable, or the default content otherwise. */ - public function prefill_post_content( $content, WP_Post $post ) { + public function prefill_post_content( $content, ?WP_Post $post ) { + if ( ! $post ) { + return $content; + } + if ( ! isset( $_GET['from-web-story'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended return $content; }