_make_cat_compat [ WordPress Function ]
| Access: |
|
| Parameters: |
|
| Defined at: |
|
Update category structure to old pre 2.3 from new taxonomy structure.
This function was added for the taxonomy support to update the new category structure with the old category one. This will maintain compatibility with plugins and themes which depend on the old key or property names.
The parameter should only be passed a variable and not create the array or object inline to the parameter. The reason for this is that parameter is passed by reference and PHP will fail unless it has the variable.
There is no return value, because everything is updated on the variable you pass to it. This is one of the features with using pass by reference in PHP.
Source
<?php
function _make_cat_compat( &$category ) {
if ( is_object( $category ) ) {
$category->cat_ID = &$category->term_id;
$category->category_count = &$category->count;
$category->category_description = &$category->description;
$category->cat_name = &$category->name;
$category->category_nicename = &$category->slug;
$category->category_parent = &$category->parent;
} elseif ( is_array( $category ) && isset( $category['term_id'] ) ) {
$category['cat_ID'] = &$category['term_id'];
$category['category_count'] = &$category['count'];
$category['category_description'] = &$category['description'];
$category['cat_name'] = &$category['name'];
$category['category_nicename'] = &$category['slug'];
$category['category_parent'] = &$category['parent'];
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- PHPXRef 0.7 : WordPress : Function Reference: _make_cat_compat()
Function and Method Cross Reference. _make_cat_compat(). Defined at: /wp- includes/category.php -> line 301. Referenced 5 times: /wp-includes/query.php ...
phpxref.ftwr.co.uk - _make_cat_compat (WordPress Function) - WPSeek.com
WordPress lookup for _make_cat_compat, a WordPress Function. wpseek.com is a WordPress-centric search tool for developers and theme authors.
wpseek.com - ([15613] -> no more _make_cat_compat() on ... - WordPress Trac
[15613] condensed the three different tax handling branches in WP_Query:: get_queried_object() into one using calls to get_term or get_term_by. This means ...
core.trac.wordpress.org - Solution to: Wordpress “Call to undefined function” Error
... the old wordpress files with the new ones: Call to undefined function: _make_cat_compat() in /home/hongkiat/public/blog/wp-includes/category- template.php ...
www.hongkiat.com