wordpress/wp-content/themes/basic/themify/class-themify-access-role.php
/**
	 * Renders the options for role access control
	 *
	 * @param array $data
	 * @return string
	 */
Renders the options for role access control
@param array $data
@return string
Renders the options for role access control @param array $data @return string
function config_view( $data = array() ){
		global $wp_roles;
		$roles = $wp_roles->get_names();
		unset( $roles['administrator'] );
		unset( $roles['subscriber'] );
		$setting = $data['attr']['setting'];
		$prefix = 'setting-'.$setting.'-';
		ob_start();
		if ( 'custom_panel' === $setting ) :
			?>
			<div class="themify-info-link"><?php _e( 'Role access allow certain user roles to have access to the tool. Only set disable if you want to disallow the tool to certain user(s), otherwise keep everything as default.', 'themify' ); ?></div>
			<?php
		endif;
		?>
		<ul>
		<?php foreach( $roles as $role => $slug ) {
						$prefix_role = esc_attr($prefix.$role);
			$value = themify_builder_get( $prefix_role,$prefix_role);
			$value = ( null !== $value ) ? $value : 'default';
			?>
			<li class="role-access-controller">
				<!-- Set the column title -->
				<div class="role-title">
					<?php echo $slug; ?>
				</div>
				<!-- Set option to default -->
				<div class="role-option role-default">
					<input type="radio" id="default-<?php echo $prefix_role; ?>" name="<?php echo $prefix_role; ?>" value="default" <?php echo checked( $value, 'default', false ); ?>/>
					<label for="default-<?php echo $prefix_role; ?>"><?php _e( 'Default', 'themify' ); ?></label>
				</div>
				<!-- Set option to enable -->
				<div class="role-option role-enable">
					<input type="radio" id="enable-<?php echo $prefix_role; ?>" name="<?php echo $prefix_role; ?>" value="enable" <?php echo checked( $value, 'enable', false ); ?>/>
					<label for="enable-<?php echo $prefix_role; ?>"><?php _e( 'Enable', 'themify' ); ?></label>
				</div>
				<!-- Set option to disable -->
				<div class="role-option role-disable">
					<input type="radio" id="disable-<?php echo $prefix_role; ?>" name="<?php echo $prefix_role; ?>" value="disable" <?php echo checked( $value, 'disable', false ); ?>/>
					<label for="disable-<?php echo $prefix_role; ?>"><?php _e( 'Disable', 'themify' ); ?></label>
				</div>
		   </li>
		<?php }?>
		</ul>
		<?php
		return ob_get_clean();
	}
function config_view ( $ data = array ( ) ) { global $ wp_roles ; $ roles = $ wp_roles -> get_names ( ) ; unset ( $ roles [ 'administrator' ] ) ; unset ( $ roles [ 'subscriber' ] ) ; $ setting = $ data [ 'attr' ] [ 'setting' ] ; $ prefix = 'setting-' . $ setting . '-' ; ob_start ( ) ; if ( 'custom_panel' === $ setting ) : ?> <div class="themify-info-link"> <?php _e ( 'Role access allow certain user roles to have access to the tool. Only set disable if you want to disallow the tool to certain user(s), otherwise keep everything as default.' , 'themify' ) ; ?> </div>
			 <?php endif ; ?> <ul>
		 <?php foreach ( $ roles as $ role => $ slug ) { $ prefix_role = esc_attr ( $ prefix . $ role ) ; $ value = themify_builder_get ( $ prefix_role , $ prefix_role ) ; $ value = ( null !== $ value ) ? $ value : 'default' ; ?> <li class="role-access-controller">
				<!-- Set the column title -->
				<div class="role-title">
					 <?php echo $ slug ; ?> </div>

				<!-- Set option to default -->
				<div class="role-option role-default">
					<input type="radio" id="default- <?php echo $ prefix_role ; ?> " name=" <?php echo $ prefix_role ; ?> " value="default"  <?php echo checked ( $ value , 'default' , false ) ; ?> />
					<label for="default- <?php echo $ prefix_role ; ?> "> <?php _e ( 'Default' , 'themify' ) ; ?> </label>
				</div>

				<!-- Set option to enable -->
				<div class="role-option role-enable">
					<input type="radio" id="enable- <?php echo $ prefix_role ; ?> " name=" <?php echo $ prefix_role ; ?> " value="enable"  <?php echo checked ( $ value , 'enable' , false ) ; ?> />
					<label for="enable- <?php echo $ prefix_role ; ?> "> <?php _e ( 'Enable' , 'themify' ) ; ?> </label>
				</div>

				<!-- Set option to disable -->
				<div class="role-option role-disable">
					<input type="radio" id="disable- <?php echo $ prefix_role ; ?> " name=" <?php echo $ prefix_role ; ?> " value="disable"  <?php echo checked ( $ value , 'disable' , false ) ; ?> />
					<label for="disable- <?php echo $ prefix_role ; ?> "> <?php _e ( 'Disable' , 'themify' ) ; ?> </label>
				</div>
		   </li>
		 <?php } ?> </ul>
		 <?php return ob_get_clean ( ) ; }
Renders the options for role access control
 @param array $data
 @return string
Renders the options for role access control @param array $data @return string
// Remove the adminitrator and subscriber user role from the array // Get the unique setting name // Generate prefix with the setting name // Get value from the database // Check if the user has not saved any setting till now, if so, set the 'default' as value //end foreach 