本文整理汇总了PHP中wp_kses_decode_entities函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_kses_decode_entities函数的具体用法?PHP wp_kses_decode_entities怎么用?PHP wp_kses_decode_entities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_kses_decode_entities函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: js_vars
static function js_vars()
{
$step_statuses = get_option(self::STEP_STATUS_KEY, array());
$started = get_option(self::STARTED_KEY, false);
$jetpack_config = array();
if (class_exists('Jetpack')) {
$jetpack_config = array('plugin_active' => true, 'configured' => Jetpack::is_active(), 'logo_url' => plugins_url('jetpack/images/jetpack-logo.png'), 'jumpstart_modules' => array_values(self::jumpstart_modules()), 'additional_modules' => array(), 'active_modules' => array_values(Jetpack::init()->get_active_modules()));
} else {
$jetpack_config = array('plugin_active' => false, 'configured' => false, 'logo_url' => '', 'jumpstart_modules' => array(), 'additional_modules' => array(), 'active_modules' => array());
}
// set the jetpack step status to "completed" if jetpack is active
if ($jetpack_config['configured']) {
$step_statuses['jetpack'] = array('completed' => true);
}
if (get_option('show_on_front') == 'page') {
if (get_option('page_for_posts') == 0 || get_option('page_for_posts') == null) {
$layout = 'website';
} else {
$layout = 'site-blog';
}
} else {
$layout = 'blog';
}
$themes = array_slice(array_map(array(__CLASS__, 'normalize_installed_theme'), wp_prepare_themes_for_js()), 0, self::MAX_THEMES);
return array('base_url' => JETPACK_START_BASE_URL, 'nonce' => wp_create_nonce(Jetpack_Start_EndPoints::AJAX_NONCE), 'debug' => WP_DEBUG ? true : false, 'bloginfo' => array('name' => wp_kses_decode_entities(stripslashes(get_bloginfo('name'))), 'description' => wp_kses_decode_entities(stripslashes(get_bloginfo('description')))), 'site_actions' => array('set_title' => 'jps_set_title', 'set_layout' => 'jps_set_layout', 'set_theme' => 'jps_set_theme', 'install_theme' => 'jps_install_theme', 'get_popular_themes' => 'jps_get_popular_themes', 'configure_jetpack' => 'jps_configure_jetpack', 'activate_jetpack_modules' => 'jps_activate_jetpack_modules', 'deactivate_jetpack_modules' => 'jps_deactivate_jetpack_modules', 'list_jetpack_modules' => 'jps_list_jetpack_modules', 'reset_data' => 'jps_reset_data'), 'step_actions' => array('start' => 'jps_started', 'view' => 'jps_step_view', 'skip' => 'jps_step_skip', 'complete' => 'jps_step_complete'), 'jetpack' => $jetpack_config, 'themes' => $themes, 'started' => $started, 'step_status' => $step_statuses, 'steps' => array('layout' => array('current' => $layout), 'advanced_settings' => array('jetpack_modules_url' => admin_url('admin.php?page=jetpack_modules'), 'widgets_url' => admin_url('widgets.php'), 'themes_url' => admin_url('themes.php'), 'plugins_url' => admin_url('plugins.php'), 'customize_url' => wp_customize_url(), 'new_blog_post_url' => admin_url('post-new.php'), 'manage_posts_url' => admin_url('edit.php'), 'new_page_url' => admin_url('post-new.php?post_type=page'), 'manage_pages_url' => admin_url('edit.php?post_type=page'))));
}
示例2: link_to_code_get_meta
/**
* Generated by the WordPress Meta Box generator
* at http://jeremyhixon.com/wp-tools/meta-box/
*/
function link_to_code_get_meta($value)
{
global $post;
$field = get_post_meta($post->ID, $value, true);
if (!empty($field)) {
return is_array($field) ? stripslashes_deep($field) : stripslashes(wp_kses_decode_entities($field));
} else {
return false;
}
}
示例3: genesis_get_custom_field
function genesis_get_custom_field($field)
{
global $post;
$custom_field = get_post_meta($post->ID, $field, true);
if ($custom_field) {
// sanitize and return the value of the custom field
return wp_kses_stripslashes(wp_kses_decode_entities($custom_field));
} else {
// return FALSE if custom field is empty
return FALSE;
}
}
示例4: etheme_get_custom_field
/**
* undocumented
*/
function etheme_get_custom_field($field)
{
global $post;
if (null === $post) {
return FALSE;
}
$custom_field = get_post_meta($post->ID, $field, true);
if ($custom_field) {
return stripslashes(wp_kses_decode_entities($custom_field));
} else {
return FALSE;
}
}
示例5: simplehooks_get_option
/**
* Pull an Simple Hooks option from the database, return value
*
* @since 0.1
*/
function simplehooks_get_option($hook = null, $field = null, $all = false)
{
static $options = array();
$options = $options ? $options : get_option(SIMPLEHOOKS_SETTINGS_FIELD);
if ($all) {
return $options;
}
if (!array_key_exists($hook, (array) $options)) {
return '';
}
$option = isset($options[$hook][$field]) ? $options[$hook][$field] : '';
return wp_kses_stripslashes(wp_kses_decode_entities($option));
}
示例6: get
public static function get($value, $id = null)
{
if (empty($id)) {
global $post;
$id = $post->ID;
}
$custom_field = get_post_meta($id, $value, true);
if (!empty($custom_field)) {
return is_array($custom_field) ? stripslashes_deep($custom_field) : stripslashes(wp_kses_decode_entities($custom_field));
} else {
return false;
}
}
示例7: aaron_get_meta
/**
* Thanks to http://jeremyhixon.com/tool/wordpress-meta-box-generator/
*/
function aaron_get_meta($value)
{
if (is_home()) {
$postid = get_option('page_for_posts');
} else {
$postid = get_the_ID();
}
$field = get_post_meta($postid, $value, true);
if (!empty($field)) {
return is_array($field) ? stripslashes_deep($field) : stripslashes(wp_kses_decode_entities($field));
} else {
return false;
}
}
示例8: accesspress_get_custom_field
/**
* Returns custom field post meta data.
*
* Return only the first value of custom field.
* Returns false if field is blank or not set.
*
* @since 0.1.0
*
* @global integer $id Post ID.
* @global stdClass $post Post object.
* @param string $field Custom field key.
* @return string|boolean Return value or false on failure.
*/
function accesspress_get_custom_field($field, $default = '')
{
global $id, $post;
if (null === $id && null === $post) {
return $default;
}
$post_id = null === $id ? $post->ID : $id;
$custom_field = get_post_meta($post_id, $field, true);
if ($custom_field) {
/** Sanitize and return the value of the custom field */
return stripslashes(wp_kses_decode_entities($custom_field));
}
/** Return $default if custom field is empty */
return $default;
}
示例9: etheme_get_custom_field
function etheme_get_custom_field($field, $postid = false)
{
global $post;
if (null === $post && !$postid) {
return FALSE;
}
if (!$postid) {
$postid = $post->ID;
}
$page_for_posts = get_option('page_for_posts');
$custom_field = get_post_meta($postid, $field, true);
if ($custom_field) {
return stripslashes(wp_kses_decode_entities($custom_field));
} else {
return FALSE;
}
}
示例10: calibrefx_get_custom_field
/**
* Get custom post meta option value
* @param string $field post meta key
* @return mixed post meta value
*/
function calibrefx_get_custom_field($field)
{
global $post;
if (null === $post) {
return false;
}
$custom_field = get_post_meta($post->ID, $field, true);
if ($custom_field) {
if (!is_array($custom_field)) {
/** sanitize and return the value of the custom field */
return stripslashes(wp_kses_decode_entities($custom_field));
}
return $custom_field;
} else {
/** return false if custom field is empty */
return false;
}
}
示例11: accesspress_get_custom_field
/**
* Returns custom field post meta data.
*
* Return only the first value of custom field.
* Returns false if field is blank or not set.
*
* @since 0.1.0
*
* @global integer $id Post ID.
* @global stdClass $post Post object.
* @param string $field Custom field key.
* @param string $default Default text to show if custom field is empty.
* @param integer $post_id The ID of the post to pull custom field data from.
* @return string|boolean Return value or false on failure.
*/
function accesspress_get_custom_field($field, $default = '', $post_id = null)
{
global $post;
$post_id = $post_id ? (int) $post_id : $post->ID;
if (!$post_id) {
return false;
}
/** Short-circuit this function */
$pre = apply_filters('accesspress_pre_get_custom_field_' . $field, null, $post_id);
if (null !== $pre) {
return $pre;
}
/** Default value */
$return = $default;
/** If custom field has value, assign it to $return */
if ($custom_field = get_post_meta($post_id, $field, true)) {
$return = stripslashes(wp_kses_decode_entities($custom_field));
}
/** Return $default if custom field is empty */
return apply_filters('accesspress_get_custom_field', $return, $field, $default, $post_id);
}
示例12: js_vars
static function js_vars()
{
$step_statuses = get_option(self::STEP_STATUS_KEY, array());
$started = get_option(self::STARTED_KEY, false);
$contact_page_id = get_option(self::CONTACTPAGE_ID_KEY, false);
if ($contact_page_id) {
$contact_page_info = self::contact_page_to_json($contact_page_id);
} else {
$contact_page_info = null;
}
$jetpack_config = array();
if (class_exists('Jetpack')) {
$jetpack_config = array('plugin_active' => true, 'configured' => Jetpack::is_active(), 'logo_url' => plugins_url('jetpack/images/jetpack-logo.png'), 'jumpstart_modules' => array_values(self::jumpstart_modules()), 'additional_modules' => array(), 'active_modules' => array_values(Jetpack::init()->get_active_modules()));
} else {
$jetpack_config = array('plugin_active' => false, 'configured' => false, 'logo_url' => '', 'jumpstart_modules' => array(), 'additional_modules' => array(), 'active_modules' => array());
}
// set the jetpack step status to "completed" if jetpack is active
if ($jetpack_config['configured']) {
$step_statuses['jetpack'] = array('completed' => true);
}
return array('base_url' => JETPACK_ONBOARDING_BASE_URL, 'site_url' => site_url(), 'nonce' => wp_create_nonce(Jetpack_Onboarding_EndPoints::AJAX_NONCE), 'debug' => WP_DEBUG ? true : false, 'bloginfo' => array('name' => wp_kses_decode_entities(stripslashes(get_bloginfo('name'))), 'description' => wp_kses_decode_entities(stripslashes(get_bloginfo('description')))), 'site_actions' => array('set_title' => 'jpo_set_title', 'set_layout' => 'jpo_set_layout', 'set_theme' => 'jpo_set_theme', 'install_theme' => 'jpo_install_theme', 'get_popular_themes' => 'jpo_get_popular_themes', 'configure_jetpack' => 'jpo_configure_jetpack', 'activate_jetpack_modules' => 'jpo_activate_jetpack_modules', 'deactivate_jetpack_modules' => 'jpo_deactivate_jetpack_modules', 'list_jetpack_modules' => 'jpo_list_jetpack_modules', 'reset_data' => 'jpo_reset_data', 'build_contact_page' => 'jpo_build_contact_page'), 'step_actions' => array('start' => 'jpo_started', 'disable' => 'jpo_disabled', 'view' => 'jpo_step_view', 'skip' => 'jpo_step_skip', 'complete' => 'jpo_step_complete'), 'jetpack' => $jetpack_config, 'started' => $started, 'step_status' => $step_statuses, 'steps' => array('layout' => self::get_layout(), 'contact_page' => $contact_page_info, 'advanced_settings' => array('jetpack_modules_url' => admin_url('admin.php?page=jetpack_modules'), 'jetpack_dash' => admin_url('admin.php?page=jetpack'), 'widgets_url' => admin_url('widgets.php'), 'themes_url' => admin_url('themes.php'), 'plugins_url' => admin_url('plugins.php'), 'customize_url' => wp_customize_url(), 'new_blog_post_url' => admin_url('post-new.php'), 'manage_posts_url' => admin_url('edit.php'), 'new_page_url' => admin_url('post-new.php?post_type=page'), 'manage_pages_url' => admin_url('edit.php?post_type=page'))));
}
示例13: caption_data
/**
* Retrieve the caption data.
*
* @param int $id The ID of the post or page for which we need the featured image caption.
*
* @return bool|array $caption If successful, the array of caption data. If unsuccessful, return false.
*/
public function caption_data($id)
{
// Get the caption data from the post meta
$caption = get_post_meta($id, '_' . CCFIC_KEY, true);
// If caption data is not present, return null
if (empty($caption)) {
return;
}
// Legacy support: if caption is a string, convert it to an array
if (is_string($caption)) {
$string = $caption;
$caption = array('caption_text' => $string);
}
// Unescape HTML characters
if (!empty($caption['caption_text'])) {
wp_kses_decode_entities($caption['caption_text']);
}
if (!empty($caption['source_text'])) {
wp_kses_decode_entities($caption['source_text']);
}
return $caption;
}
示例14: premise_get_option
/**
* Retrieve and return an option from the database.
*
* @since 2.1.0
*/
function premise_get_option($key, $setting = null)
{
/**
* Get setting. The default is set here, once, so it doesn't have to be
* repeated in the function arguments for accesspress_option() too.
*/
$setting = $setting ? $setting : PREMISE_SETTINGS_FIELD;
/** setup caches */
static $settings_cache = array();
static $options_cache = array();
/** Short circuit */
$pre = apply_filters('premise_pre_get_option_' . $key, false, $setting);
if (false !== $pre) {
return $pre;
}
/** Check options cache */
if (isset($options_cache[$setting][$key])) {
// option has been cached
return $options_cache[$setting][$key];
}
/** check settings cache */
if (isset($settings_cache[$setting])) {
// setting has been cached
$options = apply_filters('premise_options', $settings_cache[$setting], $setting);
} else {
// set value and cache setting
$options = $settings_cache[$setting] = apply_filters('premise_options', get_option($setting), $setting);
}
// check for non-existent option
if (!is_array($options) || !array_key_exists($key, (array) $options)) {
// cache non-existent option
$options_cache[$setting][$key] = '';
return '';
}
// option has been cached, cache option
$options_cache[$setting][$key] = is_array($options[$key]) ? stripslashes_deep($options[$key]) : stripslashes(wp_kses_decode_entities($options[$key]));
return $options_cache[$setting][$key];
}
示例15: genesis_extender_get_custom_css
/**
* Get the latest genesis_extender_custom_css array from the database
* and then cache it, if not otherwise specified, so specific
* Custom Options values (or the entire array) can be efficiently accessed.
*
* @since 1.0
* @return either the entire genesis_extender_custom_css array or a specific key/value.
*/
function genesis_extender_get_custom_css($key, $args = false)
{
static $options_cache = array();
static $options_set = false;
if ($args) {
if (empty($options_cache) || !$args['cached']) {
$options_cache = get_option('genesis_extender_custom_css');
}
if ($args['array']) {
return $options_cache;
} else {
return;
}
}
if (isset($options_cache[$key])) {
return is_array($options_cache[$key]) ? stripslashes_deep($options_cache[$key]) : stripslashes(wp_kses_decode_entities($options_cache[$key]));
} elseif ($options_set) {
$options_cache[$key] = '';
return $options_cache[$key];
} else {
$options_cache = get_option('genesis_extender_custom_css');
$options_set = true;
}
if (!isset($options_cache[$key])) {
$options_cache[$key] = '';
} else {
$options_cache[$key] = is_array($options_cache[$key]) ? stripslashes_deep($options_cache[$key]) : stripslashes(wp_kses_decode_entities($options_cache[$key]));
}
return $options_cache[$key];
}