| 115 | /** |
| 116 | * Returns the translated role name. |
| 117 | * |
| 118 | * Just passing the name property to `translate_user_role` to translate |
| 119 | * it in the current language. Also check if the property has a value |
| 120 | * to be sure we are returning a string. |
| 121 | * |
| 122 | * @access public |
| 123 | * |
| 124 | * @return string The translated role name. |
| 125 | */ |
| 126 | public function display_name() { |
| 127 | if ( $this->name && is_string( $this->name ) ) { |
| 128 | return translate_user_role( $this->name ); |
| 129 | } |
| 130 | |
| 131 | return ''; |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Returns the untranslated role name. |
| 136 | * |
| 137 | * Return the unmodified raw role name. Also check if the property |
| 138 | * has a value to be sure we are returning a string. |
| 139 | * |
| 140 | * @access public |
| 141 | * |
| 142 | * @return string The raw role name. |
| 143 | */ |
| 144 | public function raw_display_name() { |
| 145 | if ( $this->name && is_string( $this->name ) ) { |
| 146 | return $this->name; |
| 147 | } |
| 148 | |
| 149 | return ''; |
| 150 | } |
| 151 | |