WordPress.org

Make WordPress Core

Opened 17 months ago

Last modified 17 months ago

#22540 new enhancement

Drilling categories for relevant posts via XML-RPC — at Version 1

Reported by: nidhi.patel Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 3.4.2
Component: XML-RPC Keywords:
Focuses: Cc:

Description (last modified by scribu)

Hello WordPress,

Requirement for us was to drill down the category relevant posts, and I have implemented the solution using xmlrpc for the .net env using c#.

The trouble is there is no available option to filter using category for the posts.

So I have done following changes, please recommend if we can do any better to avoid the override of the change may be by upgrading the next version with it from WordPress version natively.

Describing the basic nitty-gritty with in :

After doing some cross referencing I was able to figure out adding following code shouldn't harm :

1: With in LLN#1374 function wp_getPosts( $args )
I added the filter option for category as follows on LN#1410

if ( isset( $filter['category'] ) )
    $query['category'] = $filter['category'];

I have done few tests and seems to be working fine, just its expects the categoryId to drill the category relevant posts for me.

I wonder if you could integrate this from WordPress.

2: Our second requirement was to get out of the box wpautop for the content, so we don't need to worry about adding <p><p/> tags.

hence the another change of code I had integrated with in the file is as following :

with in protected function _prepare_post( $post, $fields ) on LN#624 , I had added the wpautop call to surrounds to post_content as in follows :

'post_content'      => wpautop($post['post_content']),

Please guide or suggest how to avoid the override when upgrading the WordPress, one option is WordPress integrate these changes out of the box and until that we keep an eye and on ever upgrade keep doing the change.

Please feel free to reach me with any possible suggestions.

Regards,
Nidhi

Change History (2)

nidhi.patel17 months ago

with updated patch to filter posts via category

comment:1 scribu17 months ago

  • Description modified (diff)
  • Keywords 2nd-opinion needs-refresh removed
  • Summary changed from Requirement : Drilling category relevant posts to Drilling categories for relevant posts via XML-RPC
Note: See TracTickets for help on using tickets.