Filter hook 'post_format_rewrite_base'

in WP Core File wp-includes/taxonomy.php at line 45

View Source

post_format_rewrite_base

Filter Hook
Description
Filters the post formats rewrite base.

Hook Information

File Location wp-includes/taxonomy.php View on GitHub
Hook Type Filter
Line Number 45

Hook Parameters

Type Name Description
string $context Context of the rewrite base. Default 'type'.

Usage Examples

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

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

Source Code Context

wp-includes/taxonomy.php:45 - How this hook is used in WordPress core
<?php
  40  		 *
  41  		 * @since 3.1.0
  42  		 *
  43  		 * @param string $context Context of the rewrite base. Default 'type'.
  44  		 */
  45  		$post_format_base = apply_filters( 'post_format_rewrite_base', 'type' );
  46  		$rewrite          = array(
  47  			'category'    => array(
  48  				'hierarchical' => true,
  49  				'slug'         => get_option( 'category_base' ) ? get_option( 'category_base' ) : 'category',
  50  				'with_front'   => ! get_option( 'category_base' ) || $wp_rewrite->using_index_permalinks(),

PHP Documentation

<?php
/**
		 * Filters the post formats rewrite base.
		 *
		 * @since 3.1.0
		 *
		 * @param string $context Context of the rewrite base. Default 'type'.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/taxonomy.php
Related Hooks

Related hooks will be displayed here in future updates.