Migrates old core pattern categories to the new categories.
Description
Core pattern categories are revamped. Migration is needed to ensure backwards compatibility.
Parameters
$pattern
arrayrequired- Raw pattern as registered, before applying any changes.
Source
protected function migrate_pattern_categories( $pattern ) {
// No categories to migrate.
if (
! isset( $pattern['categories'] ) ||
! is_array( $pattern['categories'] )
) {
return $pattern;
}
foreach ( $pattern['categories'] as $index => $category ) {
// If the category exists as a key, then it needs migration.
if ( isset( static::$categories_migration[ $category ] ) ) {
$pattern['categories'][ $index ] = static::$categories_migration[ $category ];
}
}
return $pattern;
}
Changelog
Version | Description |
---|---|
6.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.