@@ 553-560 (lines=8) @@ | ||
550 | add_filter( 'xmlrpc_methods', array( $this, 'xmlrpc_methods' ) ); |
|
551 | ||
552 | $signed = $this->verify_xml_rpc_signature(); |
|
553 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
554 | // The actual API methods. |
|
555 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'xmlrpc_methods' ) ); |
|
556 | } else { |
|
557 | // The jetpack.authorize method should be available for unauthenticated users on a site with an |
|
558 | // active Jetpack connection, so that additional users can link their account. |
|
559 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
560 | } |
|
561 | } else { |
|
562 | // The bootstrap API methods. |
|
563 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
@@ 561-569 (lines=9) @@ | ||
558 | // active Jetpack connection, so that additional users can link their account. |
|
559 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'authorize_xmlrpc_methods' ) ); |
|
560 | } |
|
561 | } else { |
|
562 | // The bootstrap API methods. |
|
563 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'bootstrap_xmlrpc_methods' ) ); |
|
564 | $signed = $this->verify_xml_rpc_signature(); |
|
565 | if ( $signed && ! is_wp_error( $signed ) ) { |
|
566 | // the jetpack Provision method is available for blog-token-signed requests |
|
567 | add_filter( 'xmlrpc_methods', array( $this->xmlrpc_server, 'provision_xmlrpc_methods' ) ); |
|
568 | } |
|
569 | } |
|
570 | ||
571 | // Now that no one can authenticate, and we're whitelisting all XML-RPC methods, force enable_xmlrpc on. |
|
572 | add_filter( 'pre_option_enable_xmlrpc', '__return_true' ); |