当前位置: 首页>>代码示例>>PHP>>正文


PHP wp_filter_nohtml_kses函数代码示例

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


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


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