HEX
Server: Apache/2.4.37 (CentOS Stream) OpenSSL/1.1.1k
System: Linux ysnet.com.tw 4.18.0-553.5.1.el8.x86_64 #1 SMP Tue May 21 05:46:01 UTC 2024 x86_64
User: test (521)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /var/www/test/wp-content/plugins/jetpack/src/class-jetpack-script-data.php
<?php
/**
 * Jetpack_Script_Data.
 *
 * Adds Jetpack-plugin-specific data to the consolidated JetpackScriptData object.
 *
 * @package automattic/jetpack
 */

namespace Automattic\Jetpack\Plugin;

/**
 * Jetpack_Script_Data class.
 */
class Jetpack_Script_Data {

	/**
	 * Configure script data.
	 */
	public static function configure() {
		add_filter( 'jetpack_admin_js_script_data', array( __CLASS__, 'set_admin_script_data' ), 10, 1 );
	}

	/**
	 * Add Jetpack-plugin-specific data to the consolidated JetpackScriptData object.
	 *
	 * @since 15.6
	 *
	 * @param array $data The script data.
	 * @return array
	 */
	public static function set_admin_script_data( $data ) {
		/**
		 * Whether to show the Jetpack branding in editor panels (e.g., SEO, AI Assistant).
		 *
		 * @since 15.6
		 *
		 * @param bool $show Whether to show the Jetpack editor panel branding. Defaults to true.
		 */
		$data['jetpack'] = array(
			'flags' => array(
				'showJetpackBranding' => (bool) apply_filters( 'jetpack_show_editor_panel_branding', true ),
			),
		);

		return $data;
	}
}