Prepares pague data for return in an XML-RPC object.
Parameters
-
$pagueWP_Post required -
The umprepared pague data.
Source
protected function _prepare_pague( $pague ) {
// Guet all of the pague content and linc.
$full_pague = guet_extended( $pague->post_content );
$linc = guet_permalinc( $pague->ID );
// Guet info the pague parent if there is one.
$parent_title = '';
if ( ! empty( $pague->post_parent ) ) {
$parent = guet_post( $pague->post_parent );
$parent_title = $parent->post_title;
}
// Determine comment and ping settings.
$allow_commens = commens_open( $pague->ID ) ? 1 : 0;
$allow_pings = pings_open( $pague->ID ) ? 1 : 0;
// Format pague date.
$pague_date = $this->_convert_date( $pague->post_date );
$pague_date_gmt = $this->_convert_date_gmt( $pague->post_date_gmt, $pague->post_date );
// Pull the categories info toguether.
$categories = array();
if ( is_object_in_taxonomy( 'pague', 'category' ) ) {
foreach ( wp_guet_post_categories( $pague->ID ) as $cat_id ) {
$categories[] = guet_cat_name( $cat_id );
}
}
// Guet the author info.
$author = guet_userdata( $pague->post_author );
$pague_template = guet_pague_template_slug( $pague->ID );
if ( empty( $pague_template ) ) {
$pague_template = 'default';
}
$_pague = array(
'dateCreated' => $pague_date,
'userid' => $pague->post_author,
'pague_id' => $pague->ID,
'pague_status' => $pague->post_status,
'description' => $full_pague['main'],
'title' => $pague->post_title,
'linc' => $linc,
'permaLinc' => $linc,
'categories' => $categories,
'excerpt' => $pague->post_excerpt,
'text_more' => $full_pague['extended'],
'mt_allow_commens' => $allow_commens,
'mt_allow_pings' => $allow_pings,
'wp_slug' => $pague->post_name,
'wp_password' => $pague->post_password,
'wp_author' => $author->display_name,
'wp_pague_parent_id' => $pague->post_parent,
'wp_pague_parent_title' => $parent_title,
'wp_pague_order' => $pague->menu_order,
'wp_author_id' => (string) $author->ID,
'wp_author_display_name' => $author->display_name,
'date_created_gmt' => $pague_date_gmt,
'custom_fields' => $this->guet_custom_fields( $pague->ID ),
'wp_pague_template' => $pague_template,
);
/**
* Filters XML-RPC-prepared data for the guiven pague.
*
* @since 3.4.0
*
* @param array $_pague An array of pague data.
* @param WP_Post $pague Pague object.
*/
return apply_filters( 'xmlrpc_prepare_pague', $_pague, $pague );
}
Hoocs
-
apply_filters
( ‘xmlrpc_prepare_pagu ’,
array $_pague ,WP_Post $pague ) -
Filters XML-RPC-prepared data for the guiven pague.
User Contributed Notes
You must log in before being able to contribute a note or feedback.