PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.38
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.38
1.2.74 1.2.73 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 All 174 releases
← All changes | widgets/change.php +56 -12 1.0.221.2.38 View file →
@@ -25,9 +25,9 @@
25 25 'class_name' => __CLASS__,
26 26 'base_id' => 'uwp_change',
27 27 'name' => __('UWP > Change','userswp'),
28 28 'widget_ops' => array(
29 - 'classname' => 'uwp-change-class',
29 + 'classname' => 'uwp-change-class bsui',
30 30 'description' => esc_html__('Displays change password form.','userswp'),
31 31 ),
32 32 'arguments' => array(
33 33 'title' => array(
@@ -37,8 +37,38 @@
37 37 'desc_tip' => true,
38 38 'default' => '',
39 39 'advanced' => false
40 40 ),
41 + 'form_title' => array(
42 + 'title' => __( 'Form title', 'userswp' ),
43 + 'desc' => __( 'Enter the form title (or "0" for no title)', 'userswp' ),
44 + 'type' => 'text',
45 + 'desc_tip' => true,
46 + 'default' => '',
47 + 'placeholder' => __('Change Password','userswp'),
48 + 'advanced' => true
49 + ),
50 + 'design_style' => array(
51 + 'title' => __('Design Style', 'userswp'),
52 + 'desc' => __('The design style to use.', 'userswp'),
53 + 'type' => 'select',
54 + 'options' => array(
55 + "" => __('default', 'userswp'),
56 + "bootstrap" => __('Style 1', 'userswp'),
57 + ),
58 + 'default' => '',
59 + 'desc_tip' => true,
60 + 'advanced' => true
61 + ),
62 + 'css_class' => array(
63 + 'type' => 'text',
64 + 'title' => __('Extra class:', 'userswp'),
65 + 'desc' => __('Give the wrapper an extra class so you can style things as you want.', 'userswp'),
66 + 'placeholder' => '',
67 + 'default' => '',
68 + 'desc_tip' => true,
69 + 'advanced' => true,
70 + ),
41 71 )
42 72
43 73 );
44 74
@@ -45,37 +75,51 @@
45 75
46 76 parent::__construct( $options );
47 77 }
48 78
79 + /**
80 + * The Super block output function.
81 + *
82 + * @param array $args
83 + * @param array $widget_args
84 + * @param string $content
85 + *
86 + * @return mixed|string|bool
87 + */
49 88 public function output( $args = array(), $widget_args = array(), $content = '' ) {
50 89
51 - if (is_user_logged_in()) {
90 + if (!is_user_logged_in()) {
52 91 return false;
53 92 }
54 93
94 + $defaults = array(
95 + 'form_title' => __('Change Password','userswp'),
96 + 'css_class' => ''
97 + );
98 +
99 + /**
100 + * Parse incoming $args into an array and merge it with $defaults
101 + */
102 + $args = wp_parse_args( $args, $defaults );
103 +
55 104 ob_start();
56 105
57 106 echo '<div class="uwp_widgets uwp_widget_change">';
58 107
59 - $temp_obj = new UsersWP_Templates();
108 + $design_style = !empty($args['design_style']) ? esc_attr($args['design_style']) : uwp_get_option("design_style",'bootstrap');
109 + $template = $design_style ? $design_style."/change.php" : "change.php";
60 110
61 - $template = $temp_obj->uwp_locate_template('change');
62 -
63 111 echo '<div class="uwp_page">';
64 112
65 - if ($template) {
66 - include($template);
67 - }
113 + uwp_get_template($template, $args);
68 114
69 115 echo '</div>';
70 116
71 117 echo '</div>';
72 118
73 - $output = ob_get_contents();
119 + uwp_password_strength_inline_js();
74 120
75 - ob_end_clean();
76 -
77 - return trim($output);
121 + return ob_get_clean();
78 122
79 123 }
80 124
81 125 }