Changeset 3790823 for cliedesk/trunk/src/Rest/RestServer.php
- Timestamp:
- 11/08/2026 10:31:05 AM (12 hours ago)
- File:
-
- 1 edited
-
cliedesk/trunk/src/Rest/RestServer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cliedesk/trunk/src/Rest/RestServer.php
r3788907 r3790823 76 76 add_action( 'rest_api_init', array( $this, 'register' ) ); 77 77 add_action( 'application_password_did_authenticate', array( $this, 'mark_app_password' ) ); 78 add_filter( 'rest_pre_dispatch', array( $this, 'complete_routes' ), 0, 3 ); 78 79 add_filter( 'rest_pre_dispatch', array( $this, 'guard' ), 10, 3 ); 79 80 add_filter( 'rest_post_dispatch', array( $this, 'headers' ), 10, 3 ); … … 93 94 } 94 95 $this->routes->register(); 96 } 97 98 /** 99 * `rest_pre_dispatch` (P4, row 91): a request for a path whose routes were left out of this REST request's server 100 * (an internal rest_do_request, an embed) registers them before WordPress matches it. 101 * 102 * @param mixed $result Pre-dispatch result. 103 * @param \WP_REST_Server $server Server. 104 * @param \WP_REST_Request $request Request. 105 * @return mixed 106 */ 107 public function complete_routes( $result, $server, $request ) { 108 if ( $request instanceof \WP_REST_Request ) { 109 $this->routes->complete( (string) $request->get_route(), (string) $request->get_method() ); 110 } 111 return $result; 95 112 } 96 113
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)