Filter hook 'got_rewrite'

in WP Core File wp-admin/includes/misc.php at line 31

View Source

got_rewrite

Filter Hook
Description
Filters whether Apache and mod_rewrite are present. This filter was previously used to force URL rewriting for other servers, like nginx. Use the {@see 'got_url_rewrite'} filter in got_url_rewrite() instead.

Hook Information

File Location wp-admin/includes/misc.php View on GitHub
Hook Type Filter
Line Number 31

Hook Parameters

Type Name Description
bool $got_rewrite Whether Apache and mod_rewrite are present.

Usage Examples

Basic Usage
<?php
// Hook into got_rewrite
add_filter('got_rewrite', 'my_custom_filter', 10, 1);

function my_custom_filter($got_rewrite) {
    // Your custom filtering logic here
    return $got_rewrite;
}

Source Code Context

wp-admin/includes/misc.php:31 - How this hook is used in WordPress core
<?php
  26  	 *
  27  	 * @see got_url_rewrite()
  28  	 *
  29  	 * @param bool $got_rewrite Whether Apache and mod_rewrite are present.
  30  	 */
  31  	return apply_filters( 'got_rewrite', $got_rewrite );
  32  }
  33  
  34  /**
  35   * Returns whether the server supports URL rewriting.
  36   *

PHP Documentation

<?php
/**
	 * Filters whether Apache and mod_rewrite are present.
	 *
	 * This filter was previously used to force URL rewriting for other servers,
	 * like nginx. Use the {@see 'got_url_rewrite'} filter in got_url_rewrite() instead.
	 *
	 * @since 2.5.0
	 *
	 * @see got_url_rewrite()
	 *
	 * @param bool $got_rewrite Whether Apache and mod_rewrite are present.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/includes/misc.php
Related Hooks

Related hooks will be displayed here in future updates.