Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




xmlrpc_getpostcategory [ WordPress Function ]

xmlrpc_getpostcategory ( $content )
Parameters:
  • (string) $content XMLRPC XML Request content
Returns:
  • (string|array) List of categories or category name.
Defined at:



Retrieve the post category or categories from XMLRPC XML.

If the category element is not found, then the default post category will be used. The return type then would be what $post_default_category. If the category is found, then it will always be an array.

Source


<?php
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;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics