Plugin admin page stylesheet doesn’t work

An alternative way to add admin scripts/styles only on your plugin’s page: //The add_action to add onto the WordPress menu. add_action(‘admin_menu’, ‘myplugin_custom_menu_page’); function myplugin_custom_menu_page() { $GLOBALS[‘my_plugin_page’] = add_menu_page( ‘My Plugin’, ‘My Plugin’, ‘manage_options’, ‘myplugin/myplugin-admin.php’, ”, plugins_url( ‘myplugin/images/icon.png’ ), 33 ); } add_action( ‘admin_enqueue_scripts’, ‘my_enqueue_scripts’ ); function my_enqueue_scripts($hook_suffix) { if( $GLOBALS[‘my_plugin_page’] == $hook_suffix ) { wp_enqueue_style( … Read more

My widget won’t update its values when save is clicked

In $control_ops = array( ‘width’ => 300, ‘height’ => 350, ‘id_base’ => ‘example-widget’ ); id_base should be without space and in your rollover image, your name is wrong, you have the name set to echo $this->get_field_name( ‘image’ ); when it should be echo $this->get_field_name( ‘rollover_image’ ); add_action ( ‘widgets_init’ , ‘my_widget’ ) ; function my_widget … Read more

The “Child Pages Shortcode” plugin, block template

Try this: // Wrap <li> tags around each template item. add_filter( ‘child-pages-shortcode-template’, ‘wpse_113253_child_pages_shortcode_template’ ); // Wrap <div> and <ul> tags around everything. add_filter( ‘child-pages-shortcode-output’, ‘wpse_113253_child_pages_shortcode_output’ ); /** * Wrap <li> tags around each template item. */ function wpse_113253_child_pages_shortcode_template( $template ) { return “<li>$template</li>\n”; } /** * Wrap a <div> and <ul> tags around everything. */ … Read more