got_rewrite

Filters whether Apache and mod_rewrite are present.

Description

apply_filters( 'got_rewrite', (bool) $got_rewrite ); 

This filter was previously used to force URL rewriting for other servers, like nginx. Use the filter in got_url_rewrite() instead.

Parameters (1)

0. $got_rewrite (bool)
Whether Apache and mod_rewrite are present.

Usage

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

Defined (1)

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

/wp-admin/includes/misc.php  
  1. return apply_filters( 'got_rewrite', $got_rewrite );