Remove rss widget title link

You are trying to modify a built-in widget. Unfortunately for you there is no easy solution to get the results you desire. As you figured out already, there is no filter hook to modify the whole title output. How to get the results? Create your own Widget extending WP_Widget_RSS where you overwrite the parents method … Read more

How to get the registered sidebar’s name by its id?

Sidebars are stored in global variable $wp_registered_sidebars. You can get the sidebar properties using this variable. global $wp_registered_sidebars; if ( isset( $wp_registered_sidebars[‘sidebar-2’] ) ) { echo $wp_registered_sidebars[‘sidebar-2’][‘name’]; } Note that do not use it too early, either on/after widgets_init hook or in a template file.

Anyway to edit the titlebar of WordPress Widgets in the Admin area?

I believe you are looking for $params = apply_filters( ‘dynamic_sidebar_params’, $params ); (look here: https://github.com/WordPress/WordPress/blob/master/wp-includes/widgets.php#L706). Now this filter will evaluate both in front end and back end. so to answer your question, you could wrap your filter in a if( is_admin() ){ // Do icons } check. Better yet, you could define this at registration … Read more

Remove […] from RSS feed?

Here’s a suggestion: First we target the RSS widgets that have summaries. Then we filter the output of wp_trim_words() within the wp_widget_rss_output() function, to remove the […] part. Then we clean up in two ways: First we remove our wp_trim_words() filter, if it’s running, before the current widget is displayed. We can do that by … Read more

How to use control_callback when creating a widget via functions.php or plugin?

Actually the from fields only should be in the control_callback function , both form and handling so try this: <?php /* Plugin Name: custom dashboard widget Plugin URI: http://en.bainternet.info Description: custom dashboard widget with control form Version: 0.1 Author: bainternet Author URI: http://en.bainternet.info */ //show widget function custom_dashboard_widget_coach() { //get saved data if ( !$widget_options … Read more

How to register custom menu widget

Try this code (in function.php) class MyWidget extends WP_Widget { function __construct() { $widget_ops = array( ‘description’ => __(‘Use this widget to add one of your custom menu as a link list widget.’) ); parent::__construct( ‘custom_menu_widget-1’, __(‘My name’), $widget_ops ); } function widget($args, $instance) { // Get menu $nav_menu = ! empty( $instance[‘nav_menu’] ) ? … Read more

Delete Custom Dashboard Widgets

The built-in dashboard widgets are not marked somehow, you have to use a fixed list: ‘dashboard_right_now’, ‘dashboard_plugins’, ‘dashboard_quick_press’, ‘dashboard_recent_drafts’, ‘dashboard_recent_comments’, ‘dashboard_incoming_links’, ‘dashboard_primary’, ‘dashboard_secondary’ So your code should test if the current widget is in that list and remove the widget, if it isn’t: add_action( ‘wp_dashboard_setup’, ‘t5_remove_custom_dashboard_widgets’, 11 ); function t5_remove_custom_dashboard_widgets() { global $wp_meta_boxes; $builtin = … Read more