WordPress.org

Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Single Category Permalink

Reduce permalinks (category or post) that include entire hierarchy of categories to just having the lowest level category.

Filters

The plugin exposes one filter for hooking. Typically, customizations utilizing this hook would be put into your active theme's functions.php file, or used by another plugin.

c2c_single_category_redirect_status (filter)

The 'c2c_single_category_redirect_status' hook allows you to specify an HTTP status code used for the redirect. By default this is 302.

Arguments:

  • $status (integer) : The default HTTP status code

Example:

// Change single category redirect to 302
/**
 * Change the redirection HTTP status to a 302.
 *
 * @param  int $code The HTTP status code. By default 301.
 * @return int
 */
function scp_change_redirect_status( $code ) {
    return 302;
}
add_filter( 'c2c_single_category_redirect_status', 'scp_change_redirect_status' );

Requires: 4.6 or higher
Compatible up to: 4.7.3
Last Updated: 4 weeks ago
Active Installs: 1,000+

Ratings

5 out of 5 stars

Support

1 of 1 support threads in the last two months have been marked resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,1,1
100,1,1
0,1,0
0,1,0
100,1,1
0,1,0