| @@ 32-47 (lines=16) @@ | ||
| 29 | public $alt_option_name = 'widget_stats_topposts'; |
|
| 30 | public $default_title = ''; |
|
| 31 | ||
| 32 | function __construct() { |
|
| 33 | parent::__construct( |
|
| 34 | 'top-posts', |
|
| 35 | /** This filter is documented in modules/widgets/facebook-likebox.php */ |
|
| 36 | apply_filters( 'jetpack_widget_name', __( 'Top Posts & Pages', 'jetpack' ) ), |
|
| 37 | array( |
|
| 38 | 'description' => __( 'Shows your most viewed posts and pages.', 'jetpack' ), |
|
| 39 | ) |
|
| 40 | ); |
|
| 41 | ||
| 42 | $this->default_title = __( 'Top Posts & Pages', 'jetpack' ); |
|
| 43 | ||
| 44 | if ( is_active_widget( false, false, $this->id_base ) ) { |
|
| 45 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_style' ) ); |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| 49 | function enqueue_style() { |
|
| 50 | wp_register_style( 'jetpack-top-posts-widget', plugins_url( 'top-posts/style.css', __FILE__ ), array(), '20141013' ); |
|
| @@ 4-16 (lines=13) @@ | ||
| 1 | <?php |
|
| 2 | ||
| 3 | class 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 | ) |
|
| 12 | ); |
|
| 13 | if ( is_active_widget( false, false, $this->id_base ) ) { |
|
| 14 | add_action( 'wp_head', array( $this, 'css' ) ); |
|
| 15 | } |
|
| 16 | } |
|
| 17 | ||
| 18 | function css() { |
|
| 19 | ?> |
|