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

85 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 die; } // Cannot access directly.
11
12 if ( ! function_exists( 'spf_validate_email' ) ) {
13 /**
14 * Email validate
15 *
16 * @param string $value The email.
17 * @since 1.0.0
18 * @version 1.0.0
19 */
20 function spf_validate_email( $value ) {
21
22 if ( ! filter_var( $value, FILTER_VALIDATE_EMAIL ) ) {
23 return esc_html__( 'Please write a valid email address!', 'post-carousel' );
24 }
25
26 }
27 }
28
29
30 if ( ! function_exists( 'spf_validate_numeric' ) ) {
31 /**
32 *
33 * Numeric validate
34 *
35 * @param string $value The number.
36 * @since 1.0.0
37 * @version 1.0.0
38 */
39 function spf_validate_numeric( $value ) {
40
41 if ( ! is_numeric( $value ) ) {
42 return esc_html__( 'Please write a numeric data!', 'post-carousel' );
43 }
44
45 }
46 }
47
48
49 if ( ! function_exists( 'spf_validate_required' ) ) {
50 /**
51 *
52 * Required validate
53 *
54 * @param string $value The required data.
55 * @since 1.0.0
56 * @version 1.0.0
57 */
58 function spf_validate_required( $value ) {
59
60 if ( empty( $value ) ) {
61 return esc_html__( 'Error! This field is required!', 'post-carousel' );
62 }
63
64 }
65 }
66
67
68 if ( ! function_exists( 'spf_validate_url' ) ) {
69 /**
70 *
71 * URL validate
72 *
73 * @param string $value The URL.
74 * @since 1.0.0
75 * @version 1.0.0
76 */
77 function spf_validate_url( $value ) {
78
79 if ( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
80 return esc_html__( 'Please write a valid url!', 'post-carousel' );
81 }
82
83 }
84 }
85