mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-18 22:23:37 +09:00
-fixes
This commit is contained in:
@@ -47,7 +47,7 @@ if ( ! class_exists( 'UM_Menu_Item_Custom_Fields_Editor' ) ) {
|
||||
if ( empty( $_POST['menu-item-db-id'] ) || ! in_array( $menu_item_db_id, $_POST['menu-item-db-id'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
//var_dump($_POST['menu-item-um_nav_roles']); exit;
|
||||
foreach ( self::$fields as $_key => $label ) {
|
||||
|
||||
$key = sprintf( 'menu-item-%s', $_key );
|
||||
@@ -55,7 +55,8 @@ if ( ! class_exists( 'UM_Menu_Item_Custom_Fields_Editor' ) ) {
|
||||
// Sanitize
|
||||
if ( ! empty( $_POST[ $key ][ $menu_item_db_id ] ) ) {
|
||||
// Do some checks here...
|
||||
$value = $_POST[ $key ][ $menu_item_db_id ];
|
||||
$value = is_array( $_POST[ $key ][ $menu_item_db_id ] ) ?
|
||||
array_keys( $_POST[ $key ][ $menu_item_db_id ] ) : $_POST[ $key ][ $menu_item_db_id ];
|
||||
} else {
|
||||
$value = null;
|
||||
}
|
||||
@@ -165,7 +166,7 @@ if ( ! class_exists( 'UM_Menu_Item_Custom_Fields_Editor' ) ) {
|
||||
$id_attr = ' id="edit-menu-item-um_nav_roles-{{data.menuItemID}}_' . $k . '" ';
|
||||
$for_attr = ' for="edit-menu-item-um_nav_roles-{{data.menuItemID}}_' . $k . '" ';
|
||||
$html .= "<label $for_attr>
|
||||
<input type='checkbox' {$id_attr} name='menu-item-um_nav_roles[{{data.menuItemID}}][]' value='{$k}' <# if( _.contains( data.restriction_data.um_nav_roles,'{$k}' ) ){ #>checked='checked'<# } #> />
|
||||
<input type='checkbox' {$id_attr} name='menu-item-um_nav_roles[{{data.menuItemID}}][{$k}]' value='1' <# if( _.contains( data.restriction_data.um_nav_roles,'{$k}' ) ){ #>checked='checked'<# } #> />
|
||||
<span>{$title}</span>
|
||||
</label>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user