src/WordPress/Plugin.php
public function register($provider, $options = [], $force = false)
  {
    if (is_string($provider) || is_class($provider)) {
      $implements = class_implements($provider);
      
      if (isset($implements['FatPanda\Illuminate\WordPress\Concerns\CustomSchema'])) {
        $this->customSchema[] = $provider;
        return $this;
      }

      if (isset($implements['FatPanda\Illuminate\WordPress\Concerns\CanShortcode'])) {
        // we have to do this right away
        call_user_func_array($provider . '::register', [ $this ]);
        return $this;
      }
    } 

    if (!$provider instanceof ServiceProvider) {
      $provider = new $provider($this);
    }

    if (array_key_exists($providerName = get_class($provider), $this->loadedProviders)) {
      return $this;
    }

    $this->loadedProviders[$providerName] = true;

    if (method_exists($provider, 'register')) {
      $provider->register();
    }

    if (method_exists($provider, 'boot')) {
      return $this->call([$provider, 'boot']);
    }

    return $this;
  }
public function register($provider, $options = [], $force = false)
  {
    if (is_string($provider) || is_class($provider)) {
      $implements = class_implements($provider);
      
      if (isset($implements['FatPanda\Illuminate\WordPress\Concerns\CustomSchema'])) {
        $this->customSchema[] = $provider;
        return $this;
      }

      if (isset($implements['FatPanda\Illuminate\WordPress\Concerns\CanShortcode'])) {
        // we have to do this right away
        call_user_func_array($provider . '::register', [ $this ]);
        return $this;
      }
    } 

    if (!$provider instanceof ServiceProvider) {
      $provider = new $provider($this);
    }

    if (array_key_exists($providerName = get_class($provider), $this->loadedProviders)) {
      return $this;
    }

    $this->loadedProviders[$providerName] = true;

    if (method_exists($provider, 'register')) {
      $provider->register();
    }

    if (method_exists($provider, 'boot')) {
      return $this->call([$provider, 'boot']);
    }

    return $this;
  }
public function register ( $ provider , $ options = [ ] , $ force = false ) { if ( is_string ( $ provider ) || is_class ( $ provider ) ) { $ implements = class_implements ( $ provider ) ; if ( isset ( $ implements [ 'FatPanda\Illuminate\WordPress\Concerns\CustomSchema' ] ) ) { $ this -> customSchema [ ] = $ provider ; return $ this ; } if ( isset ( $ implements [ 'FatPanda\Illuminate\WordPress\Concerns\CanShortcode' ] ) ) { // we have to do this right away call_user_func_array ( $ provider . '::register' , [ $ this ] ) ; return $ this ; } } if ( ! $ provider instanceof ServiceProvider ) { $ provider = new $ provider ( $ this ) ; } if ( array_key_exists ( $ providerName = get_class ( $ provider ) , $ this -> loadedProviders ) ) { return $ this ; } $ this -> loadedProviders [ $ providerName ] = true ; if ( method_exists ( $ provider , 'register' ) ) { $ provider -> register ( ) ; } if ( method_exists ( $ provider , 'boot' ) ) { return $ this -> call ( [ $ provider , 'boot' ] ) ; } return $ this ; }
Register a service provider or a CustomSchema with the plugin.
@param  mixed  $provider
@param  array  $options
@param  bool   $force
@return Plugin
Register a service provider or a CustomSchema with the plugin .