wordpress/wp-content/themes/basic/themify/class-themify-access-role.php
// Hide Themify Custom Panel and Backend Builder
Hide Themify Custom Panel and Backend Builder
Hide Themify Custom Panel and Backend Builder
function tf_themify_hide_custom_panel_and_backend_builder( $meta ) {
		if( is_user_logged_in() ){
			$role = self::get_current_role();
			$prefix = 'setting-custom_panel-';
			$custom_panel = themify_builder_get( $prefix.$role, $prefix.$role );
			$prefix = 'setting-backend-';
			$backend_builder = themify_builder_get( $prefix.$role, $prefix.$role );
			if( 'disable' === $backend_builder || 'disable' === $custom_panel ){
				foreach( $meta as $key => $panel ) {
					if ( ('disable' === $backend_builder && 'page-builder' === $panel['id'] ) ||('disable' === $custom_panel &&  'page-builder' !== $panel['id'])) {
						unset( $meta[ $key ] );
					}
				}
			}
		}
		return $meta;
	}
function tf_themify_hide_custom_panel_and_backend_builder ( $ meta ) { if ( is_user_logged_in ( ) ) { $ role = self :: get_current_role ( ) ; $ prefix = 'setting-custom_panel-' ; $ custom_panel = themify_builder_get ( $ prefix . $ role , $ prefix . $ role ) ; $ prefix = 'setting-backend-' ; $ backend_builder = themify_builder_get ( $ prefix . $ role , $ prefix . $ role ) ; if ( 'disable' === $ backend_builder || 'disable' === $ custom_panel ) { foreach ( $ meta as $ key => $ panel ) { if ( ( 'disable' === $ backend_builder && 'page-builder' === $ panel [ 'id' ] ) || ( 'disable' === $ custom_panel && 'page-builder' !== $ panel [ 'id' ] ) ) { unset ( $ meta [ $ key ] ) ; } } } } return $ meta ; }
Hide Themify Custom Panel and Backend Builder
Hide Themify Custom Panel and Backend Builder
// Get current user's properties // Generate prefix with the setting name for custom panel // Generate prefix with the setting name for backend builder // Remove Page Builde if disabled from role access control // Check each meta box for panels // if page builder id found in meta boxes, unset it // Remove Custom Panel if disabled from role access control