403Webshell
Server IP : 195.130.67.5  /  Your IP : 216.73.217.154
Web Server : Microsoft-IIS/10.0
System : Windows NT WEBSERVER1 10.0 build 17763 (Windows Server 2016) i586
User : IUSR ( 0)
PHP Version : 7.4.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/inetpub/wwwroot/stirizo/wp-content/plugins/duplicate-post/src/watchers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/inetpub/wwwroot/stirizo/wp-content/plugins/duplicate-post/src/watchers/bulk-actions-watcher.php
<?php

namespace Yoast\WP\Duplicate_Post\Watchers;

/**
 * Duplicate Post class to watch for the bulk actions and show notices.
 */
class Bulk_Actions_Watcher {

	/**
	 * Initializes the class.
	 */
	public function __construct() {
		$this->register_hooks();
	}

	/**
	 * Adds hooks to integrate with WordPress.
	 *
	 * @return void
	 */
	public function register_hooks() {
		\add_filter( 'removable_query_args', [ $this, 'add_removable_query_args' ] );
		\add_action( 'admin_notices', [ $this, 'add_bulk_clone_admin_notice' ] );
		\add_action( 'admin_notices', [ $this, 'add_bulk_rewrite_and_republish_admin_notice' ] );
	}

	/**
	 * Adds vars to the removable query args.
	 *
	 * @param array $removable_query_args Array of query args keys.
	 *
	 * @return array The updated array of query args keys.
	 */
	public function add_removable_query_args( $removable_query_args ) {
		if ( \is_array( $removable_query_args ) ) {
			$removable_query_args[] = 'bulk_cloned';
			$removable_query_args[] = 'bulk_cloned_skipped';
			$removable_query_args[] = 'bulk_rewriting';
			$removable_query_args[] = 'bulk_rewriting_skipped';
		}
		return $removable_query_args;
	}

	/**
	 * Shows a notice after the Clone bulk action has succeeded.
	 *
	 * @return void
	 */
	public function add_bulk_clone_admin_notice() {
		if ( ! empty( $_REQUEST['bulk_cloned'] ) ) {
			$copied_posts = \intval( $_REQUEST['bulk_cloned'] );
			\printf(
				'<div id="message" class="notice notice-success fade"><p>'
				. \esc_html(
					/* translators: %s: Number of posts copied. */
					\_n(
						'%s item copied.',
						'%s items copied.',
						$copied_posts,
						'duplicate-post',
					),
				) . '</p></div>',
				\esc_html( $copied_posts ),
			);
		}
		if ( ! empty( $_REQUEST['bulk_cloned_skipped'] ) ) {
			$skipped_posts = \intval( $_REQUEST['bulk_cloned_skipped'] );
			\printf(
				'<div id="message" class="notice notice-warning fade"><p>'
				. \esc_html(
					/* translators: %s: Number of posts skipped. */
					\_n(
						'%s item skipped due to insufficient permissions.',
						'%s items skipped due to insufficient permissions.',
						$skipped_posts,
						'duplicate-post',
					),
				) . '</p></div>',
				\esc_html( $skipped_posts ),
			);
		}
	}

	/**
	 * Shows a notice after the Rewrite & Republish bulk action has succeeded.
	 *
	 * @return void
	 */
	public function add_bulk_rewrite_and_republish_admin_notice() {
		if ( ! empty( $_REQUEST['bulk_rewriting'] ) ) {
			$copied_posts = \intval( $_REQUEST['bulk_rewriting'] );
			\printf(
				'<div id="message" class="notice notice-success fade"><p>'
				. \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.',
						'%s posts duplicated. You can now start rewriting your posts in the duplicates of the original posts. Once you choose to republish them your changes will be merged back into the original post.',
						$copied_posts,
						'duplicate-post',
					),
				) . '</p></div>',
				\esc_html( $copied_posts ),
			);
		}
		if ( ! empty( $_REQUEST['bulk_rewriting_skipped'] ) ) {
			$skipped_posts = \intval( $_REQUEST['bulk_rewriting_skipped'] );
			\printf(
				'<div id="message" class="notice notice-warning fade"><p>'
				. \esc_html(
					/* translators: %s: Number of posts skipped. */
					\_n(
						'%s item skipped due to insufficient permissions.',
						'%s items skipped due to insufficient permissions.',
						$skipped_posts,
						'duplicate-post',
					),
				) . '</p></div>',
				\esc_html( $skipped_posts ),
			);
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit