EDD::__construct()


Source

File: classes/EDD.php

	public function __construct() {

		if ( ! dozent_edd_exists() ) {
			return;
		}

		$this->post_types = apply_filters( 'edd_download_metabox_post_types', array( 'download' ) );


		add_action( 'add_meta_boxes', [ $this, 'register_meta_box' ] );

		foreach ( $this->post_types as $post_type ) {
			add_action( "save_post_" . $post_type, [ $this, 'attach_courses_to_product' ] );
		}

		add_filter( 'dozent_course_price', [ $this, 'filter_course_price' ], 10, 2 );
		add_action( 'dozent_course_type_closed_gate', [ $this, 'dozent_course_gate' ] );

		add_action( 'edd_complete_purchase', [ $this, 'edd_complete_purchase' ], 10, 3 );
		add_filter( 'dozent_course_new_enrol_status', [ $this, 'new_enrol_status' ], 10, 4 );

		/**
		 * EDD Earning status change
		 * Useful to get back money from the instructor if any payment got refund or disput
		 */

		add_action( 'edd_update_payment_status', [ $this, 'edd_update_payment_status' ], 10, 3 );

	}