| @@ 28-41 (lines=14) @@ | ||
| 25 | /** | |
| 26 | * Register widget with WordPress. | |
| 27 | */ | |
| 28 | 	function __construct() { | |
| 29 | parent::__construct( | |
| 30 | 'google_translate_widget', | |
| 31 | /** This filter is documented in modules/widgets/facebook-likebox.php */ | |
| 32 | apply_filters( 'jetpack_widget_name', __( 'Google Translate', 'jetpack' ) ), | |
| 33 | array( | |
| 34 | 'description' => __( 'Provide your readers with the option to translate your site into their preferred language.', 'jetpack' ), | |
| 35 | 'customize_selective_refresh' => true | |
| 36 | ) | |
| 37 | ); | |
| 38 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); | |
| 39 | ||
| 40 | $this->default_title = esc_html__( 'Translate', 'jetpack' ); | |
| 41 | } | |
| 42 | ||
| 43 | /** | |
| 44 | * Enqueue frontend JS scripts. | |
| @@ 140-155 (lines=16) @@ | ||
| 137 | public static $cron_name = 'jetpack_display_posts_widget_cron_update'; | |
| 138 | ||
| 139 | ||
| 140 | 	public function __construct() { | |
| 141 | parent::__construct( | |
| 142 | // internal id | |
| 143 | 'jetpack_display_posts_widget', | |
| 144 | /** This filter is documented in modules/widgets/facebook-likebox.php */ | |
| 145 | apply_filters( 'jetpack_widget_name', __( 'Display WordPress Posts', 'jetpack' ) ), | |
| 146 | array( | |
| 147 | 'description' => __( 'Displays a list of recent posts from another WordPress.com or Jetpack-enabled blog.', 'jetpack' ), | |
| 148 | 'customize_selective_refresh' => true, | |
| 149 | ) | |
| 150 | ); | |
| 151 | ||
| 152 | 		if ( is_customize_preview() ) { | |
| 153 | add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); | |
| 154 | } | |
| 155 | } | |
| 156 | ||
| 157 | /** | |
| 158 | * Expiring transients have a name length maximum of 45 characters, | |