Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widgets: Prepend widgets with Jetpack_ to minimize conflicts #6149

Merged
merged 1 commit into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' );