Checks for changed slugs for published post objects and save the old slug.
Description
The function is used when a post object of any type is updated, by comparing the current and previous post objects.
If the slug was changed and not already part of the old slugs then it will be added to the post meta field (‘_wp_old_slug’) for storing old slugs for that post.
The most logically usage of this function is redirecting changed post objects, so that those that linked to an changed post will be redirected to the new post.
Parameters
Source
$post_mimes[] = str_replace( '/', '_', $mime );
}
$matches = wp_match_mime_types( array_keys( $types ), $post_mimes );
$matches['default'] = array( 'default' );
foreach ( $matches as $match => $wilds ) {
foreach ( $wilds as $wild ) {
if ( ! isset( $types[ $wild ] ) ) {
continue;
}
$icon = $types[ $wild ];
if ( ! is_numeric( $mime ) ) {
wp_cache_add( "mime_type_icon_$mime", $icon );
}
break 2;
}
}
}
/**
* Filters the mime type icon.
Changelog
Version | Description |
---|---|
2.1.0 | Introduced. |
Typo: “The most logically usage”