PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.0.13
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.0.13
1.2.72 1.2.71 1.2.70 1.2.69 1.2.68 1.2.67 1.2.66 1.2.65 1.2.64 1.2.63 trunk 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.23 All 172 releases
userswp / widgets / register.php

register.php in UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP 1.0.13, at widgets/register.php

71 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 add_action('widgets_init', 'uwp_init_register_widget');
3 function uwp_init_register_widget() {
4 register_widget("UWP_Register_Widget");
5 }
6 class UWP_Register_Widget extends WP_Widget
7 {
8
9 /**
10 * Class constructor.
11 */
12 function __construct()
13 {
14 $widget_ops = array(
15 'description' => __('Displays Register Form', 'userswp'),
16 'classname' => 'uwp_progress_users',
17 );
18 parent::__construct(false, $name = _x('UWP > Register', 'widget name', 'userswp'), $widget_ops);
19
20 }
21
22 /**
23 * Display the widget.
24 *
25 * @param array $args Widget arguments.
26 * @param array $instance The widget settings, as saved by the user.
27 */
28 function widget($args, $instance)
29 {
30 if (is_user_logged_in()) {
31 return;
32 }
33 extract($args, EXTR_SKIP);
34 $title = empty($instance['title']) ? __('Register', 'userswp') : apply_filters('uwp_register_widget_title', $instance['title']);
35
36 echo '<div class="uwp_widgets">';
37 echo $before_widget;
38 if ($title) {
39 echo $before_title . $title . $after_title;
40 }
41 echo do_shortcode('[uwp_register]');
42 echo $after_widget;
43 echo '</div>';
44 }
45
46 function update($new_instance, $old_instance)
47 {
48 //save the widget
49 $instance = $old_instance;
50 $instance['title'] = strip_tags($new_instance['title']);
51 return $instance;
52 }
53
54 function form($instance)
55 {
56 //widgetform in backend
57 $instance = wp_parse_args((array)$instance, array(
58 'title' => __('Register', 'userswp'),
59 ));
60 $title = strip_tags($instance['title']);
61 ?>
62 <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php echo __("Widget Title:", 'userswp'); ?> <input class="widefat"
63 id="<?php echo $this->get_field_id('title'); ?>"
64 name="<?php echo $this->get_field_name('title'); ?>"
65 type="text"
66 value="<?php echo esc_attr($title); ?>"/></label>
67 </p>
68 <?php
69 }
70
71 }