LLMS_Install::install()

Core install function


Return Return

(void)


Top ↑

Source Source

File: includes/class.llms.install.php

	public static function install() {

		if ( ! is_blog_installed() ) {
			return;
		}

		/**
		 * Action run immediately prior to LLMS_Install::install() routine.
		 *
		 * @since Unknown
		 */
		do_action( 'lifterlms_before_install' );

		LLMS_Site::set_lock_url();
		self::create_tables();
		self::create_options();
		LLMS_Roles::install();

		LLMS_Post_Types::register_post_types();
		LLMS_Post_Types::register_taxonomies();

		llms()->query->init_query_vars();
		llms()->query->add_endpoints();

		self::create_cron_jobs();
		self::create_files();
		self::create_difficulties();
		self::create_visibilities();

		LLMS_Forms::instance()->install();

		$version    = get_option( 'lifterlms_current_version', null );
		$db_version = get_option( 'lifterlms_db_version', $version );

		// Trigger first time run redirect.
		if ( ( is_null( $version ) || is_null( $db_version ) ) || 'no' === get_option( 'lifterlms_first_time_setup', 'no' ) ) {
			set_transient( '_llms_first_time_setup_redirect', 'yes', 30 );
		}

		self::run_db_updates( $db_version );
		self::update_llms_version();

		flush_rewrite_rules();

		/**
		 * Action run immediately after the LLMS_Install::install() routine has completed.
		 *
		 * @since Unknown
		 */
		do_action( 'lifterlms_after_install' );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.2.0 Moved DB update logic to LLMS_Install::run_db_updates().
5.0.0 Install forms.
3.13.0 Unknown.
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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