Filter: wp_most_popular_list_after

This filter is used to filter the closing html element of the outputted widget list. It can for example be used to change the output from a unordered list (ul) to a div.

Filter Parameters

  • $html (string) – The closing HTML element of the widget list


Changing the widget output from a unordered list (ul) to a div.

 * Replace the WP Most Popular widget's `ul` element with a `div`.
 * @param string $html The existing closing `ul`.
 * @return string
function thenga_change_wp_most_popular_list_after( $html ) {
   $html = '</div>';
   return $html;
add_filter( 'wp_most_popular_list_after', 'thenga_change_wp_most_popular_list_after' );


Found in system/widget.php

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.