- removed UM prefix before UM custom roles;

This commit is contained in:
nikitozzzzzzz
2017-07-30 22:54:39 +03:00
parent 1cccd2caff
commit 8b9320b09f
6 changed files with 12 additions and 17 deletions
@@ -131,11 +131,6 @@ a.um-delete{ color: #a00; }
line-height: 37px;
}
#um_edit_role #title {
width: calc( 100% - 40px );
float:left;
}
#um-roles .row-actions .reset a {
color:#a00;
}
@@ -229,7 +229,7 @@ class UM_Roles_List_Table extends WP_List_Table {
return sprintf('%1$s %2$s', '<strong><a class="row-title" href="admin.php?page=um_roles&tab=edit&id=' . $item['key'] . '">'. ( ! empty( $item['_um_is_custom'] ) ? 'UM ' : '' ) . $item['name'] . '</a></strong>', $this->row_actions( $actions ) );
return sprintf('%1$s %2$s', '<strong><a class="row-title" href="admin.php?page=um_roles&tab=edit&id=' . $item['key'] . '">' . $item['name'] . '</a></strong>', $this->row_actions( $actions ) );
}
function column_roleid( $item ) {
@@ -325,16 +325,16 @@ foreach ( $wp_roles->roles as $roleID => $role_data ) {
switch( strtolower( $order ) ) {
case 'asc':
uasort( $roles, function( $a, $b ) {
$a['name'] = ! empty( $a['_um_is_custom'] ) ? 'UM ' . $a['name'] : $a['name'];
$b['name'] = ! empty( $b['_um_is_custom'] ) ? 'UM ' . $b['name'] : $b['name'];
//$a['name'] = ! empty( $a['_um_is_custom'] ) ? 'UM ' . $a['name'] : $a['name'];
//$b['name'] = ! empty( $b['_um_is_custom'] ) ? 'UM ' . $b['name'] : $b['name'];
return strnatcmp( $a['name'], $b['name'] );
} );
break;
case 'desc':
uasort( $roles, function( $a, $b ) {
$a['name'] = ! empty( $a['_um_is_custom'] ) ? 'UM ' . $a['name'] : $a['name'];
$b['name'] = ! empty( $b['_um_is_custom'] ) ? 'UM ' . $b['name'] : $b['name'];
//$a['name'] = ! empty( $a['_um_is_custom'] ) ? 'UM ' . $a['name'] : $a['name'];
//$b['name'] = ! empty( $b['_um_is_custom'] ) ? 'UM ' . $b['name'] : $b['name'];
return strnatcmp( $a['name'], $b['name'] ) * -1;
} );
+3 -3
View File
@@ -47,7 +47,7 @@ if ( ! empty( $_POST['role'] ) ) {
$all_roles = array_keys( get_editable_roles() );
if ( 'add' == $_GET['tab'] ) {
if ( in_array( 'um_' . $id, $all_roles ) )
if ( in_array( 'um_' . $id, $all_roles ) || in_array( $id, $all_roles ) )
$error .= __( 'Role already exists!', 'ultimate-member' ) . '<br />';
}
@@ -118,10 +118,10 @@ $screen_id = $current_screen->id; ?>
<div id="titlewrap">
<?php if ( 'add' == $_GET['tab'] ) { ?>
<label for="title" class="screen-reader-text"><?php _e( 'Title', 'ultimate-member' ) ?></label>
<span>UM&nbsp;</span><input type="text" name="role[name]" placeholder="<?php _e( 'Enter Title Here', 'ultimate-member' ) ?>" id="title" value="<?php echo isset( $data['name'] ) ? $data['name'] : '' ?>" />
<input type="text" name="role[name]" placeholder="<?php _e( 'Enter Title Here', 'ultimate-member' ) ?>" id="title" value="<?php echo isset( $data['name'] ) ? $data['name'] : '' ?>" />
<?php } else { ?>
<input type="hidden" name="role[name]" value="<?php echo isset( $data['name'] ) ? $data['name'] : '' ?>" />
<span style="float: left;width:100%;"><?php if ( ! empty( $data['_um_is_custom'] ) ) { ?>UM&nbsp;<?php } ?><?php echo isset( $data['name'] ) ? $data['name'] : '' ?></span>
<span style="float: left;width:100%;"><?php echo isset( $data['name'] ) ? $data['name'] : '' ?></span>
<?php } ?>
</div>
</div>
+2 -2
View File
@@ -2563,12 +2563,12 @@ if ( ! class_exists( 'Fields' ) ) {
$res = apply_filters("um_view_field_value_{$type}", $res, $data );
if ( $key == 'role_radio' || $key == 'role_select' ) {
/* if ( $key == 'role_radio' || $key == 'role_select' ) {
$role_meta = UM()->roles()->role_data( um_user( 'role' ) );
if ( ! empty( $role_meta['is_custom'] ) ) {
$res = 'UM ' . $res;
}
}
}*/
$output .= '<div class="um-field-area">';
$output .= '<div class="um-field-value">' . $res . '</div>';
+1 -1
View File
@@ -42,7 +42,7 @@ if ( ! class_exists( 'Roles_Capabilities' ) ) {
foreach ( $role_keys as $role_key ) {
$role_meta = get_option( "um_role_{$role_key}_meta" );
if ( $role_meta ) {
$role_meta['name'] = 'UM ' . $role_meta['name'];
//$role_meta['name'] = 'UM ' . $role_meta['name'];
$roles['um_' . $role_key] = $role_meta;
}
}
+1 -1
View File
@@ -249,7 +249,7 @@ if ( ! class_exists( 'User' ) ) {
$role_meta = get_option( "um_role_{$role_key}_meta" );
if ( $role_meta ) {
$role_meta['name'] = 'UM ' . $role_meta['name'];
//$role_meta['name'] = 'UM ' . $role_meta['name'];
$roles['um_' . $role_key] = $role_meta;
}
}