[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: asset-manager.php
<?php namespace Yoast\WP\Duplicate_Post\UI; use Yoast\WP\Duplicate_Post\Utils; /** * Duplicate Post class to manage assets. */ class Asset_Manager { /** * Adds hooks to integrate with WordPress. * * @return void */ public function register_hooks() { \add_action( 'init', [ $this, 'register_styles' ] ); \add_action( 'init', [ $this, 'register_scripts' ] ); } /** * Registers the styles. * * @return void */ public function register_styles() { \wp_register_style( 'duplicate-post', \plugins_url( '/css/duplicate-post.css', \DUPLICATE_POST_FILE ), [], \DUPLICATE_POST_CURRENT_VERSION ); \wp_register_style( 'duplicate-post-options', \plugins_url( '/css/duplicate-post-options.css', \DUPLICATE_POST_FILE ), [], \DUPLICATE_POST_CURRENT_VERSION ); } /** * Registers the scripts. * * @return void */ public function register_scripts() { $flattened_version = Utils::flatten_version( \DUPLICATE_POST_CURRENT_VERSION ); \wp_register_script( 'duplicate_post_edit_script', \plugins_url( \sprintf( 'js/dist/duplicate-post-edit-%s.js', $flattened_version ), \DUPLICATE_POST_FILE ), [ 'wp-components', 'wp-element', 'wp-i18n', ], \DUPLICATE_POST_CURRENT_VERSION, true ); \wp_register_script( 'duplicate_post_strings', \plugins_url( \sprintf( 'js/dist/duplicate-post-strings-%s.js', $flattened_version ), \DUPLICATE_POST_FILE ), [ 'wp-components', 'wp-element', 'wp-i18n', ], \DUPLICATE_POST_CURRENT_VERSION, true ); \wp_register_script( 'duplicate_post_quick_edit_script', \plugins_url( \sprintf( 'js/dist/duplicate-post-quick-edit-%s.js', $flattened_version ), \DUPLICATE_POST_FILE ), [ 'jquery' ], \DUPLICATE_POST_CURRENT_VERSION, true ); \wp_register_script( 'duplicate_post_options_script', \plugins_url( \sprintf( 'js/dist/duplicate-post-options-%s.js', $flattened_version ), \DUPLICATE_POST_FILE ), [ 'jquery' ], \DUPLICATE_POST_CURRENT_VERSION, true ); } /** * Enqueues the styles. * * @return void */ public function enqueue_styles() { \wp_enqueue_style( 'duplicate-post' ); } /** * Enqueues the styles for the options page. * * @return void */ public function enqueue_options_styles() { \wp_enqueue_style( 'duplicate-post-options' ); } /** * Enqueues the script for the Block editor and passes object via localization. * * @param array $data_object The object to pass to the script. * * @return void */ public function enqueue_edit_script( $data_object = [] ) { $handle = 'duplicate_post_edit_script'; \wp_enqueue_script( $handle ); \wp_add_inline_script( $handle, 'let duplicatePostNotices = {};', 'before' ); \wp_localize_script( $handle, 'duplicatePost', $data_object ); } /** * Enqueues the script for the Javascript strings and passes object via localization. * * @param array $data_object The object to pass to the script. * * @return void */ public function enqueue_strings_script( $data_object = [] ) { $handle = 'duplicate_post_strings'; \wp_enqueue_script( $handle ); \wp_localize_script( $handle, 'duplicatePostStrings', $data_object ); } /** * Enqueues the script for the Quick Edit. * * @return void */ public function enqueue_quick_edit_script() { \wp_enqueue_script( 'duplicate_post_quick_edit_script' ); } /** * Enqueues the script for the Options page. * * @return void */ public function enqueue_options_script() { \wp_enqueue_script( 'duplicate_post_options_script' ); } /** * Enqueues the script for the Elementor plugin. * * @param array $data_object The object to pass to the script. * * @return void */ public function enqueue_elementor_script( $data_object = [] ) { $flattened_version = Utils::flatten_version( \DUPLICATE_POST_CURRENT_VERSION ); $handle = 'duplicate_post_elementor_script'; \wp_register_script( $handle, \plugins_url( \sprintf( 'js/dist/duplicate-post-elementor-%s.js', $flattened_version ), \DUPLICATE_POST_FILE ), [ 'jquery' ], \DUPLICATE_POST_CURRENT_VERSION, true ); \wp_enqueue_script( $handle ); \wp_localize_script( $handle, 'duplicatePost', $data_object ); } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002