LLMS_Beaver_Builder_Migrate::remove_template_hooks()

Removes core template action hooks from posts which have been migrated to beaver builder widgets.


Return Return

(void)


Top ↑

Source Source

File: includes/class-llms-beaver-builder-migrate.php

	public function remove_template_hooks() {
		if ( ! function_exists( 'llms_is_beaver_builder_post' ) ||
			! llms_is_beaver_builder_post() ||
			( get_the_ID() && ! llms_parse_bool( get_post_meta( get_the_ID(), '_llms_beaver_builder_migrated', true ) ) ) ) {

			if ( ! $this->is_migratable_post_type( get_the_ID() ) ) {
				return;
			}

			// Remove the bottom actions if the builder is currently active to avoid confusion with uneditable pieces.
			if ( ! class_exists( 'FLBuilderModel' ) || ! method_exists( 'FLBuilderModel', 'is_builder_active' ) || ! FLBuilderModel::is_builder_active() ) {
				return;
			}
		}

		switch ( get_post_type() ) {
			case 'course':
				$this->remove_course_template_hooks();
				break;
			case 'lesson':
				$this->remove_lesson_template_hooks();
				break;
			case 'llms_membership':
				$this->remove_membership_template_hooks();
				break;
		}
	}


Top ↑

Changelog Changelog

Changelog
Version Description
8.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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