| @@ 4-17 (lines=14) @@ | ||
| 1 | <?php |
|
| 2 | ||
| 3 | class Jetpack_Upcoming_Events_Widget extends WP_Widget { |
|
| 4 | function __construct() { |
|
| 5 | parent::__construct( |
|
| 6 | 'upcoming_events_widget', |
|
| 7 | /** This filter is documented in modules/widgets/facebook-likebox.php */ |
|
| 8 | apply_filters( 'jetpack_widget_name', __( 'Upcoming Events', 'jetpack' ) ), |
|
| 9 | array( |
|
| 10 | 'description' => __( 'Display upcoming events from an iCalendar feed.', 'jetpack' ), |
|
| 11 | 'customize_selective_refresh' => true, |
|
| 12 | ) |
|
| 13 | ); |
|
| 14 | if ( is_active_widget( false, false, $this->id_base ) ) { |
|
| 15 | add_action( 'wp_head', array( $this, 'css' ) ); |
|
| 16 | } |
|
| 17 | } |
|
| 18 | ||
| 19 | function css() { |
|
| 20 | ?> |
|
| @@ 75-90 (lines=16) @@ | ||
| 72 | /** |
|
| 73 | * Constructor. |
|
| 74 | */ |
|
| 75 | function __construct() { |
|
| 76 | parent::__construct( |
|
| 77 | 'eu_cookie_law_widget', |
|
| 78 | /** This filter is documented in modules/widgets/facebook-likebox.php */ |
|
| 79 | apply_filters( 'jetpack_widget_name', esc_html__( 'EU Cookie Law Banner', 'jetpack' ) ), |
|
| 80 | array( |
|
| 81 | 'description' => esc_html__( 'Display a banner for compliance with the EU Cookie Law.', 'jetpack' ), |
|
| 82 | 'customize_selective_refresh' => true, |
|
| 83 | ), |
|
| 84 | array() |
|
| 85 | ); |
|
| 86 | ||
| 87 | if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { |
|
| 88 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_frontend_scripts' ) ); |
|
| 89 | } |
|
| 90 | } |
|
| 91 | ||
| 92 | /** |
|
| 93 | * Enqueue scripts and styles. |
|
| @@ 19-34 (lines=16) @@ | ||
| 16 | /** |
|
| 17 | * Constructor. |
|
| 18 | */ |
|
| 19 | function __construct() { |
|
| 20 | parent::__construct( |
|
| 21 | 'flickr', |
|
| 22 | /** This filter is documented in modules/widgets/facebook-likebox.php */ |
|
| 23 | apply_filters( 'jetpack_widget_name', esc_html__( 'Flickr', 'jetpack' ) ), |
|
| 24 | array( |
|
| 25 | 'description' => esc_html__( 'Display your recent Flickr photos.', 'jetpack' ), |
|
| 26 | 'customize_selective_refresh' => true, |
|
| 27 | ), |
|
| 28 | array() |
|
| 29 | ); |
|
| 30 | ||
| 31 | if ( is_active_widget( false, false, $this->id_base ) || is_customize_preview() ) { |
|
| 32 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) ); |
|
| 33 | } |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * Enqueue style. |
|