Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Use the WordPress IXR Client to query a remote XMLRPC method.
function my_init_test()
//check for ?test=1 or do nothing
//user id to test
$remote_user_id = 1;
//load IXR class
require_once ABSPATH . 'wp-includes/class-IXR.php';
$rpc = new IXR_CLIENT('');
$rpc->query('pmpro.getMembershipLevelForUser', 'adminusername', 'adminpassword', $remote_user_id);
$r = $rpc->getResponse();
//show output and die
wp_die('<pre>' . var_export($r, true) . '</pre>');
add_action('init', 'my_init_test');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.