PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.0
Elementor Website Builder – more than just a page builder v4.2.0
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / settings / validations.php

validations.php in Elementor Website Builder – more than just a page builder 4.2.0, at includes/settings/validations.php

93 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor settings validations.
10 *
11 * Elementor settings validations handler class is responsible for validating settings
12 * fields.
13 *
14 * @since 1.0.0
15 */
16 class Settings_Validations {
17
18 /**
19 * Validate HTML field.
20 *
21 * Sanitize content for allowed HTML tags and remove backslashes before quotes.
22 *
23 * @since 1.0.0
24 * @access public
25 * @static
26 *
27 * @param string $input Input field.
28 *
29 * @return string Input field.
30 */
31 public static function html( $input ) {
32 return stripslashes( wp_filter_post_kses( addslashes( $input ) ) );
33 }
34
35 /**
36 * Validate checkbox list.
37 *
38 * Make sure that an empty checkbox list field will return an array.
39 *
40 * @since 1.0.0
41 * @access public
42 * @static
43 *
44 * @param mixed $input Input field.
45 *
46 * @return mixed Input field.
47 */
48 public static function checkbox_list( $input ) {
49 if ( empty( $input ) ) {
50 $input = [];
51 }
52
53 return $input;
54 }
55
56 /**
57 * Current Time
58 *
59 * Used to return current time
60 *
61 * @since 2.5.0
62 * @access public
63 * @static
64 *
65 * @param mixed $input Input field.
66 *
67 * @return int
68 */
69 public static function current_time( $input ) {
70 return time();
71 }
72
73 /**
74 * Clear cache.
75 *
76 * Delete post meta containing the post CSS file data. And delete the actual
77 * CSS files from the upload directory.
78 *
79 * @since 1.4.8
80 * @access public
81 * @static
82 *
83 * @param mixed $input Input field.
84 *
85 * @return mixed Input field.
86 */
87 public static function clear_cache( $input ) {
88 Plugin::$instance->files_manager->clear_cache();
89
90 return $input;
91 }
92 }
93