diff --git a/index.php b/index.php index 2a9a36b..5d7c4ad 100644 --- a/index.php +++ b/index.php @@ -12,13 +12,13 @@ comicpress_display_post(); endwhile; } - Restore(); - UnProtect(); + Restore(); + UnProtect(); wp_reset_query(); ?> - diff --git a/test/fixtures/destroy-widgets.inc b/test/fixtures/destroy-widgets.inc new file mode 100644 index 0000000..228d5f6 --- /dev/null +++ b/test/fixtures/destroy-widgets.inc @@ -0,0 +1,3 @@ +option('sidebars_widgets', array()); diff --git a/test/selenium/TestWidgetInitIsCorrect.html b/test/selenium/TestWidgetInitIsCorrect.html new file mode 100644 index 0000000..35803f1 --- /dev/null +++ b/test/selenium/TestWidgetInitIsCorrect.html @@ -0,0 +1,65 @@ + + + + + + +TestWidgetInitIsCorrect + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TestWidgetInitIsCorrect
open/wp-admin/
clickAndWaitlink=Post Fixtures
clicklink=themes/comicpress-2.8/test/fixtures/destroy-widgets.inc
clickpf[is_ok]
clickAndWait//input[@value='Load Provided Data']
assertTextPresentNew data set loaded into WordPress.
clickAndWaitsite-visit-button
assertElementNotPresent//script[contains(text(), 'var image_root')]
open/wp-admin/
+ + diff --git a/widgets/BookmarkWidget.inc b/widgets/BookmarkWidget.inc index 5327d6f..9ca4a25 100644 --- a/widgets/BookmarkWidget.inc +++ b/widgets/BookmarkWidget.inc @@ -45,12 +45,11 @@ class ComicPressBookmarkWidget extends WP_Widget { ); } - function init() { - add_action('wp_head', array(&$this, 'wp_head')); - } + function init() {} function is_active() { - add_action('template_redirect', array(&$this, 'template_redirect')); + add_action('wp_head', array(&$this, 'wp_head')); + add_action('template_redirect', array(&$this, 'template_redirect')); } function template_redirect() {