Advertisement
Guest User

Untitled

a guest
Aug 12th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1. private function register_scripts() {
  2.         if ( wp_script_is( 'wp-color-picker', 'registered' ) ) {
  3.             return;
  4.         }
  5.         wp_register_script(
  6.             'iris',
  7.             admin_url( 'js/iris.min.js' ),
  8.             array(
  9.                 'jquery-ui-draggable',
  10.                 'jquery-ui-slider',
  11.                 'jquery-touch-punch',
  12.             ),
  13.             '1.0.7',
  14.             true
  15.         );
  16.         wp_register_script( 'wp-color-picker', admin_url( 'js/color-picker.min.js' ), array( 'iris' ), '', true );
  17.  
  18.         wp_localize_script(
  19.             'wp-color-picker',
  20.             'wpColorPickerL10n',
  21.             array(
  22.                 'clear'            => __( 'Clear', 'mb-frontend-submission' ),
  23.                 'clearAriaLabel'   => __( 'Clear color', 'mb-frontend-submission' ),
  24.                 'defaultString'    => __( 'Default', 'mb-frontend-submission' ),
  25.                 'defaultAriaLabel' => __( 'Select default color', 'mb-frontend-submission' ),
  26.                 'pick'             => __( 'Select Color', 'mb-frontend-submission' ),
  27.                 'defaultLabel'     => __( 'Color value', 'mb-frontend-submission' ),
  28.             )
  29.         );
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement