register

Filters the HTML link to the Registration or Admin page.

Description

apply_filters( 'register', (string) $link ); 

Users are sent to the admin page if logged-in, or the registration page if enabled and logged-out.

Parameters (1)

0. $link (string)
The HTML code for the link to the Registration or Admin page.

Usage

To run the hook, copy the example below.
  1. $link = apply_filters( 'register', $link ); 
  2.  
  3. if ( !empty( $link ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the register callback 
  2. function filter_register( $link ) { 
  3. // make filter magic happen here... 
  4. return $link
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'register', 'filter_register', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'register', 'filter_register', 10, 1 ); 

Defined (4)

The filter is defined in the following location(s).

/wp-includes/general-template.php  
  1. $link = apply_filters( 'register', $link ); 
/wp-login.php  
  1. echo ' | ' . apply_filters( 'register', $registration_url ); 
  1. echo ' | ' . apply_filters( 'register', $registration_url ); 
  1. echo apply_filters( 'register', $registration_url ) . ' | ';