PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.3
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.3
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / admin / views / sp-framework / functions / validate.php

validate.php in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.3, at admin/views/sp-framework/functions/validate.php

86 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The admin validate functions file.
4 *
5 * @package Smart_Post_Show
6 * @subpackage Smart_Post_Show/admin/views
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12
13 if ( ! function_exists( 'spf_validate_email' ) ) {
14 /**
15 * Email validate
16 *
17 * @param string $value The email.
18 * @since 1.0.0
19 * @version 1.0.0
20 */
21 function spf_validate_email( $value ) {
22
23 if ( ! filter_var( $value, FILTER_VALIDATE_EMAIL ) ) {
24 return esc_html__( 'Please write a valid email address!', 'post-carousel' );
25 }
26
27 }
28 }
29
30
31 if ( ! function_exists( 'spf_validate_numeric' ) ) {
32 /**
33 *
34 * Numeric validate
35 *
36 * @param string $value The number.
37 * @since 1.0.0
38 * @version 1.0.0
39 */
40 function spf_validate_numeric( $value ) {
41
42 if ( ! is_numeric( $value ) ) {
43 return esc_html__( 'Please write a numeric data!', 'post-carousel' );
44 }
45
46 }
47 }
48
49
50 if ( ! function_exists( 'spf_validate_required' ) ) {
51 /**
52 *
53 * Required validate
54 *
55 * @param string $value The required data.
56 * @since 1.0.0
57 * @version 1.0.0
58 */
59 function spf_validate_required( $value ) {
60
61 if ( empty( $value ) ) {
62 return esc_html__( 'Error! This field is required!', 'post-carousel' );
63 }
64
65 }
66 }
67
68
69 if ( ! function_exists( 'spf_validate_url' ) ) {
70 /**
71 *
72 * URL validate
73 *
74 * @param string $value The URL.
75 * @since 1.0.0
76 * @version 1.0.0
77 */
78 function spf_validate_url( $value ) {
79
80 if ( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
81 return esc_html__( 'Please write a valid url!', 'post-carousel' );
82 }
83
84 }
85 }
86