@@ 566-573 (lines=8) @@ | ||
563 | add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
|
564 | ||
565 | $signed = $this->verify_xml_rpc_signature(); |
|
566 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
567 | // The actual API methods. |
|
568 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
|
569 | } else { |
|
570 | // The jetpack.authorize method should be available for unauthenticated users on a site with an |
|
571 | // active Jetpack connection, so that additional users can link their account. |
|
572 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
573 | } |
|
574 | } else { |
|
575 | // The bootstrap API methods. |
|
576 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
@@ 574-582 (lines=9) @@ | ||
571 | // active Jetpack connection, so that additional users can link their account. |
|
572 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
573 | } |
|
574 | } else { |
|
575 | // The bootstrap API methods. |
|
576 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
577 | $signed = $this->verify_xml_rpc_signature(); |
|
578 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
579 | // the jetpack Provision method is available for blog-token-signed requests |
|
580 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
|
581 | } |
|
582 | } |
|
583 | ||
584 | // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
|
585 | add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |