I am using WP v3.3.1 and I am trying to create a plugin. I got him half-working. It was triggered, and add_action works, but for some reason my filters do not start. When I searched googled around, I saw that I should have done it like this, but it doesnโt work. I also tried to include it outside the class, which didn't work either. The error log is written from the constructor, but not from xmlAddMethod. I tested the xmlrpc call in a single file, and it worked, but with problems creating classes.
add_filter( 'xmlrpc_methods', array( &$this, 'xmlAddMethod') );
class TargetDomain extends Domain
{
public function __construct()
{
error_log('TARGET: __construct');
add_filter( 'xmlrpc_methods', array( &$this, 'xmlAddMethod') );
parent::__construct();
}
function xmlAddMethod( $methods )
{
error_log('TARGET: xml_add_method');
$methods['myBlog.publishPost'] = 'publishMyPost';
return $methods;
}
source
share