/** * Register the compatibility hooks for the plugin. */ function compatibility_init() { /* * WP_Customize_Control * /wp-includes/class-wp-customize_control.php */ add_filter('attachment_url_to_postid', array($this, 'customizer_background_image'), 10, 2); if ($this->as3cf->is_plugin_setup()) { $this->compatibility_init_if_setup(); } }
/** * Should filter content. * * @return bool */ protected function should_filter_content() { if ($this->as3cf->is_plugin_setup() && $this->as3cf->get_setting('serve-from-s3')) { return true; } return false; }
/** * Register the compatibility hooks for the plugin. */ function compatibility_init() { /* * WP_Customize_Control * /wp-includes/class-wp-customize_control.php */ add_filter('attachment_url_to_postid', array($this, 'customizer_background_image'), 10, 2); /* * Responsive Images WP 4.4 */ add_filter('wp_calculate_image_srcset', array($this, 'wp_calculate_image_srcset'), 10, 5); add_filter('wp_calculate_image_srcset_meta', array($this, 'wp_calculate_image_srcset_meta'), 10, 4); if ($this->as3cf->is_plugin_setup()) { $this->compatibility_init_if_setup(); } }
/** * Register the compatibility hooks for the plugin. */ function compatibility_init() { /* * WP_Customize_Control * /wp-includes/class-wp-customize_control.php */ add_filter('attachment_url_to_postid', array($this, 'customizer_background_image'), 10, 2); /* * Responsive Images WP 4.4+ */ global $wp_version; if (0 === version_compare($wp_version, '4.4')) { add_filter('the_content', array($this, 'wp_make_content_images_responsive'), 11); } add_filter('wp_calculate_image_srcset', array($this, 'wp_calculate_image_srcset'), 10, 5); if ($this->as3cf->is_plugin_setup()) { $this->compatibility_init_if_setup(); } }
/** * Can we start the upgrade using default checks * * @return bool */ protected function maybe_init() { if (!is_admin() || defined('DOING_AJAX') && DOING_AJAX) { return false; } // make sure this only fires inside the network admin for multisites if (is_multisite() && !is_network_admin()) { return false; } // Is plugin setup? if (!$this->as3cf->is_plugin_setup()) { return false; } // Have we completed the upgrade? if ($this->get_saved_upgrade_id() >= $this->upgrade_id) { return false; } // Has the previous upgrade completed yet? if (!$this->has_previous_upgrade_completed()) { return false; } // Does the upgrade lock exist? if (false !== get_site_transient($this->lock_key)) { return false; } // Do we actually have attachments to process? if (0 === $this->count_items_to_process()) { $this->upgrade_finished(); return false; } // If the upgrade status is already set, then we've already initialized the upgrade if ($upgrade_status = $this->get_upgrade_status()) { if (self::STATUS_RUNNING === $upgrade_status) { // Make sure cron job is persisted in case it has dropped $this->schedule(); } return false; } return true; }
/** * Check to see if the plugin is setup * * @return bool */ function is_plugin_setup() { if (isset($this->licence)) { if (!$this->licence->is_valid_licence()) { // Empty, invalid or expired license return false; } if ($this->licence->is_licence_over_media_limit()) { // License key over the media library total license limit return false; } } return parent::is_plugin_setup(); }