/var/www/wp2.qr4y.com/www/wp-content/plugins/elementor/modules/checklist/data/endpoints
Edit: /var/www/wp2.qr4y.com/www/wp-content/plugins/elementor/modules/checklist/data/endpoints/steps.php (1541B)
get_checklist_data();
}
public function update_item( $id, $request ) {
$checklist_module = Checklist_Module::instance();
$step = $checklist_module->get_steps_manager()->get_step_by_id( $id );
$step->update_step( $request->get_json_params() );
return [
'data' => 'success',
];
}
private function get_checklist_data(): array {
$checklist_module = Checklist_Module::instance();
$steps_data = $checklist_module->get_steps_manager()->get_steps_for_frontend();
return [
'data' => $steps_data,
];
}
protected function register() {
parent::register();
$this->register_item_route();
$this->register_item_route( \WP_REST_Server::EDITABLE, [
'id_arg_name' => 'id',
'id_arg_type_regex' => '[\w\-\_]+',
'id' => [
'type' => 'string',
'description' => 'The step id.',
'required' => true,
'validate_callback' => function ( $step_id ) {
return in_array( $step_id, Steps_Manager::get_step_ids() );
},
],
] );
}
}