芝麻web文件管理V1.00
编辑当前文件:/home/ezdajrnh/www/wp-content/plugins/google-site-kit/includes/Core/Expirables/Expirable_Items.php
get(); $items[ $item ] = time() + $expires_in_seconds; $this->set( $items ); } /** * Removes one or more items from the list of expirable items. * * @since 1.128.0 * * @param string $item Item to remove. */ public function remove( $item ) { $items = $this->get(); // If the item is not in expirable items, there's nothing to do. if ( ! array_key_exists( $item, $items ) ) { return; } unset( $items[ $item ] ); $this->set( $items ); } /** * Gets the value of the setting. * * @since 1.128.0 * * @return array Value set for the option, or default if not set. */ public function get() { $value = parent::get(); return is_array( $value ) ? $value : $this->get_default(); } /** * Gets the expected value type. * * @since 1.128.0 * * @return string The type name. */ protected function get_type() { return 'array'; } /** * Gets the default value. * * @since 1.128.0 * * @return array The default value. */ protected function get_default() { return array(); } /** * Gets the callback for sanitizing the setting's value before saving. * * @since 1.128.0 * * @return callable Sanitize callback. */ protected function get_sanitize_callback() { return function ( $items ) { return $this->filter_expirable_items( $items ); }; } /** * Filters expirable items. * * @since 1.128.0 * * @param array $items Expirable items list. * @return array Filtered expirable items. */ private function filter_expirable_items( $items ) { $expirables = array(); if ( is_array( $items ) ) { foreach ( $items as $item => $ttl ) { if ( is_integer( $ttl ) ) { $expirables[ $item ] = $ttl; } } } return $expirables; } }