# post-carousel/2.4.0/admin/views/sp-framework/functions/validate.php

Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog &amp; News, version 2.4.0. 77 lines.

- Page: https://pluginprobe.com/plugins/post-carousel/2.4.0/code/admin/views/sp-framework/functions/validate.php
- Raw: https://pluginprobe.com/plugins/post-carousel/2.4.0/raw/admin/views/sp-framework/functions/validate.php
- Modified: 2021-10-19T08:27:30+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/post-carousel/2.4.0/code/admin/views/sp-framework/functions/validate.php#L10-L20`.

```php
<?php if ( ! defined( 'ABSPATH' ) ) {
	die; } // Cannot access directly.

if ( ! function_exists( 'spf_validate_email' ) ) {
	/**
	 * Email validate
	 *
	 * @param string $value The email.
	 * @since 1.0.0
	 * @version 1.0.0
	 */
	function spf_validate_email( $value ) {

		if ( ! filter_var( $value, FILTER_VALIDATE_EMAIL ) ) {
			return esc_html__( 'Please write a valid email address!', 'smart-post-show' );
		}

	}
}


if ( ! function_exists( 'spf_validate_numeric' ) ) {
	/**
	 *
	 * Numeric validate
	 *
	 * @param string $value The number.
	 * @since 1.0.0
	 * @version 1.0.0
	 */
	function spf_validate_numeric( $value ) {

		if ( ! is_numeric( $value ) ) {
			return esc_html__( 'Please write a numeric data!', 'smart-post-show' );
		}

	}
}


if ( ! function_exists( 'spf_validate_required' ) ) {
	/**
	 *
	 * Required validate
	 *
	 * @param string $value The required data.
	 * @since 1.0.0
	 * @version 1.0.0
	 */
	function spf_validate_required( $value ) {

		if ( empty( $value ) ) {
			return esc_html__( 'Error! This field is required!', 'smart-post-show' );
		}

	}
}


if ( ! function_exists( 'spf_validate_url' ) ) {
	/**
	 *
	 * URL validate
	 *
	 * @param string $value The URL.
	 * @since 1.0.0
	 * @version 1.0.0
	 */
	function spf_validate_url( $value ) {

		if ( ! filter_var( $value, FILTER_VALIDATE_URL ) ) {
			return esc_html__( 'Please write a valid url!', 'smart-post-show' );
		}

	}
}

```
