本文整理汇总了PHP中bbp_get_sanitize_val函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_get_sanitize_val函数的具体用法?PHP bbp_get_sanitize_val怎么用?PHP bbp_get_sanitize_val使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bbp_get_sanitize_val函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _e
<label for="user_pass"><?php
_e('Password', 'bbpress');
?>
: </label>
<input type="password" name="pwd" value="<?php
bbp_sanitize_val('user_pass', 'password');
?>
" size="20" id="user_pass" tabindex="<?php
bbp_tab_index();
?>
" />
</div>
<div class="bbp-remember-me">
<input type="checkbox" name="rememberme" value="forever" <?php
checked(bbp_get_sanitize_val('rememberme', 'checkbox'));
?>
id="rememberme" tabindex="<?php
bbp_tab_index();
?>
" />
<label for="rememberme"><?php
_e('Keep me signed in', 'bbpress');
?>
</label>
</div>
<div class="bbp-submit-wrapper">
<?php
do_action('login_form');
示例2: bbp_sanitize_val
/**
* Echo sanitized $_REQUEST value.
*
* Use the $input_type parameter to properly process the value. This
* ensures correct sanitization of the value for the receiving input.
*
* @since bbPress (r2815)
*
* @param string $request Name of $_REQUEST to look for
* @param string $input_type Type of input. Default: text. Accepts:
* textarea|password|select|radio|checkbox
* @uses bbp_get_sanitize_val() To sanitize the value.
*/
function bbp_sanitize_val($request = '', $input_type = 'text')
{
echo bbp_get_sanitize_val($request, $input_type);
}
示例3: widget
/**
* Displays the output, the login form
*
* @since bbPress (r2827)
*
* @param mixed $args Arguments
* @param array $instance Instance
* @uses apply_filters() Calls 'bbp_login_widget_title' with the title
* @uses get_template_part() To get the login/logged in form
*/
public function widget($args, $instance)
{
extract($args);
$title = apply_filters('bbp_login_widget_title', $instance['title']);
$register = apply_filters('bbp_login_widget_register', $instance['register']);
$lostpass = apply_filters('bbp_login_widget_lostpass', $instance['lostpass']);
echo $before_widget;
if (!empty($title)) {
echo $before_title . $title . $after_title;
}
if (!is_user_logged_in()) {
?>
<form method="post" action="<?php
bbp_wp_login_action(array('context' => 'login_post'));
?>
" class="bbp-login-form">
<fieldset>
<legend><?php
_e('Log In', 'bbpress');
?>
</legend>
<div class="bbp-username">
<label for="user_login"><?php
_e('Username', 'bbpress');
?>
: </label>
<input type="text" name="log" value="<?php
bbp_sanitize_val('user_login', 'text');
?>
" size="20" id="user_login" tabindex="<?php
bbp_tab_index();
?>
" />
</div>
<div class="bbp-password">
<label for="user_pass"><?php
_e('Password', 'bbpress');
?>
: </label>
<input type="password" name="pwd" value="<?php
bbp_sanitize_val('user_pass', 'password');
?>
" size="20" id="user_pass" tabindex="<?php
bbp_tab_index();
?>
" />
</div>
<div class="bbp-remember-me">
<input type="checkbox" name="rememberme" value="forever" <?php
checked(bbp_get_sanitize_val('rememberme', 'checkbox'), true, true);
?>
id="rememberme" tabindex="<?php
bbp_tab_index();
?>
" />
<label for="rememberme"><?php
_e('Remember Me', 'bbpress');
?>
</label>
</div>
<div class="bbp-submit-wrapper">
<?php
do_action('login_form');
?>
<button type="submit" name="user-submit" id="user-submit" tabindex="<?php
bbp_tab_index();
?>
" class="button submit user-submit"><?php
_e('Log In', 'bbpress');
?>
</button>
<?php
bbp_user_login_fields();
?>
</div>
<?php
if (!empty($register) || !empty($lostpass)) {
?>
<div class="bbp-login-links">
//.........这里部分代码省略.........
示例4: widget
/**
* Displays the output, the login form
*
* @since bbPress (r2827)
*
* @param mixed $args Arguments
* @param array $instance Instance
* @uses apply_filters() Calls 'bbp_login_widget_title' with the title
* @uses get_template_part() To get the login/logged in form
*/
public function widget($args = array(), $instance = array())
{
// Get widget settings
$settings = $this->parse_settings($instance);
// Typical WordPress filter
$settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base);
// bbPress filters
$settings['title'] = apply_filters('bbp_login_widget_title', $settings['title'], $instance, $this->id_base);
$settings['register'] = apply_filters('bbp_login_widget_register', $settings['register'], $instance, $this->id_base);
$settings['lostpass'] = apply_filters('bbp_login_widget_lostpass', $settings['lostpass'], $instance, $this->id_base);
echo $args['before_widget'];
if (!empty($settings['title'])) {
echo $args['before_title'] . $settings['title'] . $args['after_title'];
}
if (!is_user_logged_in()) {
?>
<form method="post" action="<?php
bbp_wp_login_action(array('context' => 'login_post'));
?>
" class="bbp-login-form">
<fieldset>
<legend><?php
_e('Log In', 'bbpress');
?>
</legend>
<div class="bbp-username form-group">
<label for="user_login" class="sr-only"><?php
_e('Username', 'bbpress');
?>
: </label>
<div class="input-group">
<span class="input-group-addon">
<span class="glyphicon ipt-icomoon-user"></span>
</span>
<input placeholder="<?php
_e('Username', 'bbpress');
?>
" class="form-control" type="text" name="log" value="<?php
bbp_sanitize_val('user_login', 'text');
?>
" size="20" id="user_login" tabindex="<?php
bbp_tab_index();
?>
" />
</div>
</div>
<div class="bbp-password form-group">
<label for="user_pass" class="sr-only"><?php
_e('Password', 'bbpress');
?>
: </label>
<div class="input-group">
<span class="input-group-addon">
<span class="glyphicon ipt-icomoon-console"></span>
</span>
<input placeholder="<?php
_e('Password', 'bbpress');
?>
" class="form-control" type="password" name="pwd" value="<?php
bbp_sanitize_val('user_pass', 'password');
?>
" size="20" id="user_pass" tabindex="<?php
bbp_tab_index();
?>
" />
</div>
</div>
<?php
do_action('login_form');
?>
<div class="bbp-remember-me checkbox">
<input type="checkbox" name="rememberme" value="forever" <?php
checked(bbp_get_sanitize_val('rememberme', 'checkbox'), true, true);
?>
id="rememberme" tabindex="<?php
bbp_tab_index();
?>
" />
<label for="rememberme"><?php
_e('Remember Me', 'bbpress');
?>
</label>
</div>
<div class="bbp-submit-wrapper btn-group">
<?php
//.........这里部分代码省略.........
示例5: widget
/**
* Displays the output, the login form
*
* @since 2.0.0 bbPress (r2827)
*
* @param array $args Arguments
* @param array $instance Instance
* @uses apply_filters() Calls 'bbp_login_widget_title' with the title
* @uses get_template_part() To get the login/logged in form
*/
public function widget($args = array(), $instance = array())
{
// Get widget settings
$settings = $this->parse_settings($instance);
// Typical WordPress filter
$settings['title'] = apply_filters('widget_title', $settings['title'], $instance, $this->id_base);
// bbPress filters
$settings['title'] = apply_filters('bbp_login_widget_title', $settings['title'], $instance, $this->id_base);
$settings['register'] = apply_filters('bbp_login_widget_register', $settings['register'], $instance, $this->id_base);
$settings['lostpass'] = apply_filters('bbp_login_widget_lostpass', $settings['lostpass'], $instance, $this->id_base);
echo $args['before_widget'];
if (!empty($settings['title'])) {
echo $args['before_title'] . $settings['title'] . $args['after_title'];
}
if (!is_user_logged_in()) {
?>
<form method="post" action="<?php
bbp_wp_login_action(array('context' => 'login_post'));
?>
" class="bbp-login-form">
<fieldset>
<legend><?php
_e('Log In', 'bbpress');
?>
</legend>
<div class="bbp-username">
<label for="user_login"><?php
_e('Username', 'bbpress');
?>
: </label>
<input type="text" name="log" value="<?php
bbp_sanitize_val('user_login', 'text');
?>
" size="20" id="user_login" />
</div>
<div class="bbp-password">
<label for="user_pass"><?php
_e('Password', 'bbpress');
?>
: </label>
<input type="password" name="pwd" value="<?php
bbp_sanitize_val('user_pass', 'password');
?>
" size="20" id="user_pass" autocomplete="off" />
</div>
<div class="bbp-remember-me">
<input type="checkbox" name="rememberme" value="forever" <?php
checked(bbp_get_sanitize_val('rememberme', 'checkbox'), true, true);
?>
id="rememberme" />
<label for="rememberme"><?php
_e('Remember Me', 'bbpress');
?>
</label>
</div>
<div class="bbp-submit-wrapper">
<?php
do_action('login_form');
?>
<button type="submit" name="user-submit" id="user-submit" class="button submit user-submit"><?php
_e('Log In', 'bbpress');
?>
</button>
<?php
bbp_user_login_fields();
?>
</div>
<?php
if (!empty($settings['register']) || !empty($settings['lostpass'])) {
?>
<div class="bbp-login-links">
<?php
if (!empty($settings['register'])) {
?>
<a href="<?php
echo esc_url($settings['register']);
?>
//.........这里部分代码省略.........