%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/helpers/
Upload File :
Create Path :
Current File : /var/www/html/shaban/laviva/wp-content/themes/levelup/inc/helpers/sanitize.php

<?php

// File Security Check
if ( ! defined( 'ABSPATH' ) ) { exit; }


function levelup_sanitize_flag( $flag = '' ) {
    return in_array($flag, array('1', 'true', 'y', 'on', 'yes'));
}

add_filter( 'levelup_sanitize_flag', 'levelup_sanitize_flag', 15 );


if ( ! function_exists( 'levelup_sanitize_enum' ) ) {

    function levelup_sanitize_enum( $val, $enum, $default_val = '' ) {
        if ( ! is_array( $enum ) ) {
            return $default_val;
        }

        return in_array( $val, $enum ) ? $val : $default_val;
    }

}


if ( ! function_exists( 'levelup_sanitize_explode_string' ) ) {

    function levelup_sanitize_explode_string( $val, $glue = ',' ) {
        return array_map( 'trim' , explode( $glue, $val ) );
    }

}


if ( ! function_exists( 'levelup_esc_implode' ) ) {

    function levelup_esc_implode( $glue, $array ) {

        if ( ! is_array( $array ) ) {
            $array = array( $array );
        }

        return esc_attr( implode( $glue, $array ) );
    }

}


if ( ! function_exists( 'levelup_remove_wpautop' ) ) {

    function levelup_remove_wpautop( $content, $autop = false ) {
        if ( $autop ) {
            $content = wpautop( preg_replace( '/<\/?p\>/', "\n", $content ) . "\n" );
        }
        return do_shortcode( shortcode_unautop( $content) );
    }

}


if ( ! function_exists( 'levelup_sanitize_px' ) ) {

    function levelup_sanitize_px( $value ) {

        $value = filter_var($value, FILTER_SANITIZE_NUMBER_INT);

        return $value;
    }

}


if ( ! function_exists( 'levelup_sanitize_quote1' ) ) {

    function levelup_sanitize_quote1( $value ) {

        $value = str_replace( "'", '&#039;', $value );

        return $value;
    }

}


Zerion Mini Shell 1.0