PluginProbe
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP / 1.2.73
UsersWP – Front-end login form, User Registration, User Profile & Members Directory plugin for WP v1.2.73
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/account.php +56 -12 1.0.221.2.73 View file →
@@ -25,9 +25,9 @@
25 25 'class_name' => __CLASS__,
26 26 'base_id' => 'uwp_account',
27 27 'name' => __('UWP > Account','userswp'),
28 28 'widget_ops' => array(
29 - 'classname' => 'uwp-account-class',
29 + 'classname' => 'uwp-account-class bsui',
30 30 'description' => esc_html__('Displays account 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' => __('Edit Account','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,35 +75,49 @@
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 90 if (!is_user_logged_in()) {
52 - return;
91 + return '';
53 92 }
54 93
94 + $defaults = array(
95 + 'form_title' => __('Account','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_account">';
58 107
59 - $temp_obj = new UsersWP_Templates();
108 + echo '<div class="uwp_page">';
60 109
61 - $template = $temp_obj->uwp_locate_template('account');
110 + $design_style = !empty($args['design_style']) ? esc_attr($args['design_style']) : uwp_get_option("design_style",'bootstrap');
111 + $template = $design_style ? $design_style."/account.php" : "account.php";
62 112
63 - echo '<div class="uwp_page">';
113 + uwp_get_template($template, $args);
64 114
65 - if ($template) {
66 - include($template);
67 - }
68 -
69 115 echo '</div>';
70 116
71 117 echo '</div>';
72 118
73 - $output = ob_get_contents();
74 -
75 - ob_end_clean();
119 + $output = ob_get_clean();
76 120
77 121 return trim($output);
78 122
79 123 }