PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 2.4.7
Jetpack – WP Security, Backup, Speed, & Growth v2.4.7
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / widgets.php

widgets.php in Jetpack – WP Security, Backup, Speed, & Growth 2.4.7, at modules/widgets.php

56 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Module Name: Extra Sidebar Widgets
4 * Module Description: Easily add images, Twitter updates, and your site's RSS links to your theme's sidebar.
5 * Sort Order: 13
6 * First Introduced: 1.2
7 * Requires Connection: No
8 * Auto Activate: Yes
9 */
10
11 function jetpack_load_widgets() {
12 $widgets_include = array();
13
14 foreach ( Jetpack::glob_php( dirname( __FILE__ ) . '/widgets' ) as $file ) {
15 $widgets_include[] = $file;
16 }
17
18 $widgets_include = apply_filters( 'jetpack_widgets_to_include', $widgets_include );
19
20 foreach( $widgets_include as $include ) {
21 include $include;
22 }
23 }
24
25 add_action( 'jetpack_modules_loaded', 'jetpack_widgets_loaded' );
26
27 function jetpack_widgets_loaded() {
28 Jetpack::enable_module_configurable( __FILE__ );
29 Jetpack::module_configuration_load( __FILE__, 'jetpack_widgets_configuration_load' );
30 }
31
32 function jetpack_widgets_configuration_load() {
33 wp_safe_redirect( admin_url( 'widgets.php' ) );
34 exit;
35 }
36
37 /**
38 * Loads file for front-end widget styles.
39 */
40 function jetpack_widgets_styles() {
41 wp_enqueue_style( 'jetpack-widgets', plugins_url( 'widgets/widgets.css', __FILE__ ), array(), '20121003' );
42 }
43 add_action( 'wp_enqueue_scripts', 'jetpack_widgets_styles' );
44
45 /**
46 * Add the "(Jetpack)" suffix to the widget names
47 */
48 function jetpack_widgets_add_suffix( $widget_name ) {
49 return sprintf( __( '%s (Jetpack)', 'jetpack' ), $widget_name );
50 }
51 add_filter( 'jetpack_widget_name', 'jetpack_widgets_add_suffix' );
52
53
54
55 jetpack_load_widgets();
56