さて、あなたが亡くなってから、どれほどの年月が経ったことでしょう。かつてあなたと共に歩んだ者たちは皆、富と権力を手に入れ、またある者は跡形もなく消え去りました。如雲兄弟は時代の流れに逆らえず、人々は彼らが偉大な業績を成し遂げることを期待しています。そして、あなたの孫たちは皆、傑出した人物であり、『詩経』と『書経』の影響力を示しています。『詩経』にはこうあります。「今日から、豊作の年となりますように。徳のある者は子孫に穀物を残すことができますように。なんと喜ばしいことでしょう!」私は周王朝において、これを目の当たりにしました。
<?php
/**
* Sanitize Functions
*
* Used to validate the user input of the theme settings
* Based on https://github.com/WPTRT/code-examples/blob/master/customizer/sanitization-callbacks.php
*
* @package Nisarg
* @since 1.5
*/
/**
* Sanitize Radio Control Setting
* @since 1.5
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
function nisarg_sanitize_radio( $input, $setting ) {
//input must be a slug: lowercase alphanumeric characters, dashes and underscores are allowed only
$input = sanitize_key($input);
//get the list of possible radio box options
$choices = $setting->manager->get_control( $setting->id )->choices;
//return input if valid or return default option
return ( array_key_exists( $input, $choices ) ? $input : $setting->default );
}
/**
* Sanitize Checkbox Control Setting
* @since 1.6
*/
function nisarg_sanitize_checkbox( $input ){
// Boolean check.
return ( ( isset( $input ) && true === $input ) ? true : false );
}
/**
* Sanitize Select Control Setting
* @since 1.6
*/
function nisarg_sanitize_select( $input, $setting ) {
// get all select options
$options = $setting->manager->get_control( $setting->id )->choices;
// return default if not valid
return ( array_key_exists( $input, $options ) ? $input : $setting->default );
}
/**
* Integer sanitization
*
* @param string Input value to check
* @return integer Returned positive integer value
* @since 1.6
*/
if ( ! function_exists( 'nisarg_sanitize_unsigned_integer' ) ) {
function nisarg_sanitize_unsigned_integer( $input ) {
return absint( $input );
}
}
/**
* Integer sanitization
*
* @param string Input value to check
* @return integer Returned integer value
* @since 1.6
*/
if ( ! function_exists( 'nisarg_sanitize_integer' ) ) {
function nisarg_sanitize_integer( $input ) {
return intval( $input );
}
}
if ( ! function_exists( 'nisarg_sanitize_unsigned_floatval' ) ) {
/**
* Sanitize integers that can use decimals.
*
*/
function nisarg_sanitize_unsigned_floatval( $input ) {
return abs( floatval( $input ) );
}
}
if ( ! function_exists( 'nisarg_sanitize_floatval' ) ) {
/**
* Sanitize integers that can use decimals.
* @since 1.6
*/
function nisarg_sanitize_floatval( $input ) {
return floatval( $input );
}
}