Amazon_S3_And_CloudFront::is_plugin_setup PHP Method

is_plugin_setup() public method

Check the plugin is correctly setup
public is_plugin_setup ( ) : boolean
return boolean
    function is_plugin_setup()
    {
        if (is_wp_error($this->aws->get_client())) {
            // AWS not configured
            return false;
        }
        if (false === (bool) $this->get_setting('bucket')) {
            // No bucket selected
            return false;
        }
        if (is_wp_error($this->get_setting('region'))) {
            // Region error when retrieving bucket location
            return false;
        }
        // All good, let's do this
        return true;
    }

Usage Example

 /**
  * 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();
     }
 }
All Usage Examples Of Amazon_S3_And_CloudFront::is_plugin_setup
Amazon_S3_And_CloudFront