PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | inc/user/class-lp-profile.php +10 -8 4.4.34.4.8 View file →
@@ -262,17 +262,19 @@
262 262 public function get_tabs() {
263 263 $user_of_profile = $this->get_user();
264 264 $tabs = self::get_tabs_arr();
265 265
266 - $userModelProfile = UserModel::find( $user_of_profile->get_id(), true );
267 - if ( $userModelProfile ) {
268 - $userModelProfileRoles = $userModelProfile->get_roles();
266 + if ( $user_of_profile ) {
267 + $userModelProfile = UserModel::find( $user_of_profile->get_id(), true );
268 + if ( $userModelProfile ) {
269 + $userModelProfileRoles = $userModelProfile->get_roles();
269 270
270 - /*
271 - * Check if user not Admin/Instructor, will be hide tab Courses.
272 - */
273 - if ( ! array_intersect( $userModelProfileRoles, [ UserModel::ROLE_ADMINISTRATOR, UserModel::ROLE_INSTRUCTOR ] ) ) {
274 - unset( $tabs['courses'] );
271 + /*
272 + * Check if user not Admin/Instructor, will be hide tab Courses.
273 + */
274 + if ( ! array_intersect( $userModelProfileRoles, [ UserModel::ROLE_ADMINISTRATOR, UserModel::ROLE_INSTRUCTOR ] ) ) {
275 + unset( $tabs['courses'] );
276 + }
275 277 }
276 278 }
277 279
278 280 // Filter tabs by role - only show tabs with role restriction to users with matching roles