wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi
xmlrpc_getpostcategory › WordPress Function
Da0.71
Deprecaton/a
› xmlrpc_getpostcategory ( $content )
| Parametri: |
|
| Ritorna: |
|
| Definito a: |
|
| Codex: |
Retrieves the post category or categories from XML-RPC XML.
If thecategory element is not found in the XML, the default post category
from the $post_default_category global will be used instead.
The return type will then be a string.
If the category element is found, the return type will be an array.Funzioni correlate: xmlrpc_getposttitle, wp_get_post_categories, wp_set_post_categories, get_category, xmlrpc_removepostdata
Sorgenti
function xmlrpc_getpostcategory( $content ) {
global $post_default_category;
if ( preg_match( '/<category>(.+?)<\/category>/is', $content, $matchcat ) ) {
$post_category = trim( $matchcat[1], ',' );
$post_category = explode( ',', $post_category );
} else {
$post_category = $post_default_category;
}
return $post_category;
}