color_selector_item = $color_selector_item; add_action( 'admin_footer', array( $this, 'admin_print_scripts' ) ); } public function admin_print_scripts() { wp_register_style( 'wpml-color-picker', ICL_PLUGIN_URL . '/res/css/colorpicker.css', array( 'wp-color-picker' ), ICL_SITEPRESS_VERSION ); wp_register_script( 'wpml-color-picker', ICL_PLUGIN_URL . '/res/js/wpml-color-picker.js', array( 'wp-color-picker' ), ICL_SITEPRESS_VERSION ); wp_enqueue_style( 'wpml-color-picker' ); wp_enqueue_script( 'wpml-color-picker' ); } public function current_language_color_selector_control() { echo $this->get_current_language_color_selector_control(); } public function get_current_language_color_selector_control() { $args = $this->color_selector_item; $label = isset( $args['label'] ) ? $args['label'] : ''; $color_default = $args['default']; $color_value = isset( $args['value'] ) ? $args['value'] : $color_default; $input_size = isset( $args['size'] ) ? $args['size'] : 7; $input_name = $args['input_name_group'] . '[' . $args['input_name_id'] . ']'; $input_id = str_replace( array( ']', '[', '_' ), array( '', '-', '-' ), $input_name ); $input_label = ''; $input = ''; if ( $label ) { $input_label .= '
'; } else { $input_label .= ''; } $input .= ' $value ) { $input .= $key . '="' . esc_attr( $value ) . '" '; } $input .= '/>'; return $input_label . $input; } }