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.


Description Description

Called by $this->output() before actually outputting html.


Top ↑

Return Return

(void)


Top ↑

Source Source

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

		}

		delete_option( $this->error_opt_key );

	}

	/**
	 * Process fields to setup navigation and content with minimal PHP loops.
	 *
	 * Called by `$this->output()` before actually outputting html.
	 *
	 * @since 3.0.0
	 * @since 3.16.14 Unknown.
	 * @since 6.0.0 Move single field processing logic to a specific method {@see LLMS_Admin_Metabox::process_field()}.
	 *
	 * @return void
	 */
	private function process_fields() {

		// Create a filter-safe ID that conforms to WordPress coding standards for hooks.
		$id = str_replace( '-', '_', $this->id );

		/**
		 * Customize metabox fields prior to field processing.
		 *
		 * The dynamic portion of this filter, `$id`, corresponds to the classes `$id` property with
		 * dashes (`-`) replaced with underscores (`_`). If the class id is "my-metabox" the filter would be
		 * "llms_metabox_fields_my_metabox".
		 *
		 * @since Unknown
		 *
		 * @param array $fields Array of metabox fields.
		 */
		$fields = apply_filters( "llms_metabox_fields_{$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 ) {
				$this->content .= $this->process_field( $field );
			}

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

		}

	}

	/**
	 * Process single field.

Top ↑

Changelog Changelog

Changelog
Version Description
3.16.14 Unknown.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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