0
可能吗?还是有没有其他的方式来做到这一点没有xml-rpc?使用xml-rpc按自定义字段搜索文章
可能吗?还是有没有其他的方式来做到这一点没有xml-rpc?使用xml-rpc按自定义字段搜索文章
是的,这是可能的,但你必须编写自己的XML-RPC方法。
例如:
add_filter('xmlrpc_methods', 'my_add_xmlrpc_methods');
//this function adds new xml-rpc method
//my.search_posts - name of xml-rpc method
//search_posts_by_custom_field - name of the function that should proccess my.search_posts method call
function my_add_xmlrpc_methods($methods) {
$methods['my.search_posts'] = 'search_posts_by_custom_field';
return $methods;
}
//this function actually search posts
function search_posts_by_custom_field($args) {
//authenticate user
//run search DB query
//return results
}