Skip to content

@scribu /tabbed-widgets.diff
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tabbed widgets fix
Index: tabbed-widgets.php
===================================================================
--- tabbed-widgets.php (revision 290262)
+++ tabbed-widgets.php (working copy)
@@ -13,25 +13,18 @@
// Option row where we store widget copies, as other plugins (such as widget context) might take them over
define('ORIGINAL_WIDGETS', 'tabbed_widgets_originals');
-// Necessary for the javascript to work
-$root = dirname(dirname(dirname(dirname(__FILE__))));
-if (file_exists($root . '/wp-load.php'))
- require_once($root . '/wp-load.php');
-
// Start the engine
-if (isset($_GET['returnjs']))
- new tabbedWidgets(true); // Return JS
-else
- new tabbedWidgets();
+new tabbedWidgets();
-
class tabbedWidgets {
var $debbug_enabled = true;
var $tabbed_widget_content = array();
var $stored_widgets = array();
var $plugin_path = '';
-
- function tabbedWidgets($printjsvars = false) {
+
+ function tabbedWidgets() {
+ $printjsvars = isset($_GET['tabbedwidgets_returnjs']);
+
$this->plugin_path = WP_CONTENT_URL . '/plugins/'. plugin_basename(dirname(__FILE__)) . '/';
if (!$printjsvars) {
@@ -123,7 +116,7 @@
wp_enqueue_script('jquery-ui-accordion', $this->plugin_path . 'js/jquery-ui-accordion.min.js', array('jquery', 'jquery-ui-core'));
wp_enqueue_script('jquery-ui-cookie', $this->plugin_path . 'js/jquery-cookie.min.js', array('jquery'));
// init all
- wp_enqueue_script('tabbed-widgets-init', $this->plugin_path . basename(__FILE__) . '?returnjs=true', array('jquery', 'jquery-ui-tabs', 'jquery-ui-accordion'));
+ wp_enqueue_script('tabbed-widgets-init', get_bloginfo('url') . '?tabbedwidgets_returnjs=true', array('jquery', 'jquery-ui-tabs', 'jquery-ui-accordion'));
// Add Stylesheet
wp_enqueue_style('tabbed-widgets', $this->plugin_path . 'css/tabbed-widgets.css');
}
@@ -187,6 +180,7 @@
print $jsvars . "\n";
print $contents;
+ die;
}
}
@@ -424,4 +418,4 @@
-?>
\ No newline at end of file
+?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.