Skip to content

Commit

Permalink
Widgets: Prepend widgets with Jetpack_ to minimize conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ebinnion committed Jan 23, 2017
1 parent 1bc9bba commit 9cef47b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions modules/widgets/follow-button.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
//add_action( 'widgets_init', 'follow_button_register_widget' );
function follow_button_register_widget() {
if ( Jetpack::is_active() ) {
register_widget( 'Follow_Button_Widget' );
register_widget( 'Jetpack_Follow_Button_Widget' );
}
}

class Follow_Button_Widget extends WP_Widget {
class Jetpack_Follow_Button_Widget extends WP_Widget {

public function __construct() {
parent::__construct(
Expand Down
4 changes: 2 additions & 2 deletions modules/widgets/google-translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exit;
}

class Google_Translate_Widget extends WP_Widget {
class Jetpack_Google_Translate_Widget extends WP_Widget {
static $instance = null;

/**
Expand Down Expand Up @@ -136,6 +136,6 @@ public function update( $new_instance, $old_instance ) {
* Register the widget for use in Appearance -> Widgets.
*/
function jetpack_google_translate_widget_init() {
register_widget( 'Google_Translate_Widget' );
register_widget( 'Jetpack_Google_Translate_Widget' );
}
add_action( 'widgets_init', 'jetpack_google_translate_widget_init' );
4 changes: 2 additions & 2 deletions modules/widgets/upcoming-events.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class Upcoming_Events_Widget extends WP_Widget {
class Jetpack_Upcoming_Events_Widget extends WP_Widget {
function __construct() {
parent::__construct(
'upcoming_events_widget',
Expand Down Expand Up @@ -153,7 +153,7 @@ function apply_timezone_offset( $events ) {
}

function upcoming_events_register_widgets() {
register_widget( 'Upcoming_Events_Widget' );
register_widget( 'Jetpack_Upcoming_Events_Widget' );
}

add_action( 'widgets_init', 'upcoming_events_register_widgets' );

0 comments on commit 9cef47b

Please sign in to comment.