LLMS_Form_Post_Type::__construct( $forms )

Constructor


Return Return

(void)


Top ↑

Source Source

File: includes/forms/class-llms-form-post-type.php

	public function __construct( $forms ) {

		$this->forms = $forms;

		add_action( 'init', array( $this, 'register_post_type' ) );
		add_action( 'init', array( $this, 'register_meta' ) );

		// Modify permalink.
		add_filter( 'post_type_link', array( $this, 'modify_permalink' ), 10, 2 );

		// Prevent deletion of core forms.
		add_filter( 'pre_delete_post', array( $this, 'maybe_prevent_deletion' ), 20, 2 );
		add_filter( 'pre_trash_post', array( $this, 'maybe_prevent_deletion' ), 20, 2 );

		add_filter( 'rest_prepare_post_type', array( $this, 'enable_post_type_visibility' ), 10, 2 );

		/**
		 * Filters the capability required to manage LifterLMS Forms
		 *
		 * @since 5.0.0
		 *
		 * @param string $capability The user capability. Default: "manage_lifterlms".
		 */
		$this->capability = apply_filters( 'llms_forms_managment_capability', $this->capability );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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