WPCF7_REST_Controller::get_refill
Метод класса: WPCF7_REST_Controller{}
Хуки из метода
Возвращает
null. Ничего (null).
Использование
$WPCF7_REST_Controller = new WPCF7_REST_Controller(); $WPCF7_REST_Controller->get_refill( $request );
- $request(WP_REST_Request) (обязательный)
- .
Код WPCF7_REST_Controller::get_refill() WPCF7 REST Controller::get refill CF7 6.1.5
public function get_refill( WP_REST_Request $request ) {
$id = (int) $request->get_param( 'id' );
$item = wpcf7_contact_form( $id );
if ( ! $item ) {
return new WP_Error( 'wpcf7_not_found',
__( 'The requested contact form was not found.', 'contact-form-7' ),
array( 'status' => 404 )
);
}
$response = wpcf7_apply_filters_deprecated(
'wpcf7_ajax_onload',
array( array() ),
'5.2',
'wpcf7_refill_response'
);
$response = apply_filters( 'wpcf7_refill_response', array() );
return rest_ensure_response( $response );
}