Advertisement
BakerMan

Remove 'View All Events in Category'

Feb 10th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. /**
  2.  * This is a fairly crude bit of string manipulation relating to the
  3.  * event list widget.
  4.  *
  5.  * It could be enhanced though to also catch other strings like "View
  6.  * All Events" and to remove the <p>/<a> elements that surround them,
  7.  * if necessary. An alternative approach (to remove strings) could be
  8.  * a filter on the gettext hook.
  9.  *
  10.  * Targets TEC/ECP 3.4.x
  11.  */
  12.  
  13. add_action( 'tribe_events_before_list_widget', 'ob_start' );
  14. add_action( 'tribe_events_after_list_widget', 'custom_manipulate_eventlist_widget_output' );
  15.  
  16. function custom_manipulate_eventlist_widget_output() {
  17.     $widget_html = ob_get_clean();
  18.     echo str_replace( 'View All Events in Category', '', $widget_html );
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement