Automattic\WooCommerce\Admin\API
ShippingPartnerSuggestions::get_suggestions()
Return suggested shipping partners.
Метод класса: ShippingPartnerSuggestions{}
Хуков нет.
Возвращает
\WP_Error|\WP_HTTP_Response|\WP_REST_Response
.
Использование
$ShippingPartnerSuggestions = new ShippingPartnerSuggestions(); $ShippingPartnerSuggestions->get_suggestions( $request );
- $request(WP_REST_Request) (обязательный)
- Full details about the request.
Код ShippingPartnerSuggestions::get_suggestions() ShippingPartnerSuggestions::get suggestions WC 9.2.3
public function get_suggestions( $request ) { $should_display = $this->should_display(); $force_default = $request->get_param( 'force_default_suggestions' ); if ( $should_display ) { return Suggestions::get_suggestions(); } elseif ( false === $should_display && true === $force_default ) { return rest_ensure_response( Suggestions::get_suggestions( DefaultShippingPartners::get_all() ) ); } return rest_ensure_response( Suggestions::get_suggestions( DefaultShippingPartners::get_all() ) ); }