AnsPress::site_include()

Description #

Include all public classes

Changelog #

VersionDescription
4.1.8Load all addons if constant ANSPRESS_ENABLE_ADDONS is set.
0.0.1Introduced.

Source #

File: anspress-question-answer.php

		public function site_include() {
			$this->theme_compat = new stdClass(); // Base theme compatibility class.

			$this->theme_compat->active = false;

			\AnsPress_Hooks::init();
			$this->activity = AnsPress\Activity_Helper::get_instance();
			\AnsPress_Views::init();

			// Load all addons if constant set.
			if ( defined( 'ANSPRESS_ENABLE_ADDONS' ) && ANSPRESS_ENABLE_ADDONS ) {
				foreach ( ap_get_addons() as $name => $data ) {
					ap_activate_addon( $name );
				}
			}

			foreach ( (array) ap_get_addons() as $data ) {
				if ( $data['active'] && file_exists( $data['path'] ) ) {
					require_once $data['path'];
				}
			}
		}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment