pattern) with {name} placeholder $rest_base = preg_replace( '/\(\?P<([^>]+)>[^)]+\)/', '{$1}', $rest_base ); return rest_url( '/' . static::get_namespace() . '/' . $rest_base, $scheme ); } /** * Implementation of \Jet_Form_Builder\Rest_Api\Traits\Rest_Fetch_Endpoint */ public function get_rest_url(): string { return static::rest_url(); } public function get_rest_methods(): string { return static::get_methods(); } public static function get_endpoint(): array { return ( new Rest_Endpoint( new static() ) )->to_array(); } }