Skip to content

Commit 220ed9c

Browse files
committed
Bug Fixes
Bug fixes and changed the way of representing the Radio and Select input field
1 parent c5b4534 commit 220ed9c

File tree

13 files changed

+79
-62
lines changed

13 files changed

+79
-62
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Then Please go to Frontend Dashboard | Frontend Dashboard | Login (Tab) | Settin
6868
4. Fill the input fields and submit to save
6969

7070

71-
**List of shortcodes**
71+
**List of Shortcodes**
7272
1. [fed_login] to generate login, registration, and reset forms
7373
2. [fed_login_only] to show only login page
7474
3. [fed_register_only] to show only register page
@@ -78,6 +78,11 @@ Then Please go to Frontend Dashboard | Frontend Dashboard | Login (Tab) | Settin
7878

7979
### Changelog
8080

81+
**v1.1.1 [17-August-2017]**
82+
* Collapse/Expand the frontend dashboard menu
83+
* Bug fixes
84+
* Refactored for developers comfort
85+
8186
**v1.1 [11-August-2017]**
8287
* Added more filter and action hooks for developers
8388
* Minor: Bug fixed
@@ -87,5 +92,7 @@ Then Please go to Frontend Dashboard | Frontend Dashboard | Login (Tab) | Settin
8792
- Public release
8893

8994
### Upgrade Notice
90-
**v1.0 [04-August-2017]**
91-
- Public release
95+
**v1.1.1 [17-August-2017]**
96+
* Collapse/Expand the frontend dashboard menu
97+
* Bug fixes
98+
* Refactored for developers comfort

admin/function-admin.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class="' . $values['class'] . '" placeholder="' . $values['placeholder'] . '" id
174174
case 'checkbox':
175175
$values['class'] = $values['class'] == 'form-control' ? '' : $values['class'];
176176
$input .= '<label class="' . $values['class'] . '">
177-
<input ' . $values['disabled'] . $values['extra'] . $values['required'] . ' name="' . $values['name'] . '" value="'.$values['default_value'].'" type="checkbox" id="' . $values['id'] . '" ' . checked( $values['value'], $values['default_value'], false ) . '>' . $label . '</label>';
177+
<input ' . $values['disabled'] . $values['extra'] . $values['required'] . ' name="' . $values['name'] . '" value="' . $values['default_value'] . '" type="checkbox" id="' . $values['id'] . '" ' . checked( $values['value'], $values['default_value'], false ) . '>' . $label . '</label>';
178178

179179
break;
180180

@@ -193,7 +193,7 @@ class="' . $values['class'] . '" placeholder="' . $values['placeholder'] . '" id
193193
$max = isset( $attr['input_max'] ) ? $attr['input_max'] : 999999;
194194
$step = isset( $attr['input_step'] ) ? $attr['input_step'] : 'any';
195195

196-
$input .= '<input ' . $values['disabled'] . $values['extra'] . $values['required'] . ' type="number" name="' . $values['name'] . '"
196+
$input .= '<input ' . $values['disabled'] . $values['readonly'] . $values['extra'] . $values['required'] . ' type="number" name="' . $values['name'] . '"
197197
value="' . esc_attr( $values['value'] ) . '" class="' . $values['class'] . '"
198198
placeholder="' . $values['placeholder'] . '"
199199
min="' . esc_attr( $min ) . '"
@@ -202,11 +202,11 @@ class="' . $values['class'] . '" placeholder="' . $values['placeholder'] . '" id
202202
break;
203203

204204
case 'radio':
205-
$values['class'] = $values['class'] == 'form-control' ? '' : $values['class'];
206-
$options = strlen( $attr['input_value'] ) > 0 ? fed_convert_comma_separated_key_value( $attr['input_value'] ) : array();
205+
$values['class'] = $values['class'] === 'form-control' ? '' : $values['class'];
206+
$options = fed_get_select_option_value( $attr['input_value'] );
207207
foreach ( $options as $key => $label ) {
208208
$input .= '<label class="' . $values['class'] . '" for="' . $key . '">
209-
<input ' . $values['disabled'] . $values['extra'] . ' name="' . $values['name'] . '" value="' . $key . '"
209+
<input ' . $values['disabled'] . $values['extra'] . $values['readonly'] . ' name="' . $values['name'] . '" value="' . $key . '"
210210
type="radio"' . checked( $values['value'], $key, false ) . $values['required'] . '>
211211
' . $label . '
212212
</label>';
@@ -327,20 +327,20 @@ function fed_get_empty_value_for_user_profile( $action ) {
327327
function fed_process_user_profile( $row, $action, $update = 'no' ) {
328328

329329
$default = array(
330-
'label_name' => isset( $row['label_name'] ) ? esc_attr( $row['label_name'] ) : '',
331-
'input_order' => isset( $row['input_order'] ) ? esc_attr( $row['input_order'] ) : '',
332-
'is_required' => isset( $row['is_required'] ) ? esc_attr( $row['is_required'] ) : 'false',
333-
'placeholder' => isset( $row['placeholder'] ) ? esc_attr( $row['placeholder'] ) : '',
334-
'class_name' => isset( $row['class_name'] ) ? esc_attr( $row['class_name'] ) : '',
335-
'id_name' => isset( $row['id_name'] ) ? esc_attr( $row['id_name'] ) : '',
336-
'input_value' => isset( $row['input_value'] ) ? esc_attr( preg_replace( '/^\h*\v+/m', '', $row['input_value'] ) ) : '',
337-
'input_location' => isset( $row['location'] ) ? esc_attr( $row['location'] ) : '',
338-
'input_min' => isset( $row['input_min'] ) ? esc_attr( $row['input_min'] ) : '',
339-
'input_max' => isset( $row['input_max'] ) ? esc_attr( $row['input_max'] ) : '',
340-
'input_step' => isset( $row['input_step'] ) ? esc_attr( $row['input_step'] ) : '',
341-
'input_row' => isset( $row['input_row'] ) ? esc_attr( $row['input_row'] ) : '',
342-
'input_type' => isset( $row['input_type'] ) ? esc_attr( $row['input_type'] ) : '',
343-
'input_meta' => isset( $row['input_meta'] ) ? esc_attr( $row['input_meta'] ) : '',
330+
'label_name' => isset( $row['label_name'] ) ? sanitize_text_field( $row['label_name'] ) : '',
331+
'input_order' => isset( $row['input_order'] ) ? sanitize_text_field( $row['input_order'] ) : '',
332+
'is_required' => isset( $row['is_required'] ) ? sanitize_text_field( $row['is_required'] ) : 'false',
333+
'placeholder' => isset( $row['placeholder'] ) ? sanitize_text_field( $row['placeholder'] ) : '',
334+
'class_name' => isset( $row['class_name'] ) ? sanitize_text_field( $row['class_name'] ) : '',
335+
'id_name' => isset( $row['id_name'] ) ? sanitize_text_field( $row['id_name'] ) : '',
336+
'input_value' => isset( $row['input_value'] ) ? sanitize_text_field( $row['input_value'] ) : '',
337+
'input_location' => isset( $row['location'] ) ? sanitize_text_field( $row['location'] ) : '',
338+
'input_min' => isset( $row['input_min'] ) ? sanitize_text_field( $row['input_min'] ) : '',
339+
'input_max' => isset( $row['input_max'] ) ? sanitize_text_field( $row['input_max'] ) : '',
340+
'input_step' => isset( $row['input_step'] ) ? sanitize_text_field( $row['input_step'] ) : '',
341+
'input_row' => isset( $row['input_row'] ) ? sanitize_text_field( $row['input_row'] ) : '',
342+
'input_type' => isset( $row['input_type'] ) ? sanitize_text_field( $row['input_type'] ) : '',
343+
'input_meta' => isset( $row['input_meta'] ) ? sanitize_text_field( $row['input_meta'] ) : '',
344344

345345
// 'extra' => isset( $row['extra'] ) ? esc_attr( $row['extra'] ) : '',
346346

@@ -422,7 +422,7 @@ function fed_process_menu( $row ) {
422422
* @return array
423423
*/
424424
function fed_convert_comma_separated_key_value( $text ) {
425-
$n = ( explode( "\n", $text ) );
425+
$n = explode( '|', $text );
426426
$s = array();
427427
foreach ( $n as $m ) {
428428
$mm = explode( ',', $m );

admin/layout/add_edit_profile.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function fed_get_admin_up_display_permission( $row, $action, $type = '' ) {
228228
if ( $action === 'profile' ) {
229229
if ( $type === 'file' ) {
230230
$value = 'Disable';
231-
$others = 'disabled';
231+
$others = true;
232232
$notification = '<i class="fa fa-info bg-info-font" data-toggle="popover" data-trigger="hover" title=" Status" data-content="Only registered user can upload the files."></i>';
233233
} else {
234234
$value = $row['show_register'];

admin/layout/input_fields/radio.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ class="fed_admin_menu fed_ajax"
5151
<div class="row fed_key_value_eg_container">
5252
<div class="col-md-5">
5353
<label for=""><?php _e( 'Examples:', 'fed' ) ?></label>
54-
<p>key,value</p>
55-
<p>one,One</p>
56-
<p>two,Two</p>
57-
<p>five-category,Five Category</p>
54+
<p>key,value|one,One|two,Two|five-category,Five Category</p>
5855
</div>
5956
<div class="col-md-7">
6057
<b><?php _e( 'This will be output as', 'fed' ) ?></b>

admin/layout/input_fields/select.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,7 @@ class="fed_admin_menu fed_ajax"
4949
<div class="row fed_key_value_eg_container">
5050
<div class="col-md-5">
5151
<label for=""><?php _e( 'Examples:', 'fed' ) ?></label>
52-
<p>key,value</p>
53-
<p>one,One</p>
54-
<p>two,Two</p>
55-
<p>five-category,Five Category</p>
52+
<p>key,value|one,One|two,Two|five-category,Five Category</p>
5653
</div>
5754
<div class="col-md-7">
5855
<b><?php _e( 'This will be output as', 'fed' ) ?></b>

admin/layout/input_fields/url.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class="fed_admin_menu fed_ajax"
4040

4141
fed_get_admin_up_role_based($row, $action );
4242

43-
fed_get_input_type_and_submit_btn( 'text', $action );
43+
fed_get_input_type_and_submit_btn( 'url', $action );
4444
?>
4545
</div>
4646
</div>

admin/menu/menu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function fed_menu() {
3434
add_submenu_page( 'fed_settings_menu', __( 'Add Profile / Post Fields', 'fed' ), __( 'Add Profile / Post Fields', 'fed' ),
3535
'manage_options', 'fed_add_user_profile', 'fed_add_user_profile' );
3636

37-
add_submenu_page( 'fed_settings_menu', __( 'Plugins', 'fed' ), __( 'Plugins', 'fed' ),
38-
'manage_options', 'fed_plugin_pages', 'fed_plugin_pages' );
37+
// add_submenu_page( 'fed_settings_menu', __( 'Plugins', 'fed' ), __( 'Plugins', 'fed' ),
38+
// 'manage_options', 'fed_plugin_pages', 'fed_plugin_pages' );
3939

4040
add_submenu_page( 'fed_settings_menu', __( 'Status', 'fed' ), __( 'Status', 'fed' ),
4141
'manage_options', 'fed_status', 'fed_status' );

common/function-common.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function fed_input_box( $meta_key, $attr = array(), $type = 'text' ) {
154154

155155
$values = array();
156156
$values['placeholder'] = isset( $attr['placeholder'] ) && ! empty( $attr['placeholder'] ) ? esc_attr( $attr['placeholder'] ) : '';
157-
$values['label'] = isset( $attr['label'] ) && ! empty( $attr['label'] ) ? strip_tags( $attr['label'],'<i><b>' ) : '';
157+
$values['label'] = isset( $attr['label'] ) && ! empty( $attr['label'] ) ? strip_tags( $attr['label'], '<i><b>' ) : '';
158158
$values['class_name'] = isset( $attr['class'] ) && ! empty( $attr['class'] ) ? esc_attr( $attr['class'] ) : '';
159159

160160
$values['user_value'] = isset( $attr['value'] ) && ! empty( $attr['value'] ) ? esc_attr( $attr['value'] ) : '';
@@ -167,7 +167,7 @@ function fed_input_box( $meta_key, $attr = array(), $type = 'text' ) {
167167
$values['readonly'] = isset( $attr['readonly'] ) && $attr['readonly'] === true ? true : '';
168168
$values['user_value'] = isset( $attr['value'] ) && ! empty( $attr['value'] ) ? esc_attr( $attr['value'] ) : '';
169169
$values['input_value'] = isset( $attr['options'] ) && ! empty( $attr['options'] ) ? $attr['options'] : '';
170-
$values['disabled'] = isset( $attr['disabled'] ) && ! empty( $attr['disabled'] ) ? esc_attr( $attr['disabled'] ) : '';
170+
$values['disabled'] = isset( $attr['disabled'] ) && $attr['disabled'] === true ? true : '';
171171
$values['default_value'] = isset( $attr['default_value'] ) && ! empty( $attr['default_value'] ) ? esc_attr( $attr['default_value'] ) : 'yes';
172172
$values['extra'] = isset( $attr['extra'] ) ? $attr['extra'] : '';
173173
$values['extended'] = isset( $attr['extended'] ) && ! empty( $attr['extended'] ) ? esc_attr( $attr['extended'] ) : array();

frontend-dashboard-1.1.1.zip

1.11 MB
Binary file not shown.

frontend-dashboard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Frontend Dashboard
44
* Plugin URI: https://buffercode.com/plugin/frontend-dashboard
55
* Description: Front end dashboard provide high flexible way to customize the user dashboard on front end rather than WordPress wp-admin dashboard.
6-
* Version: 1.1
6+
* Version: 1.1.1
77
* Author: vinoth06
88
* Author URI: http://buffercode.com/
99
* License: GPLv2
@@ -16,7 +16,7 @@
1616
/**
1717
* Version Number
1818
*/
19-
define( 'BC_FED_PLUGIN_VERSION', '1.1' );
19+
define( 'BC_FED_PLUGIN_VERSION', '1.1.1' );
2020
define( 'BC_FED_PLUGIN_VERSION_TYPE', 'FREE' );
2121

2222
/**

0 commit comments

Comments
 (0)