芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/www/wp-content/plugins/facebook-for-woocommerce/includes/Handlers/WebHook.php
array( 'GET', 'POST' ), 'callback' => array( $this, 'webhook_callback' ), 'permission_callback' => array( $this, 'permission_callback' ), ), ) ); } /** * Endpoint permissions * Woo Connect Bridge is sending the WebHook request using generated key. * * @since 2.3.0 * * @return boolean */ public function permission_callback() { return current_user_can( 'manage_woocommerce' ); } /** * WebHook Listener * * @since 2.3.0 * @see Connection * * @param \WP_REST_Request $request The request. * @return \WP_REST_Response */ public function webhook_callback( \WP_REST_Request $request ) { $request_body = json_decode( $request->get_body() ); if ( empty( $request_body ) ) { return new \WP_REST_Response( null, 204 ); } do_action( 'fbe_webhook', $request_body ); return new \WP_REST_Response( null, 200 ); } }