This filter allows you to manipulate the HTML output after a list of dynamic posts items.
Here’s an example that injects a link with the text “Hello World” at the end of each dynamic posts set.
add_filter( 'ubermenu_dp_after' , 'um_dp_after' , 10 , 3 ); function um_dp_after( $html , $item_id , $term_args ){ $html.= '<li class="ubermenu-item ubermenu-item-normal"><a class="ubermenu-target" href="https://google.com">Hello World</a></li>'; return $html; }
ubermenu_dp_after
Your registered callback will be called once per Dynamic Posts item. The content that you return will be displayed as at the end of the dynamic posts results. You have access to the ID of the Dynamic Posts item and the query arguments for the dynamic posts query.
$html
The HTML markup to display after the dynamic posts list. You can append to or override this.
$item_id
This is the ID of the Dynamic Posts menu item. It can be used to conditionally apply this filter only to a specific set of dynamic posts.
$term_args
This is an array of arguments passed to the get_posts() query as configured in your Dynamic Posts menu item settings.