| Server IP : 216.238.66.20 / Your IP : 216.73.216.229 Web Server : nginx/1.30.4 System : Linux woropds 5.15.0-187-generic #197-Ubuntu SMP Fri Jul 17 19:17:01 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.2.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/sweetheart.mx/htdocs/wp-content/plugins/url-shortify/lite/includes/API/ |
Upload File : |
<?php
namespace KaizenCoders\URL_Shortify\API;
trait Schema {
/**
* Links Schema
*
* @since 1.9.5
* @return array[]
*
*/
public function links_schema() {
return [
'id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'slug' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'name' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'url' => [
'type' => 'string',
'sanitize_callback' => 'esc_url_raw',
],
'description' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'nofollow' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'track_me' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'sponsored' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'params_forwarding' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'params_structure' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'redirect_type' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'status' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'type' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'type_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'password' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'expires_at' => [
'type' => 'string',
'format' => 'date-time',
],
'cpt_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'cpt_type' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'rules' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'created_at' => [
'type' => 'string',
'format' => 'date-time',
],
'created_by_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'updated_at' => [
'type' => 'string',
'format' => 'date-time',
],
'updated_by_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
];
}
/**
* Create Link schema.
*
* @since 1.7.5
* @return array[]
*
*/
public function create_link_schema() {
return [
'url' => [
'type' => 'string',
'sanitize_callback' => 'esc_url_raw',
'required' => true,
],
];
}
/**
* Groups Schema.
*
* @since 1.13.1
* @return array[]
*/
public function groups_schema() {
return [
'id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'name' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'description' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'created_at' => [
'type' => 'string',
'format' => 'date-time',
],
'created_by_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'updated_at' => [
'type' => 'string',
'format' => 'date-time',
],
'updated_by_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
];
}
/**
* Create Group schema.
*
* @since 1.13.1
* @return array[]
*/
public function create_group_schema() {
return [
'name' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
'required' => true,
],
'description' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
];
}
/**
* Update Group schema.
*
* @since 1.13.1
* @return array[]
*/
public function update_group_schema() {
return [
'name' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'description' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
];
}
/**
* Tags Schema.
*
* @since 1.13.1
* @return array[]
*/
public function tags_schema() {
return [
'id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'name' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'description' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'created_at' => [
'type' => 'string',
'format' => 'date-time',
],
'created_by_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
'updated_at' => [
'type' => 'string',
'format' => 'date-time',
],
'updated_by_id' => [
'type' => 'integer',
'sanitize_callback' => 'absint',
],
];
}
/**
* Create Tag schema.
*
* @since 1.13.1
* @return array[]
*/
public function create_tag_schema() {
return [
'name' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
'required' => true,
],
'description' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
];
}
/**
* Update Tag schema.
*
* @since 1.13.1
* @return array[]
*/
public function update_tag_schema() {
return [
'name' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
'description' => [
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
],
];
}
}