Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Admin_Metabox::process_fields()

Process fields to setup navigation and content with minimal PHP loops called by $this->output before actually outputting html


Description Description


Return Return

(void)


Top ↑

Source Source

File: includes/abstracts/abstract.llms.admin.metabox.php

	private function process_fields() {

		/**
		 * Add a filter so extending classes don't have to
		 * so we don't have too many filters running
		 */
		$fields = apply_filters( 'llms_metabox_fields_' . str_replace( '-', '_', $this->id ), $this->get_fields() );

		$this->total_tabs = count( $fields );

		foreach ( $fields as $i => $tab ) {

			$i++;
			$current = 1 === $i ? ' llms-active' : '';

			$this->navigation .= '<li class="llms-nav-item tab-link ' . $current . '" data-tab="' . $this->id . '-tab-' . $i . '"><span class="llms-nav-link">' . $tab['title'] . '</span></li>';

			$this->content .= '<div id="' . $this->id . '-tab-' . $i . '" class="tab-content' . $current . '"><ul>';

			foreach ( $tab['fields'] as $field ) {

				$name = ucfirst( strtr( preg_replace_callback( '/(\w+)/', function( $m ) {
					return ucfirst( $m[1] );
				}, $field['type'] ),'-','_' ) );

				$field_class_name = str_replace( '{TOKEN}', $name, 'LLMS_Metabox_{TOKEN}_Field' );
				$field_class = new $field_class_name($field);
				ob_start();
				$field_class->Output();
				$this->content .= ob_get_clean();
				unset( $field_class );
			}

			$this->content .= '</ul></div>';

		}

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.





Permalink: