Override Widget class in plugins with custom plugin

You’re actually quite close to answering your own question. Your plugin would have to start with checking whether the plugin is active (which you can also do with function_exists). The you indeed can use remove_action to make sure functions and classes aren’t activated. This doesn’t mean these functions become undefined. So yes, you will need … Read more

Ban certain widgets from certain sidebars

You are overthinking it. The concept of widgets is designed to be transferable between widget area (AKA sidebars). If a widget is not tranferable it is just not a true wordpress widget. Now creating your own framework of widgets sound like a non pleasant idea. In addition to fighting the wordpress core code, you will … Read more

widget should display post archive by year and on click also by month

I did this for a client and it looked like this: The PHP code: <dl class=”tree-accordion”> <?php $currentyear = date(“Y”); $years = range($currentyear, 1950); foreach($years as $year) { ?> <dt><a href=””><i class=”fa fa-fw fa-plus-square-o” aria-hidden=”true”></i> <?php echo $year; ?></a></dt> <?php $archi = wp_get_archives(‘echo=0&show_post_count=1&type=monthly&year=” . $year); $archi = explode(“</li>’, $archi); $links = array(); foreach($archi as $link) … Read more

Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?

You are adding filter, not an action. I don’t know how Genesis hook works, but native wp_nav_menu_items passes (and expects back) markup of custom menu items. Instead of echoing your additional stuff you should append it to input and return. This is clearly how it’s done in tutorial you linked to: add_filter(‘wp_nav_menu_items’,’follow_icons’,10,1); function follow_icons($output) { … Read more

Problems with the sidebar args and wp_list_bookmarks

After a few var_dumps I know this: 1) When wp_list_bookmarks is called whithin WP_Widget_Links->widget The ‘class’ parameter is ignored because the ‘category_before’ parameter doesn’t have the %class wildcard. Instead ‘category_before’ will look as if ‘class’ where ‘widget_links’. This is how the function dynamic_sidebar set the $before_widget parameters for the widget once it gets called. Of … Read more