| @@ 45-48 (lines=4) @@ | ||
| 42 | ); |
|
| 43 | ||
| 44 | // Enqueue admin scrips and styles, only in the customizer or the old widgets page. |
|
| 45 | if ( is_customize_preview() || 'widgets.php' === $pagenow ) { |
|
| 46 | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) ); |
|
| 47 | add_action( 'admin_print_footer_scripts', array( $this, 'render_admin_js' ) ); |
|
| 48 | } |
|
| 49 | ||
| 50 | // Enqueue scripts and styles for the display of the widget, on the frontend or in the customizer. |
|
| 51 | if ( is_active_widget( false, $this->id, $this->id_base, true ) || is_customize_preview() ) { |
|
| @@ 43-47 (lines=5) @@ | ||
| 40 | ); |
|
| 41 | $this->alt_option_name = 'widget_contact_info'; |
|
| 42 | ||
| 43 | if ( is_customize_preview() ) { |
|
| 44 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
| 45 | } elseif ( 'widgets.php' === $pagenow ) { |
|
| 46 | add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); |
|
| 47 | } |
|
| 48 | ||
| 49 | add_action( 'wp_ajax_customize-contact-info-api-key', array( $this, 'ajax_check_api_key' ) ); |
|
| 50 | } |
|