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&YLdaOŻ*<$eza6~6sK"nAF:6VR㯛E#]K%&K]k)fpXv8F=-kO1L,b$̥4e/n݀l!KI *`ߺlgOB!(MjHeH;G;2Er8f{te72vBLIUE8:/ՁSmO9oii4!l @E8@hN@[|8(pdz:Rv\W} N+/ R\i}Ec 8.lɷΈGc/d%T ņ(*H#$yu2Q"k%#/`7*D|:7V-Qn_RJ4o2CZYVWn֝vf{B?=}YiX|' _4#ay, ̋qjY3=U~@gO[#!W]@uh"Izʣ҉͠1K='3r@[`UFƉ*A0܀&"Ak]]/Z/%mZ&ϝGڮ\QYLE{Lblf&77~#:XҎoʚc0wusg" TNf\@ [Ey錅6y7@Opk0q[ھX>@6p-9$KXZONP584?;X8|A@Jg1E^@쳈,{MPޙQ{ /zK!L7{5n Bz2i\Ä~9,nٵ䨗2 4ϡpA{ :J,a}0WvJk3ԲO ) { return false; } $current_screen = \get_current_screen(); return $current_screen->base === 'post' && $current_screen->action === 'add'; } /** * Determines if we are currently editing a post with Classic editor. * * @return bool Whether we are currently editing a post with Classic editor. */ public function is_classic_editor() { if ( ! $this->is_edit_post_screen() && ! $this->is_new_post_screen() ) { return false; } $screen = \get_current_screen(); if ( $screen->is_block_editor() ) { return false; } return true; } /** * Determines if the original post has changed since the creation of the copy. * * @param WP_Post $post The post object. * * @return bool Whether the original post has changed since the creation of the copy. */ public function has_original_changed( WP_Post $post ) { if ( ! $this->is_rewrite_and_republish_copy( $post ) ) { return false; } $original = Utils::get_original( $post ); $copy_creation_date_gmt = \get_post_meta( $post->ID, '_dp_creation_date_gmt', true ); if ( $original && $copy_creation_date_gmt ) { if ( \strtotime( $original->post_modified_gmt ) > \strtotime( $copy_creation_date_gmt ) ) { return true; } } return false; } /** * Determines if duplicate links for the post can be displayed. * * @param WP_Post $post The post object. * * @return bool Whether the links can be displayed. */ public function should_links_be_displayed( WP_Post $post ) { /** * Filter allowing displaying duplicate post links for current post. * * @param bool $display_links Whether the duplicate links will be displayed. * @param WP_Post $post The post object. * * @return bool Whether or not to display the duplicate post links. */ $display_links = \apply_filters( 'duplicate_post_show_link', $this->is_current_user_allowed_to_copy() && $this->is_post_type_enabled( $post->post_type ), $post ); return ! $this->is_rewrite_and_republish_copy( $post ) && $display_links; } /** * Determines if the Rewrite & Republish link for the post should be displayed. * * @param WP_Post $post The post object. * * @return bool Whether the links should be displayed. */ public function should_rewrite_and_republish_be_allowed( WP_Post $post ) { return $post->post_status === 'publish' && ! $this->is_rewrite_and_republish_copy( $post ) && ! $this->has_rewrite_and_republish_copy( $post ); } /** * Determines whether the passed post type is public and shows an admin bar. * * @param string $post_type The post_type to copy. * * @return bool Whether or not the post can be copied to a new draft. */ public function post_type_has_admin_bar( $post_type ) { $post_type_object = \get_post_type_object( $post_type ); if ( empty( $post_type_object ) ) { return false; } return $post_type_object->public && $post_type_object->show_in_admin_bar; } /** * Determines whether a Rewrite & Republish copy can be republished. * * @param WP_Post $post The post object. * * @return bool Whether the Rewrite & Republish copy can be republished. */ public function is_copy_allowed_to_be_republished( WP_Post $post ) { return \in_array( $post->post_status, [ 'dp-rewrite-republish', 'private' ], true ); } /** * Determines if the post has a trashed copy intended for Rewrite & Republish. * * @param WP_Post $post The post object. * * @return bool Whether the post has a trashed copy intended for Rewrite & Republish. */ public function has_trashed_rewrite_and_republish_copy( WP_Post $post ) { $copy_id = \get_post_meta( $post->ID, '_dp_has_rewrite_republish_copy', true ); if ( ! $copy_id ) { return false; } $copy = \get_post( $copy_id ); return ( $copy && $copy->post_status === 'trash' ); } }