acf_field_color_picker::input_admin_enqueue_scripts()
input_admin_enqueue_scripts
description
Метод класса: acf_field_color_picker{}
Хуков нет.
Возвращает
$post_id
. (int)
Использование
$acf_field_color_picker = new acf_field_color_picker(); $acf_field_color_picker->input_admin_enqueue_scripts();
Список изменений
С версии 5.3.2 | Введена. |
Код acf_field_color_picker::input_admin_enqueue_scripts() acf field color picker::input admin enqueue scripts ACF 6.0.4
function input_admin_enqueue_scripts() { // Register scripts for non-admin. // Applies logic from wp_default_scripts() function defined in "wp-includes/script-loader.php". if ( ! is_admin() ) { $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; $scripts = wp_scripts(); $scripts->add( 'iris', '/wp-admin/js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), '1.0.7', 1 ); $scripts->add( 'wp-color-picker', "/wp-admin/js/color-picker$suffix.js", array( 'iris' ), false, 1 ); // Handle localisation across multiple WP versions. // WP 5.0+ if ( method_exists( $scripts, 'set_translations' ) ) { $scripts->set_translations( 'wp-color-picker' ); // WP 4.9 } else { $scripts->localize( 'wp-color-picker', 'wpColorPickerL10n', array( 'clear' => __( 'Clear', 'acf' ), 'clearAriaLabel' => __( 'Clear color', 'acf' ), 'defaultString' => __( 'Default', 'acf' ), 'defaultAriaLabel' => __( 'Select default color', 'acf' ), 'pick' => __( 'Select Color', 'acf' ), 'defaultLabel' => __( 'Color value', 'acf' ), ) ); } } // Enqueue alpha color picker assets. wp_enqueue_script( 'acf-color-picker-alpha', acf_get_url( 'assets/inc/color-picker-alpha/wp-color-picker-alpha.js' ), array( 'jquery', 'wp-color-picker' ), '3.0.0' ); // Enqueue. wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( 'wp-color-picker' ); acf_localize_data( array( 'colorPickerL10n' => array( 'hex_string' => __( 'Hex String', 'acf' ), 'rgba_string' => __( 'RGBA String', 'acf' ), ), ) ); }