Automator_Load::__construct()

class constructor


Source Source

File: src/class-automator-load.php

	public function __construct() {
		if ( strpos( $_SERVER['REQUEST_URI'], 'favicon' ) ) {
			// bail out if it's favicon.ico
			return;
		}
		// Show upgrade notice from readme.txt.
		add_action(
			'in_plugin_update_message-' . plugin_basename( AUTOMATOR_BASE_FILE ),
			array( $this, 'in_plugin_update_message' ),
			10,
			2
		);

		// Load Admin only files.
		add_filter( 'automator_core_files', array( $this, 'admin_only_classes' ) );

		// Load Custom Post Types only files.
		add_filter( 'automator_core_files', array( $this, 'custom_post_types_classes' ) );

		// Load non-admin files.
		add_filter( 'automator_core_files', array( $this, 'front_only_classes' ) );

		// Load both admin & non-admin files.
		add_filter( 'automator_core_files', array( $this, 'global_classes' ) );

		// Add the pro links utm_r attributes.
		add_action( 'admin_footer', array( $this, 'global_utm_r_links' ) );

		// Show 'Upgrade to Pro' on plugins page.
		add_filter(
			'plugin_action_links_' . plugin_basename( AUTOMATOR_BASE_FILE ),
			array(
				$this,
				'uo_automator_upgrade_to_pro_link',
			),
			99
		);

		$this->load_automator();

	}