PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 2.4.0
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v2.4.0
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 2.4.0, at admin/views/sp-framework/functions/validate.php

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