Showing a Thickbox (tb_show) does nothing

Answer can be found here: https://stackoverflow.com/questions/13863087/wordpress-custom-widget-image-upload Even though the problem described isn’t exactly the same as I had, the code posted in the answer still helped me as that code actually does exactly what I needed. I also think that I didn’t originally find this answer as it’s on the regular Stack Overflow and not … Read more

WordPress Plugins won’t save

The most likely problem is that the theme is outdated and no longer compatible with some core WP functions, the theme was released in 2012 so it’s pretty old.

Display the id list of active widgets of same sidebar?

Despite what you say is_active_widget does work on custom widgets as well. You may just have trouble locating its ID. To help you, here’s a snippet that will show the ID of a widget on the widget admin. add_action(‘in_widget_form’, ‘wpse202950_get_widget_id’); function wpse202950_get_widget_id($widget_instance) { if ($widget_instance->number==”__i__”){ echo ‘<p class=”widget-id-message”>’ . __(‘Save the widget to get its … Read more

How to change plugin`s template (view) correctly?

Here is a little code snippet to get you started. This will query through the most recent custom post types named “custom_post_type”. Change this value to the name of the custom post you wish to query. <?php $args = array( ‘post_type’ => ‘custom_post_type’, // <– make sure to use the name of your custom post … Read more

Too many widgets

WordPress admin is not designed to scale. If you are managing some resource which is 100x more than the average site, you need to be prepared to either develop your own solution to admin it or learn to live with it. In the case of widgets you should try the customizer or the accessibility mode … Read more

How to determine the number of widgets contained in a sidebar via customizer JS

While you can look at the WidgetControl instances contained inside of a SidebarSection, it is better to instead to look at the underlying setting that lists out the widgets contained inside of the sidebar. So do something like this: wp.customize( ‘sidebars_widgets[sidebar-1]’, function( sidebarSetting ) { console.info( sidebarSetting.get().length ); } ); Alternatively, with a reusable function: … Read more