b3_widget_links()

Description

With this filter you can add custom links to the user widget.

Return

A multi-dimensional array with keys link and label

Usage

  1. function b3_widget_links_example( $links ) {
  2.  
  3.     $new_links = [
  4.         [
  5.             'link' => 'https://your-link.com',
  6.             'label' => 'Your Label',
  7.         ],
  8.     ];
  9.  
  10.     if ( is_array( $links ) && ! empty( $links ) ) {
  11.         $links = array_merge( $links, $new_links );
  12.     } else {
  13.         $links = $new_links;
  14.     }
  15.  
  16.     return $links;
  17.  
  18. }
  19. add_filter( 'b3_widget_links', 'b3_widget_links_example' );

Used in

Tags