Submit
Path:
~
/
home
/
getwphos
/
public_html
/
ccma
/
wp-content
/
plugins
/
curly-core
/
core-dashboard
/
File Content:
validation-rest.php
<?php if ( class_exists( 'CurlyCoreDashboardRestAPI' ) ) { class CurlyCoreDashboardThemeValidation extends CurlyCoreDashboardRestAPI { private static $instance; public function __construct() { parent::__construct(); $this->set_route( 'theme-validation' ); } /** * @return CurlyCoreDashboardRestAPI|CurlyCoreDashboardThemeValidation */ public static function get_instance() { if ( is_null( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } public function localize_script( $global ) { $global['validationThemeRoute'] = esc_attr( $this->get_namespace() . '/' . $this->get_route() ); return $global; } public function register_rest_api_route() { register_rest_route( $this->get_namespace(), $this->get_route(), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( CurlyCoreDashboard::get_instance(), 'theme_validation' ), 'permission_callback' => function () { return true; }, 'args' => array( 'options' => array( 'required' => true, 'validate_callback' => function ( $param, $request, $key ) { // Simple solution for validation can be 'is_array' value instead of callback function return is_array( $param ) ? $param : (array) strip_tags( $param ); }, 'description' => esc_html__( 'Options data is array with parameters', 'curly-core' ), ), ), ) ); } } CurlyCoreDashboardThemeValidation::get_instance(); }
Submit
FILE
FOLDER
Name
Size
Permission
Action
assets
---
0755
rest
---
0755
sub-pages
---
0755
templates
---
0755
core-dashboard.php
11552 bytes
0644
load.php
705 bytes
0644
registration-rest.php
1482 bytes
0644
validation-rest.php
1568 bytes
0644
N4ST4R_ID | Naxtarrr