??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/monicslandscape.co.uk/wp-content/themes/wise-news/inc/sanitize-callback.php
⬅ Kembali
<?php
/**
* Artify Themes
*
* @package Wise News
* Sanitization callbacks.
*/
/**
* Checkbox sanitization callback example.
*
* Sanitization callback for 'checkbox' type controls. This callback sanitizes `$checked`
* as a boolean value, either TRUE or FALSE.
*
* @param bool $checked Whether the checkbox is checked.
* @return bool Whether the checkbox is checked.
*/
function wise_news_sanitize_checkbox( $checked ) {
// Boolean check.
return ( ( isset( $checked ) && true == $checked ) ? true : false );
}
/**
* HEX Color sanitization callback example.
* - Sanitization: hex_color
* - Control: text, WP_Customize_Color_Control
*/
function wise_news_sanitize_hex_color( $hex_color, $setting ) {
// Sanitize $input as a hex value without the hash prefix.
$hex_color = sanitize_hex_color( $hex_color );
// If $input is a valid hex value, return it; otherwise, return the default.
return ( ! is_null( $hex_color ) ? $hex_color : $setting->default );
}
/**
* Image sanitization callback example.
*
* Checks the image's file extension and mime type against a whitelist. If they're allowed,
* send back the filename, otherwise, return the setting default.
*
* - Sanitization: image file extension
* - Control: text, WP_Customize_Image_Control
*/
function wise_news_sanitize_image( $image, $setting ) {
/*
* Array of valid image file types.
*
* The array includes image mime types that are included in wp_get_mime_types()
*/
$mimes = array(
'jpg|jpeg|jpe' => 'image/jpeg',
'gif' => 'image/gif',
'png' => 'image/png',
'bmp' => 'image/bmp',
'tif|tiff' => 'image/tiff',
'ico' => 'image/x-icon',
'svg' => 'image/svg+xml',
);
// Return an array with file extension and mime_type.
$file = wp_check_filetype( $image, $mimes );
// If $image has a valid mime_type, return it; otherwise, return the default.
return ( $file['ext'] ? $image : $setting->default );
}
/**
* Select sanitization callback example.
*
* - Sanitization: select
* - Control: select, radio
*/
function wise_news_sanitize_select( $input, $setting ) {
// Ensure input is a slug.
$input = sanitize_key( $input );
// Get list of choices from the control associated with the setting.
$choices = $setting->manager->get_control( $setting->id )->choices;
// If the input is a valid key, return it; otherwise, return the default.
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
/**
* Drop-down Pages sanitization callback example.
*
* - Sanitization: dropdown-pages
* - Control: dropdown-pages
*/
function wise_news_sanitize_dropdown_pages( $page_id, $setting ) {
// Ensure $input is an absolute integer.
$page_id = absint( $page_id );
// If $page_id is an ID of a published page, return it; otherwise, return the default.
return ( 'publish' == get_post_status( $page_id ) ? $page_id : $setting->default );
}
/**
* Number Range sanitization callback example.
* - Sanitization: number_range
* - Control: number, tel
*/
function wise_news_sanitize_number_range( $number, $setting ) {
// Ensure input is an absolute integer.
$number = absint( $number );
// Get the input attributes associated with the setting.
$atts = $setting->manager->get_control( $setting->id )->input_attrs;
// Get minimum number in the range.
$min = ( isset( $atts['min'] ) ? $atts['min'] : $number );
// Get maximum number in the range.
$max = ( isset( $atts['max'] ) ? $atts['max'] : $number );
// Get step.
$step = ( isset( $atts['step'] ) ? $atts['step'] : 1 );
// If the number is within the valid range, return it; otherwise, return the default
return ( $min <= $number && $number <= $max && is_int( $number / $step ) ? $number : $setting->default );
}
/**
* HTML sanitization callback example.
*
* - Sanitization: html
* - Control: text, textarea
*
* @param string $html HTML to sanitize.
* @return string Sanitized HTML.
*/
function wise_news_sanitize_html( $html ) {
return wp_filter_post_kses( $html );
}
// font sanitization.
function wise_news_sanitize_google_fonts( $input, $setting ) {
// Get list of choices from the control associated with the setting.
$choices = $setting->manager->get_control( $setting->id )->choices;
// If the input is a valid key, return it; otherwise, return the default.
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
Nama
Tipe
Ukuran
Diubah
Aksi
📁 custom-widgets
dir
—
2026-05-28 06:14
📁 customizer-settings
dir
—
2026-05-28 06:14
📁 frontpage-sections
dir
—
2026-05-28 06:14
📁 tgmpa
dir
—
2026-05-28 06:14
📄 .htaccess
htaccess
420 B
2026-05-28 06:14
🐘 body-classes.php
php
611 B
2026-05-25 23:52
🐘 class-breadcrumb-trail.php
php
40.6 KB
2026-05-25 23:52
🐘 custom-fonts.php
php
1.4 KB
2026-05-25 23:52
🐘 custom-header.php
php
1.9 KB
2026-05-25 23:52
🐘 custom-style.php
php
1.5 KB
2026-05-25 23:52
🐘 enqueue.php
php
1.3 KB
2026-05-25 23:52
🐘 jetpack.php
php
1.1 KB
2026-05-25 23:52
🐘 require.php
php
1.3 KB
2026-05-25 23:52
🐘 sanitize-callback.php
php
4.5 KB
2026-05-25 23:52
🐘 template-functions.php
php
6.8 KB
2026-05-25 23:52
🐘 template-tags.php
php
4.9 KB
2026-05-25 23:52
🐘 wptt-webfont-loader.php
php
17.5 KB
2026-05-25 23:52