diff --git a/duplicate-post-admin.php b/duplicate-post-admin.php index eb833bbff..8946c358a 100644 --- a/duplicate-post-admin.php +++ b/duplicate-post-admin.php @@ -211,10 +211,9 @@ function duplicate_post_show_update_notice() { } $current_screen = get_current_screen(); - if ( - empty( $current_screen ) || - empty( $current_screen->base ) || - ( $current_screen->base !== 'dashboard' && $current_screen->base !== 'plugins' ) + if ( empty( $current_screen ) + || empty( $current_screen->base ) + || ( $current_screen->base !== 'dashboard' && $current_screen->base !== 'plugins' ) ) { return; } @@ -629,8 +628,8 @@ function duplicate_post_create_duplicate( $post, $status = '', $parent_id = '' ) if ( ! duplicate_post_is_post_type_enabled( $post->post_type ) && $post->post_type !== 'attachment' ) { wp_die( esc_html( - __( 'Copy features for this post type are not enabled in options page', 'duplicate-post' ) . ': ' . - $post->post_type + __( 'Copy features for this post type are not enabled in options page', 'duplicate-post' ) . ': ' + . $post->post_type ) ); } diff --git a/src/handlers/class-check-changes-handler.php b/src/handlers/class-check-changes-handler.php index 3f976f649..ebfc32e5d 100644 --- a/src/handlers/class-check-changes-handler.php +++ b/src/handlers/class-check-changes-handler.php @@ -63,8 +63,8 @@ public function register_hooks() { public function check_changes_action_handler() { global $wp_version; - if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || // Input var okay. - ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_check_changes' ) ) ) { // Input var okay. + if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) // Input var okay. + || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_check_changes' ) ) ) { // Input var okay. \wp_die( \esc_html__( 'No post has been supplied!', 'duplicate-post' ) ); diff --git a/src/handlers/class-link-handler.php b/src/handlers/class-link-handler.php index 22f8babea..a2d3b67ce 100644 --- a/src/handlers/class-link-handler.php +++ b/src/handlers/class-link-handler.php @@ -62,8 +62,8 @@ public function new_draft_link_action_handler() { \wp_die( \esc_html__( 'Current user is not allowed to copy posts.', 'duplicate-post' ) ); } - if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || // Input var okay. - ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_new_draft' ) ) ) { // Input var okay. + if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) // Input var okay. + || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_new_draft' ) ) ) { // Input var okay. \wp_die( \esc_html__( 'No post to duplicate has been supplied!', 'duplicate-post' ) ); } @@ -118,8 +118,8 @@ public function clone_link_action_handler() { \wp_die( \esc_html__( 'Current user is not allowed to copy posts.', 'duplicate-post' ) ); } - if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || // Input var okay. - ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_clone' ) ) ) { // Input var okay. + if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) // Input var okay. + || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_clone' ) ) ) { // Input var okay. \wp_die( \esc_html__( 'No post to duplicate has been supplied!', 'duplicate-post' ) ); } @@ -192,8 +192,8 @@ public function rewrite_link_action_handler() { \wp_die( \esc_html__( 'Current user is not allowed to copy posts.', 'duplicate-post' ) ); } - if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || // Input var okay. - ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_rewrite' ) ) ) { // Input var okay. + if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) // Input var okay. + || ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] === 'duplicate_post_rewrite' ) ) ) { // Input var okay. \wp_die( \esc_html__( 'No post to duplicate has been supplied!', 'duplicate-post' ) ); } diff --git a/src/ui/class-row-actions.php b/src/ui/class-row-actions.php index ef77738ee..c3e7e5155 100644 --- a/src/ui/class-row-actions.php +++ b/src/ui/class-row-actions.php @@ -84,12 +84,12 @@ public function add_clone_action_link( $actions, $post ) { $title = \_draft_or_post_title( $post ); - $actions['clone'] = 'link_builder->build_clone_link( $post->ID ) + . '" aria-label="' . \esc_attr( /* translators: %s: Post title. */ \sprintf( \__( 'Clone “%s”', 'duplicate-post' ), $title ) - ) . '">' . - \esc_html_x( 'Clone', 'verb', 'duplicate-post' ) . ''; + ) . '">' + . \esc_html_x( 'Clone', 'verb', 'duplicate-post' ) . ''; return $actions; } @@ -111,13 +111,13 @@ public function add_new_draft_action_link( $actions, $post ) { $title = \_draft_or_post_title( $post ); - $actions['edit_as_new_draft'] = 'link_builder->build_new_draft_link( $post->ID ) + . '" aria-label="' . \esc_attr( /* translators: %s: Post title. */ \sprintf( \__( 'New draft of “%s”', 'duplicate-post' ), $title ) - ) . '">' . - \esc_html__( 'New Draft', 'duplicate-post' ) . - ''; + ) . '">' + . \esc_html__( 'New Draft', 'duplicate-post' ) + . ''; return $actions; } @@ -142,12 +142,12 @@ public function add_rewrite_and_republish_action_link( $actions, $post ) { $title = \_draft_or_post_title( $post ); - $actions['rewrite'] = 'link_builder->build_rewrite_and_republish_link( $post->ID ) + . '" aria-label="' . \esc_attr( /* translators: %s: Post title. */ \sprintf( \__( 'Rewrite & Republish “%s”', 'duplicate-post' ), $title ) - ) . '">' . - \esc_html_x( 'Rewrite & Republish', 'verb', 'duplicate-post' ) . ''; + ) . '">' + . \esc_html_x( 'Rewrite & Republish', 'verb', 'duplicate-post' ) . ''; return $actions; } diff --git a/src/watchers/class-bulk-actions-watcher.php b/src/watchers/class-bulk-actions-watcher.php index c6e708716..4d65c9b32 100644 --- a/src/watchers/class-bulk-actions-watcher.php +++ b/src/watchers/class-bulk-actions-watcher.php @@ -54,8 +54,8 @@ public function add_bulk_clone_admin_notice() { if ( ! empty( $_REQUEST['bulk_cloned'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification $copied_posts = \intval( $_REQUEST['bulk_cloned'] ); // phpcs:ignore WordPress.Security.NonceVerification \printf( - '
' . - \esc_html( + '
' + . \esc_html( /* translators: %s: Number of posts copied. */ \_n( '%s item copied.', @@ -78,8 +78,8 @@ public function add_bulk_rewrite_and_republish_admin_notice() { if ( ! empty( $_REQUEST['bulk_rewriting'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification $copied_posts = \intval( $_REQUEST['bulk_rewriting'] ); // phpcs:ignore WordPress.Security.NonceVerification \printf( - '
' . - \esc_html( + '
' + . \esc_html( /* translators: %s: Number of posts copied. */ \_n( '%s post duplicated. You can now start rewriting your post in the duplicate of the original post. Once you choose to republish it your changes will be merged back into the original post.', diff --git a/src/watchers/class-copied-post-watcher.php b/src/watchers/class-copied-post-watcher.php index 2c7a54083..93c15aa85 100644 --- a/src/watchers/class-copied-post-watcher.php +++ b/src/watchers/class-copied-post-watcher.php @@ -93,9 +93,9 @@ public function add_admin_notice() { } if ( $this->permissions_helper->has_rewrite_and_republish_copy( $post ) ) { - print '
' . - \esc_html( $this->get_notice_text( $post ) ) . - '
' + . \esc_html( $this->get_notice_text( $post ) ) + . '
' . - \esc_html( + '
' + . \esc_html( /* translators: %s: Number of posts copied. */ \_n( '%s item copied.', @@ -98,11 +98,11 @@ public function add_rewrite_and_republish_admin_notice() { return; } - print '
' . - \esc_html__( - 'You can now start rewriting your post in this duplicate of the original post. If you click "Republish", your changes will be merged into the original post and you’ll be redirected there.', - 'duplicate-post' - ) . '
' + . \esc_html__( + 'You can now start rewriting your post in this duplicate of the original post. If you click "Republish", your changes will be merged into the original post and you’ll be redirected there.', + 'duplicate-post' + ) . '
' . - \esc_html( $this->get_notice_text() ) . - '
' + . \esc_html( $this->get_notice_text() ) + . '
' . - \esc_html( $this->get_notice_text() ) . - '
' + . \esc_html( $this->get_notice_text() ) + . '