LLMS_Admin_Metabox::__construct()

Constructor.


Description Description

Configure the metabox and automatically add required actions.


Top ↑

Return Return

(void)


Top ↑

Source Source

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

	 *
	 * @return void
	 */
	public function __construct() {

		// Allow child classes to configure variables.
		$this->configure();

		// Set the error option key.
		$this->error_opt_key = sprintf( 'lifterlms_metabox_errors%s', $this->id );

		// Register the metabox.
		add_action( 'add_meta_boxes', array( $this, 'register' ) );

		// Register save actions for applicable screens (post types).
		foreach ( $this->get_screens() as $screen ) {
			add_action( 'save_post_' . $screen, array( $this, 'save_actions' ), 10, 1 );
		}

		// Display errors.
		add_action( 'admin_notices', array( $this, 'output_errors' ) );

		// Save errors.

Top ↑

Changelog Changelog

Changelog
Version Description
3.37.12 Use $this->error_opt_key() in favor of hardcoded option name.
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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