Функция вызывается в плагине при установке.
При любых значения создает 2 метода GET. Аргументы передает верно. Вот мой пример
register_rest_route('wl/v1', '/updimg', array(
array(
'method' => WP_REST_Server::ALLMETHODS,
'callback' => 'wl_get_image',
'permission_callback' => true
),
array(
'method' => WP_REST_Server::EDITABLE,
'callback' => 'wl_posts_image',
'permission_callback' => true,
'args' => array(
'title' => array(
'required' => true,
'description' => __( 'The title for the object.', 'image-from-base64' ),
'type' => 'json'
)
)
)
))
-
Вопрос задан
-
77 просмотров