Postboxes not expanding or collapsing on click outside of Sunny
-
Test environment:
WP 4.1, Twenty Fifteen, Sunny 1.5.3 (only)Issue:
Postboxes do not expand or collapse on click (see the dashboard, metaboxes in posts, etc), although they do work in the Sunny plugin.
The state of ‘broken’ postboxes is still being saved in the database though, so the display is updated on manual page refresh.Fix:
Ensure Sunny JS only fires on Sunny pages.Replace line 63-68 in sunny/admin/class-sunny-admin.php:
public function enqueue_scripts() { wp_enqueue_script( 'postbox' ); wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/sunny-admin.js', array( 'jquery' ), $this->version, true ); }
With:
public function enqueue_scripts($hook) { if ( 'toplevel_page_sunny' != $hook ) { return; } wp_enqueue_script( 'postbox' ); wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/sunny-admin.js', array( 'jquery' ), $this->version, true ); }
FYI, the offending line of code in the js seems to be
postboxes.add_postbox_toggles(pagenow);
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Postboxes not expanding or collapsing on click outside of Sunny’ is closed to new replies.