Inventory_Presser_Plugin::load_integrations()

Add hooks that power our integrations with other plugins.

On This Page


Return Return

(void)


Top ↑

Source Source

File: inventory-presser.php

				/* translators: 1. Formatted date timestamp of a post revision. */
				5  => isset( $_GET['revision'] ) ? sprintf( __( 'Vehicle restored to revision from %s.', 'inventory-presser' ), wp_post_revision_title( (int) $_GET['revision'], false ) ) : false,
				6  => __( 'Vehicle published. ', 'inventory-presser' ) . $view_link,
				7  => __( 'Vehicle saved.', 'inventory-presser' ),
				8  => __( 'Vehicle submitted. ', 'inventory-presser' ) . $preview_link,
				/* translators: 1. A date. */
				9  => sprintf( __( 'Vehicle scheduled to list on <strong>%s</strong>. ', 'inventory-presser' ), $scheduled_date ) . $preview_link,
				10 => __( 'Vehicle draft updated. ', 'inventory-presser' ) . $preview_link,
			);
			return $msgs;
		}

		/**
		 * Fires on the plugins_loaded hook. Runs the invp_loaded action hook for
		 * all add-ons.
		 *
		 * @return void
		 */
		public function loaded() {
			// Fire an action hook after Inventory Presser is finished loading.
			do_action( 'invp_loaded' );
		}

		/**
		 * Add hooks that power our integrations with other plugins.
		 *
		 * @return void
		 */
		public function load_integrations() {
			static $active_plugins = array();
			if ( empty( $active_plugins ) ) {
				$active_plugins = apply_filters( 'active_plugins', get_option( 'active_plugins' ) );
			}

			if ( ! function_exists( 'is_plugin_active_for_network' ) ) {
				include_once ABSPATH . '/wp-admin/includes/plugin.php';
			}

			// WP All Import.
			$plugin_path = 'wp-all-import-pro/wp-all-import-pro.php';
			if ( in_array( $plugin_path, $active_plugins, true )
				|| is_plugin_active_for_network( $plugin_path ) ) {
				$wp_all_import = new Inventory_Presser_WP_All_Import();
				$wp_all_import->add_hooks();
			}

			// Contact Form 7.
			$plugin_path = 'contact-form-7/wp-contact-form-7.php';
			if ( class_exists( 'Inventory_Presser_Contact_Form_7' )
				&& ( in_array( $plugin_path, $active_plugins, true )
				|| is_plugin_active_for_network( $plugin_path ) ) ) {
				$contact_form_7 = new Inventory_Presser_Contact_Form_7();
				$contact_form_7->add_hooks();
			}

			// WPForms Lite.
			$plugin_path = 'wpforms-lite/wpforms.php';
			if ( in_array( $plugin_path, $active_plugins, true )
				|| is_plugin_active_for_network( $plugin_path ) ) {
				$forms = new Inventory_Presser_WPForms();
				$forms->add_hooks();
			}