• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_filter_nohtml_kses函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wp_filter_nohtml_kses函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_filter_nohtml_kses函数的具体用法?PHP wp_filter_nohtml_kses怎么用?PHP wp_filter_nohtml_kses使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wp_filter_nohtml_kses函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: subscribe

 function subscribe()
 {
     global $videotube;
     $name = wp_filter_nohtml_kses($_POST['name']);
     $email = wp_filter_nohtml_kses($_POST['email']);
     $agree = wp_filter_nohtml_kses($_POST['agree']);
     $referer = wp_filter_nohtml_kses($_POST['referer']);
     $role = isset($videotube['subscribe_roles']) ? $videotube['subscribe_roles'] : 'subscriber';
     if (!$name) {
         echo json_encode(array('resp' => 'error', 'message' => __('Please enter your name.', 'mars'), 'id' => 'name'));
         exit;
     }
     if (!$email || !is_email($email)) {
         echo json_encode(array('resp' => 'error', 'message' => __('Please enter a valid email address.', 'mars'), 'id' => 'email'));
         exit;
     }
     if ($agree != true || $agree != 'true') {
         echo json_encode(array('resp' => 'error', 'message' => __('Please agree with our Private Policy.', 'mars'), 'id' => 'agree'));
         exit;
     }
     $user_id = wp_insert_user(array('user_login' => $email, 'user_email' => $email, 'display_name' => $name, 'user_pass' => wp_generate_password(6, true), 'role' => $role));
     if (is_wp_error($user_id)) {
         echo json_encode(array('resp' => 'error', 'message' => $user_id->get_error_message()));
         exit;
     }
     update_user_meta($user_id, 'referer', $referer);
     echo json_encode(array('resp' => 'success', 'message' => __('Congratulation.', 'mars'), 'redirect_to' => get_permalink($referer)));
     exit;
 }
开发者ID:chypriote,项目名称:wp-video,代码行数:29,代码来源:Mars_Subscribe_Ajax.php


示例2: gardenia_option_validate

function gardenia_option_validate($input)
{
    $input['logo'] = esc_url_raw($input['logo']);
    $input['favicon'] = esc_url_raw($input['favicon']);
    $input['footertext'] = sanitize_text_field($input['footertext']);
    $input['email'] = sanitize_email($input['email']);
    $input['phone'] = wp_filter_nohtml_kses($input['phone']);
    $input['home-title'] = sanitize_text_field($input['home-title']);
    $input['home-content'] = sanitize_text_field($input['home-content']);
    $input['post-title'] = sanitize_text_field($input['post-title']);
    $input['post-content'] = sanitize_text_field($input['post-content']);
    $input['twitter'] = esc_url_raw($input['twitter']);
    $input['fburl'] = esc_url_raw($input['fburl']);
    $input['pinterest'] = esc_url_raw($input['pinterest']);
    $input['linkedin'] = esc_url_raw($input['linkedin']);
    $input['gplus'] = esc_url_raw($input['gplus']);
    $input['rss'] = esc_url_raw($input['rss']);
    for ($gardenia_i = 1; $gardenia_i <= 5; $gardenia_i++) {
        $input['slider-img-' . $gardenia_i] = esc_url_raw($input['slider-img-' . $gardenia_i]);
        $input['slidelink-' . $gardenia_i] = esc_url_raw($input['slidelink-' . $gardenia_i]);
    }
    for ($gardenia_section_i = 1; $gardenia_section_i <= 4; $gardenia_section_i++) {
        $input['home-icon-' . $gardenia_section_i] = esc_url_raw($input['home-icon-' . $gardenia_section_i]);
        $input['section-title-' . $gardenia_section_i] = sanitize_text_field($input['section-title-' . $gardenia_section_i]);
        $input['section-content-' . $gardenia_section_i] = sanitize_text_field($input['section-content-' . $gardenia_section_i]);
        $input['section-link-' . $gardenia_section_i] = esc_url_raw($input['section-link-' . $gardenia_section_i]);
    }
    return $input;
}
开发者ID:jasmun,项目名称:Noco100,代码行数:29,代码来源:theme-options.php


示例3: validate_options

 /**
  * @param $input
  * @todo streamline validation/sanitization work, replace deprecated function calls
  */
 public function validate_options($input)
 {
     $teccc = $this->teccc;
     foreach ($teccc->terms as $attributes) {
         $slug = $attributes[Main::SLUG];
         // Sanitize textbox input (strip html tags, and escape characters)
         // May not be needed with jQuery color picker
         $input[$slug . '-background'] = wp_filter_nohtml_kses($input[$slug . '-background']);
         $input[$slug . '-background'] = preg_replace('[^#A-Za-z0-9]', '', $input[$slug . '-background']);
         if ($input[$slug . '-background'] == '') {
             $input[$slug . '-background'] = '#CFCFCF';
         }
         $input[$slug . '-border'] = wp_filter_nohtml_kses($input[$slug . '-border']);
         $input[$slug . '-border'] = preg_replace('[^#A-Za-z0-9]', '', $input[$slug . '-border']);
         if ($input[$slug . '-border'] == '') {
             $input[$slug . '-border'] = '#CFCFCF';
         }
         // Sets value when checked
         if (isset($input[$slug . '-border_transparent'])) {
             $input[$slug . '-border'] = 'transparent';
         }
         if (isset($input[$slug . '-background_transparent'])) {
             $input[$slug . '-background'] = 'transparent';
         }
         // Sanitize dropdown input (make sure value is one of options allowed)
         if (!in_array($input[$slug . '-text'], $teccc->text_colors, true)) {
             $input[$slug . '-text'] = '#000';
         }
     }
     return $input;
 }
开发者ID:acutedeveloper,项目名称:havering-intranet-development,代码行数:35,代码来源:Admin.php


示例4: ale_send_contact

/**
 * Send Contact Message
 * 
 * @param array $data
 * @return mixed
 * @throws Exception 
 */
function ale_send_contact($data)
{
    $return = true;
    try {
        if (!wp_verify_nonce($_REQUEST['_wpnonce'])) {
            throw new Exception('Something went wrong. Please refresh the page and try again.');
        }
        foreach ($data as $k => $val) {
            $data[$k] = wp_filter_nohtml_kses(trim($val));
        }
        if (!$data['name']) {
            throw new Exception('Please enter your name.');
        }
        if (!is_email($data['email'])) {
            throw new Exception('Please enter a valid email address.');
        }
        if (!$data['message']) {
            throw new Exception('Please enter your message.');
        }
        do_action('ale_contact_form_send', $data);
        $redirectUrl = get_permalink();
        $redirectUrl = substr_count($redirectUrl, '?') ? '&success' : '?success';
        wp_redirect($redirectUrl);
        exit;
    } catch (Exception $e) {
        $return = array('error' => 1, 'msg' => $e->getMessage());
    }
    return $return;
}
开发者ID:BMNTeam,项目名称:myFirstThemeToTf,代码行数:36,代码来源:contact.php


示例5: ft_options_validate

function ft_options_validate($input)
{
    $input['logo'] = esc_url_raw($input['logo']);
    $input['favicon'] = esc_url_raw($input['favicon']);
    $input['footertext'] = wp_filter_nohtml_kses($input['footertext']);
    return $input;
}
开发者ID:se7ven214,项目名称:Kungfuphp.local,代码行数:7,代码来源:fasterthemes.php


示例6: ar_options_validate

function ar_options_validate($input)
{
    $input['logo'] = esc_url_raw($input['logo']);
    $input['fevicon'] = esc_url_raw($input['fevicon']);
    $input['footertext'] = wp_filter_nohtml_kses($input['footertext']);
    $input['customcss'] = esc_html($input['customcss']);
    $input['slide1title'] = wp_filter_nohtml_kses($input['slide1title']);
    $input['slide1subtitle'] = wp_filter_nohtml_kses($input['slide1subtitle']);
    $input['slide1image'] = esc_url_raw($input['slide1image']);
    $input['slide2title'] = wp_filter_nohtml_kses($input['slide2title']);
    $input['slide2subtitle'] = wp_filter_nohtml_kses($input['slide2subtitle']);
    $input['slide2image'] = esc_url_raw($input['slide2image']);
    $input['msheading'] = wp_filter_nohtml_kses($input['msheading']);
    $input['msheadingdes'] = wp_filter_nohtml_kses($input['msheadingdes']);
    $input['sicon1'] = wp_filter_nohtml_kses($input['sicon1']);
    $input['fstitle'] = wp_filter_nohtml_kses($input['fstitle']);
    $input['fdtitle'] = wp_filter_nohtml_kses($input['fdtitle']);
    $input['sicon2'] = wp_filter_nohtml_kses($input['sicon2']);
    $input['sstitle'] = wp_filter_nohtml_kses($input['sstitle']);
    $input['sdtitle'] = wp_filter_nohtml_kses($input['sdtitle']);
    $input['sicon3'] = wp_filter_nohtml_kses($input['sicon3']);
    $input['sstitle3'] = wp_filter_nohtml_kses($input['sstitle3']);
    $input['sdtitle3'] = wp_filter_nohtml_kses($input['sdtitle3']);
    $input['blogh'] = wp_filter_nohtml_kses($input['blogh']);
    $input['bloghdd'] = wp_filter_nohtml_kses($input['bloghdd']);
    return $input;
}
开发者ID:greg3560,项目名称:wp-plugin,代码行数:27,代码来源:ariniothemes.php


示例7: validateOptions

 private function validateOptions()
 {
     return function ($input) {
         $input['footer_copyright'] = wp_filter_nohtml_kses($input['footer_copyright']);
         return $input;
     };
 }
开发者ID:hasangilak,项目名称:wp-semi-laravel,代码行数:7,代码来源:Setting.php


示例8: plugin_options_validate

function plugin_options_validate($input)
{
    // Check our textbox option field contains no HTML tags - if so strip them out
    $input['text_string'] = wp_filter_nohtml_kses($input['text_string']);
    return $input;
    // return validated input
}
开发者ID:hkarriche,项目名称:wordpress,代码行数:7,代码来源:ex-settings.php


示例9: save_scrib_opts

 public function save_scrib_opts($input)
 {
     $r['browseid'] = absint($input['browseid']);
     $r['searchprompt'] = wp_filter_nohtml_kses($input['searchprompt']);
     $r['facetfound'] = absint($input['facetfound']);
     return $r;
 }
开发者ID:nrporter,项目名称:scriblio,代码行数:7,代码来源:compatibility.php


示例10: vimeography_validate_advanced_settings

 public function vimeography_validate_advanced_settings($input)
 {
     $output['client_id'] = wp_filter_nohtml_kses($input['client_id']);
     $output['client_secret'] = wp_filter_nohtml_kses($input['client_secret']);
     $output['access_token'] = wp_filter_nohtml_kses($input['access_token']);
     $output['access_token_secret'] = wp_filter_nohtml_kses($input['access_token_secret']);
     if ($output['client_id'] == '' || $output['client_secret'] == '' || $output['access_token'] == '' || $output['access_token_secret'] == '') {
         add_settings_error('vimeography_advanced_settings', 'required', __('Whoops! Make sure you fill out all of the Vimeo tokens!'));
         return FALSE;
     }
     require_once VIMEOGRAPHY_PATH . 'lib/vimeo-advanced-api-library.php';
     if (class_exists('phpVimeo')) {
         $vimeo = new phpVimeo($output['client_id'], $output['client_secret'], $output['access_token'], $output['access_token_secret']);
     }
     // Do an authenticated call
     try {
         $data = $vimeo->call('vimeo.oauth.checkAccessToken');
         if (!$data) {
             add_settings_error('vimeography_advanced_settings', 'invalid', __('Woah! Looks like the Vimeo API is having some issues right now. Try this again in a little bit.'));
             return FALSE;
         }
         $string = __('Success! Your Vimeo tokens for ') . $data->oauth->user->username . __(' have been added and saved.');
         // not actually an error, function name is misleading
         add_settings_error('vimeography_advanced_settings', 'valid', $string, 'updated');
         $output['active'] = TRUE;
         return $output;
     } catch (VimeoAPIException $e) {
         //add_settings_error( 'vimeography_advanced_settings', $e->getCode(), "Encountered an API error -- ".$e->getMessage());
         add_settings_error('vimeography_advanced_settings', $e->getCode(), "Uh oh! Your Vimeo tokens didn't validate. Try again, and double check that all of your tokens are in the correct fields!");
         return FALSE;
     }
 }
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:32,代码来源:pro.php


示例11: edit_user_profile

 /**
  * Editing a user profile.
  * @param WP_User $user
  */
 public static function edit_user_profile($user)
 {
     global $wpdb;
     if (current_user_can(GROUPS_ADMINISTER_GROUPS)) {
         $output = '<h3>' . __('Groups', GROUPS_PLUGIN_DOMAIN) . '</h3>';
         $user = new Groups_User($user->ID);
         $user_groups = $user->groups;
         $groups_table = _groups_get_tablename('group');
         if ($groups = $wpdb->get_results("SELECT * FROM {$groups_table} ORDER BY name")) {
             $output .= '<ul>';
             foreach ($groups as $group) {
                 $is_member = Groups_User_Group::read($user->ID, $group->group_id) ? true : false;
                 $output .= '<li>';
                 $output .= '<label>';
                 $output .= sprintf('<input type="checkbox" name="group_ids[]" value="%d" %s />', Groups_Utility::id($group->group_id), $is_member ? ' checked="checked" ' : '');
                 $output .= ' ';
                 $output .= wp_filter_nohtml_kses($group->name);
                 $output .= '</label>';
                 $output .= '</li>';
             }
             $output .= '</ul>';
         }
     }
     echo $output;
 }
开发者ID:johangas,项目名称:moped,代码行数:29,代码来源:class-groups-admin-user-profile.php


示例12: groups_admin_groups_add

/**
 * Show add group form.
 */
function groups_admin_groups_add()
{
    global $wpdb;
    if (!current_user_can(GROUPS_ADMINISTER_GROUPS)) {
        wp_die(__('Access denied.', GROUPS_PLUGIN_DOMAIN));
    }
    $current_url = (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $current_url = remove_query_arg('paged', $current_url);
    $current_url = remove_query_arg('action', $current_url);
    $current_url = remove_query_arg('group_id', $current_url);
    $parent_id = isset($_POST['parent-id-field']) ? $_POST['parent-id-field'] : '';
    $name = isset($_POST['name-field']) ? $_POST['name-field'] : '';
    $description = isset($_POST['description-field']) ? $_POST['description-field'] : '';
    $group_table = _groups_get_tablename('group');
    $parent_select = '<select name="parent-id-field">';
    $parent_select .= '<option value="">--</option>';
    $groups = $wpdb->get_results("SELECT * FROM {$group_table}");
    foreach ($groups as $group) {
        $parent_select .= '<option value="' . esc_attr($group->group_id) . '">' . wp_filter_nohtml_kses($group->name) . '</option>';
    }
    $parent_select .= '</select>';
    $output = '<div class="manage-groups">' . '<div>' . '<h2>' . __('Add a new group', GROUPS_PLUGIN_DOMAIN) . '</h2>' . '</div>' . '<form id="add-group" action="' . $current_url . '" method="post">' . '<div class="group new">' . '<div class="field">' . '<label for="name-field" class="field-label first required">' . __('Name', GROUPS_PLUGIN_DOMAIN) . '</label>' . '<input id="name-field" name="name-field" class="namefield" type="text" value="' . esc_attr($name) . '"/>' . '</div>' . '<div class="field">' . '<label for="parent-id-field" class="field-label">' . __('Parent', GROUPS_PLUGIN_DOMAIN) . '</label>' . $parent_select . '</div>' . '<div class="field">' . '<label for="description-field" class="field-label description-field">' . __('Description', GROUPS_PLUGIN_DOMAIN) . '</label>' . '<textarea id="description-field" name="description-field" rows="5" cols="45">' . wp_filter_nohtml_kses($description) . '</textarea>' . '</div>' . '<div class="field">' . wp_nonce_field('groups-add', GROUPS_ADMIN_GROUPS_NONCE, true, false) . '<input class="button" type="submit" value="' . __('Add', GROUPS_PLUGIN_DOMAIN) . '"/>' . '<input type="hidden" value="add" name="action"/>' . '<a class="cancel" href="' . $current_url . '">' . __('Cancel', GROUPS_PLUGIN_DOMAIN) . '</a>' . '</div>' . '</div>' . '</form>' . '</div>';
    // .manage-groups
    echo $output;
    Groups_Help::footer();
}
开发者ID:johangas,项目名称:moped,代码行数:29,代码来源:groups-admin-groups-add.php


示例13: groups_admin_groups_edit

/**
 * Show edit group form.
 * @param int $group_id group id
 */
function groups_admin_groups_edit($group_id)
{
    global $wpdb;
    if (!current_user_can(GROUPS_ADMINISTER_GROUPS)) {
        wp_die(__('Access denied.', GROUPS_PLUGIN_DOMAIN));
    }
    $group = Groups_Group::read(intval($group_id));
    if (empty($group)) {
        wp_die(__('No such group.', GROUPS_PLUGIN_DOMAIN));
    }
    $current_url = (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $current_url = remove_query_arg('action', $current_url);
    $current_url = remove_query_arg('group_id', $current_url);
    $name = isset($_POST['name-field']) ? $_POST['name-field'] : $group->name;
    $description = isset($_POST['description-field']) ? $_POST['description-field'] : $group->description;
    $parent_id = isset($_POST['parent-id-field']) ? $_POST['parent-id-field'] : $group->parent_id;
    $group_table = _groups_get_tablename('group');
    $parent_select = '<select name="parent-id-field">';
    $parent_select .= '<option value="">--</option>';
    $groups = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$group_table} WHERE group_id != %d", $group->group_id));
    foreach ($groups as $g) {
        $selected = $g->group_id == $group->parent_id ? ' selected="selected" ' : '';
        $parent_select .= '<option ' . $selected . 'value="' . esc_attr($g->group_id) . '">' . wp_filter_nohtml_kses($g->name) . '</option>';
    }
    $parent_select .= '</select>';
    $name_readonly = $name !== Groups_Registered::REGISTERED_GROUP_NAME ? "" : ' readonly="readonly" ';
    $output = '<div class="manage-groups">' . '<div>' . '<h2>' . __('Edit a group', GROUPS_PLUGIN_DOMAIN) . '</h2>' . '</div>' . '<form id="edit-group" action="' . $current_url . '" method="post">' . '<div class="group edit">' . '<input id="group-id-field" name="group-id-field" type="hidden" value="' . esc_attr(intval($group_id)) . '"/>' . '<div class="field">' . '<label for="name-field" class="field-label first required">' . __('Name', GROUPS_PLUGIN_DOMAIN) . '</label>' . '<input ' . $name_readonly . ' id="name-field" name="name-field" class="namefield" type="text" value="' . esc_attr($name) . '"/>' . '</div>' . '<div class="field">' . '<label for="parent-id-field" class="field-label">' . __('Parent', GROUPS_PLUGIN_DOMAIN) . '</label>' . $parent_select . '</div>' . '<div class="field">' . '<label for="description-field" class="field-label description-field">' . __('Description', GROUPS_PLUGIN_DOMAIN) . '</label>' . '<textarea id="description-field" name="description-field" rows="5" cols="45">' . wp_filter_nohtml_kses($description) . '</textarea>' . '</div>' . '<div class="field">' . wp_nonce_field('groups-edit', GROUPS_ADMIN_GROUPS_NONCE, true, false) . '<input class="button" type="submit" value="' . __('Save', GROUPS_PLUGIN_DOMAIN) . '"/>' . '<input type="hidden" value="edit" name="action"/>' . '<a class="cancel" href="' . $current_url . '">' . __('Cancel', GROUPS_PLUGIN_DOMAIN) . '</a>' . '</div>' . '</div>' . '</form>' . '</div>';
    // .manage-groups
    echo $output;
    Groups_Help::footer();
}
开发者ID:johangas,项目名称:moped,代码行数:35,代码来源:groups-admin-groups-edit.php


示例14: _validate_form

 protected function _validate_form()
 {
     if (isset($_POST['vimeography_basic_settings']) && check_admin_referer('vimeography-gallery-action', 'vimeography-gallery-verification')) {
         try {
             $input = $_POST['vimeography_basic_settings'];
             if (empty($input['gallery_title']) or empty($input['source_url'])) {
                 throw new Exception(__('Make sure you fill out all of the fields below!'));
             }
             global $wpdb;
             $settings['gallery_title'] = $wpdb->escape(wp_filter_nohtml_kses($input['gallery_title']));
             $settings['source_url'] = $wpdb->escape(wp_filter_nohtml_kses($input['source_url']));
             $result = $wpdb->insert(VIMEOGRAPHY_GALLERY_TABLE, array('title' => $settings['gallery_title'], 'date_created' => current_time('mysql'), 'is_active' => 1));
             if (!$result) {
                 throw new Exception(__('We couldn\'t create a new gallery. Try upgrading or reinstalling the Vimeography plugin.'));
             } else {
                 $gallery_id = $wpdb->insert_id;
                 $result = $wpdb->insert(VIMEOGRAPHY_GALLERY_META_TABLE, array('gallery_id' => $gallery_id, 'source_url' => $settings['source_url'], 'video_limit' => 20, 'featured_video' => NULL, 'gallery_width' => NULL, 'cache_timeout' => 3600, 'theme_name' => 'bugsauce'));
                 if (!$result) {
                     throw new Exception(__('We couldn\'t save your gallery settings. Try reinstalling the Vimeography plugin.'));
                 }
             }
             wp_redirect(get_admin_url() . 'admin.php?page=vimeography-edit-galleries&id=' . $gallery_id . '&created=1');
             exit;
         } catch (Exception $e) {
             require_once ABSPATH . 'wp-admin/admin-header.php';
             $this->messages[] = array('type' => 'error', 'heading' => 'Ruh roh.', 'message' => $e->getMessage());
         }
     }
 }
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:29,代码来源:new.php


示例15: update

 public function update($new_instance, $old_instance)
 {
     $instance = array();
     $instance['title'] = wp_filter_nohtml_kses(strip_tags($new_instance['title']));
     $instance['youtube_id'] = wp_filter_nohtml_kses(strip_tags($new_instance['youtube_id']));
     return $instance;
 }
开发者ID:javalidigital,项目名称:multipla,代码行数:7,代码来源:widget-youtube.php


示例16: wptmbr_roadblock_options_page

function wptmbr_roadblock_options_page()
{
    if (!current_user_can('manage_options')) {
        wp_die('You do not have sufficient permission to access this page.');
    }
    if (isset($_POST['wptmbr_form_submitted'])) {
        $hidden_field = $_POST['wptmbr_form_submitted'];
        if ($hidden_field == 'Y') {
            $wptmbr_header = wp_filter_nohtml_kses($_POST['wptmbr_header']);
            $wptmbr_text = wp_filter_nohtml_kses($_POST['wptmbr_text']);
            $wptmbr_gfid = intval($_POST['wptmbr_gfid']);
            $options = array();
            $options['wptmbr_header'] = $wptmbr_header;
            $options['wptmbr_text'] = $wptmbr_text;
            $options['wptmbr_gfid'] = $wptmbr_gfid;
            $options['last_updated'] = time();
            update_option('wptmbr_roadblock', $options);
        }
    }
    $options = get_option('wptmbr_roadblock');
    if (!empty($options) && is_array($options)) {
        $wptmbr_header = $options['wptmbr_header'];
        $wptmbr_text = $options['wptmbr_text'];
        $wptmbr_gfid = $options['wptmbr_gfid'];
    }
    require 'inc/options-page-wrapper.php';
}
开发者ID:TMBR,项目名称:johnjohn,代码行数:27,代码来源:wptmbr-roadblock.php


示例17: _validate_form

 protected function _validate_form()
 {
     $url = wp_nonce_url('admin.php?page=vimeography-my-themes');
     if (false === ($creds = request_filesystem_credentials($url))) {
         // if we get here, then we don't have credentials yet,
         // but have just produced a form for the user to fill in,
         // so stop processing for now
         return true;
         // stop the normal page form from displaying
     }
     // now we have some credentials, try to get the wp_filesystem running
     if (!WP_Filesystem($creds)) {
         // our credentials were no good, ask the user for them again
         request_filesystem_credentials($url);
         return true;
     }
     if (empty($_FILES)) {
         return;
     }
     // if this fails, check_admin_referer() will automatically print a "failed" page and die.
     if (!empty($_FILES) && check_admin_referer('vimeography-install-theme', 'vimeography-theme-verification')) {
         $name = substr(wp_filter_nohtml_kses($_FILES['vimeography-theme']['name']), 0, -4);
         if ($_FILES['vimeography-theme']['type'] != 'application/zip') {
             $this->messages[] = array('type' => 'error', 'heading' => 'Ruh Roh.', 'message' => 'Make sure you are uploading the actual .zip file, not a subfolder or file.');
         } else {
             global $wp_filesystem;
             if (!unzip_file($_FILES['vimeography-theme']['tmp_name'], VIMEOGRAPHY_THEME_PATH)) {
                 $this->messages[] = array('type' => 'error', 'heading' => 'Ruh Roh.', 'message' => 'The theme could not be installed.');
             } else {
                 $this->messages[] = array('type' => 'success', 'heading' => 'Theme installed.', 'message' => 'You can now use the "' . $name . '" theme in your galleries.');
             }
         }
     }
 }
开发者ID:robjcordes,项目名称:nexnewwp,代码行数:34,代码来源:list.php


示例18: supermag_dynamic_css

 function supermag_dynamic_css()
 {
     global $supermag_customizer_all_values;
     /*Color options */
     $supermag_primary_color = $supermag_customizer_all_values['supermag-primary-color'];
     $custom_css = '';
     /*background*/
     $custom_css .= "\r\n            mark,\r\n            .comment-form .form-submit input,\r\n            .read-more,\r\n            .bn-title,\r\n            .home-icon.front_page_on,\r\n            .header-wrapper .menu li:hover > a,\r\n            .header-wrapper .menu > li.current-menu-item a,\r\n            .header-wrapper .menu > li.current-menu-parent a,\r\n            .header-wrapper .menu > li.current_page_parent a,\r\n            .header-wrapper .menu > li.current_page_ancestor a,\r\n            .header-wrapper .menu > li.current-menu-item > a:before,\r\n            .header-wrapper .menu > li.current-menu-parent > a:before,\r\n            .header-wrapper .menu > li.current_page_parent > a:before,\r\n            .header-wrapper .menu > li.current_page_ancestor > a:before,\r\n            .header-wrapper .main-navigation ul ul.sub-menu li:hover > a,\r\n            .slider-section .cat-links a,\r\n            .featured-desc .below-entry-meta .cat-links a,\r\n            #calendar_wrap #wp-calendar #today,\r\n            #calendar_wrap #wp-calendar #today a,\r\n            .wpcf7-form input.wpcf7-submit:hover,\r\n            .breadcrumb{\r\n                background: {$supermag_primary_color};\r\n            }\r\n        ";
     $custom_css .= "\r\n            a:hover,\r\n            .screen-reader-text:focus,\r\n            .bn-content a:hover,\r\n            .socials a:hover,\r\n            .site-title a,\r\n            .search-block input#menu-search,\r\n            .widget_search input#s,\r\n            .search-block #searchsubmit,\r\n            .widget_search #searchsubmit,\r\n            .footer-sidebar .featured-desc .above-entry-meta a:hover,\r\n            .slider-section .slide-title:hover,\r\n            .besides-slider .post-title a:hover,\r\n            .slider-feature-wrap a:hover,\r\n            .slider-section .bx-controls-direction a,\r\n            .besides-slider .beside-post:hover .beside-caption,\r\n            .besides-slider .beside-post:hover .beside-caption a:hover,\r\n            .featured-desc .above-entry-meta span:hover,\r\n            .posted-on a:hover,\r\n            .cat-links a:hover,\r\n            .comments-link a:hover,\r\n            .edit-link a:hover,\r\n            .tags-links a:hover,\r\n            .byline a:hover,\r\n            .nav-links a:hover,\r\n            #supermag-breadcrumbs a:hover,\r\n            .wpcf7-form input.wpcf7-submit {\r\n                color: {$supermag_primary_color};\r\n            }";
     /*border*/
     $custom_css .= "\r\n             .search-block input#menu-search,\r\n            .widget_search input#s,\r\n            .tagcloud a{\r\n                border: 1px solid {$supermag_primary_color};\r\n            }";
     $custom_css .= "\r\n            .footer-wrapper .border,\r\n            .nav-links .nav-previous a:hover,\r\n            .nav-links .nav-next a:hover{\r\n                border-top: 1px solid {$supermag_primary_color};\r\n            }";
     $custom_css .= "\r\n             .besides-slider .beside-post{\r\n                border-bottom: 3px solid {$supermag_primary_color};\r\n            }";
     $custom_css .= "\r\n            .widget-title,\r\n            .footer-wrapper,\r\n            .page-header .page-title,\r\n            .single .entry-header .entry-title{\r\n                border-bottom: 1px solid {$supermag_primary_color};\r\n            }";
     $custom_css .= "\r\n            .widget-title:before,\r\n            .page-header .page-title:before,\r\n            .single .entry-header .entry-title:before{\r\n                border-bottom: 7px solid {$supermag_primary_color};\r\n            }";
     $custom_css .= "\r\n           .wpcf7-form input.wpcf7-submit,\r\n            article.post.sticky{\r\n                border: 2px solid {$supermag_primary_color};\r\n            }";
     $custom_css .= "\r\n           .breadcrumb::after {\r\n                border-left: 5px solid {$supermag_primary_color};\r\n            }";
     $custom_css .= "\r\n           .header-wrapper #site-navigation{\r\n                border-bottom: 5px solid {$supermag_primary_color};\r\n            }";
     /*media width*/
     $custom_css .= "\r\n           @media screen and (max-width:992px){\r\n                .slicknav_btn.slicknav_open{\r\n                    border: 1px solid {$supermag_primary_color};\r\n                }\r\n                .slicknav_btn.slicknav_open:before{\r\n                    background: { {$supermag_primary_color} };\r\n                    box-shadow: 0 6px 0 0 {$supermag_primary_color}, 0 12px 0 0 {$supermag_primary_color};\r\n                }\r\n                .slicknav_nav li:hover > a,\r\n                .slicknav_nav li.current-menu-ancestor a,\r\n                .slicknav_nav li.current-menu-item  > a,\r\n                .slicknav_nav li.current_page_item a,\r\n                .slicknav_nav li.current_page_item .slicknav_item span,\r\n                .slicknav_nav li .slicknav_item:hover a{\r\n                    color: {$supermag_primary_color};\r\n                }\r\n            }";
     /*custom css*/
     $supermag_custom_css = wp_filter_nohtml_kses($supermag_customizer_all_values['supermag-custom-css']);
     if (!empty($supermag_custom_css)) {
         $custom_css .= $supermag_custom_css;
     }
     wp_add_inline_style('supermag-style', $custom_css);
 }
开发者ID:jasonralph,项目名称:jasonralph.org,代码行数:27,代码来源:dynamic-css.php


示例19: validate

 public function validate($input)
 {
     // Our first value is either 0 or 1
     $input['option1'] = $input['option1'] == 1 ? 1 : 0;
     // Say our second option must be safe text with no HTML tags
     $input['sometext'] = wp_filter_nohtml_kses($input['sometext']);
     return $input;
 }
开发者ID:repo-storage,项目名称:core-wp,代码行数:8,代码来源:sample_options_settings.php


示例20: top_message_options_validate

function top_message_options_validate($input)
{
    // Say our option must be safe text with no HTML tags
    $input['vimeo_id'] = wp_filter_nohtml_kses($input['vimeo_id']);
    $input['flickr_api_key'] = wp_filter_nohtml_kses($input['flickr_api_key']);
    //$input['flickr_user_id'] =  wp_filter_nohtml_kses($input['flickr_user_id']);
    return $input;
}
开发者ID:bichhuynguyen,项目名称:template-development,代码行数:8,代码来源:options_class.php



注:本文中的wp_filter_nohtml_kses函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_filter_object_list函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_filter_kses函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap