pre_get_shortlink

Filters whether to preempt generating a shortlink for the given post.

Description

add_filter( 'pre_get_shortlink', (string) $wpme_get_shortlink_handler, (int) $int, (int) $int ); 

Sort Order: 8 First Introduced: 1.1 Requires Connection: Yes Auto Activate: Yes Module Tags: Social Feature: Writing Additional Search Queries: shortlinks, wp.me

Parameters (3)

0. $wpme_get_shortlink_handler (string) => 'wpme_get_shortlink_handler'
The wpme get shortlink handler.
1. $int (int) => 1
The int.
2. $int (int) => 4
The int.

Usage

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

Defined (1)

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

/modules/shortlinks.php  
  1. add_filter( 'pre_get_shortlink', 'wpme_get_shortlink_handler', 1, 4 );