We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Central uses the connect plugin to accomplish many tasks.
If the connect plugin is disabled for any reason, several tasks must still be done to ensure a smooth user journey.
The following code needs to be ran in the event the connect plugin is unavailable.
$optionConfigs = get_option( 'bg_connect_configs', [] ); add_filter( 'BoldgridDemo/configs', function( $configs ) use ( $optionConfigs ) { $configs['servers']['asset'] = ! empty( $optionConfigs['asset_server'] ) ? $optionConfigs['asset_server'] : $configs['servers']['asset']; return $configs; } ); // Inspirations add_filter( 'boldgrid_inspirations_configs', function ( $configs ) use ( $optionConfigs ) { $configs[ 'asset_server' ] = ! empty( $optionConfigs['asset_server'] ) ? $optionConfigs['asset_server'] : $configs['servers']['asset']; return $configs; } ); // BoldGrid Library add_filter( 'Boldgrid\Library\Configs\set', function( $configs ) use ( $optionConfigs ) { $configs[ 'api' ] = ! empty( $optionConfigs['asset_server'] ) ? $optionConfigs['asset_server'] : $configs[ 'api' ]; return $configs; } ); // BoldGrid Connect Plugin. add_filter( 'boldgrid_connect_config_setup_configs', function( $configs ) use ( $optionConfigs ) { $configs['asset_server'] = ! empty( $optionConfigs['asset_server'] ) ? $optionConfigs['asset_server'] : $configs[ 'asset_server' ]; $configs['central_url'] = ! empty( $optionConfigs['central_url'] ) ? $optionConfigs['central_url'] : $configs[ 'central_url' ]; return $configs; } ); /** * Filters the bg_connect_configs option to merge option with static configs provided. * * @param mixed $value Value of the option. * @param string $option Option name. * @return false|mixed (Maybe) filtered option value. */ add_filter( 'option_bg_connect_configs', function( $value, $option ) { $value = is_array( $value ) ? $value : []; $conf = \Boldgrid_Connect_Service::get( 'configs' ); $confs = array_merge( $conf, $value ); // Brand being passed in from install loop through and update option with correct provider. if ( ! empty( $confs['brand'] ) ) { foreach ( $confs['branding'] as $brand => $opts ) { if ( strpos( strtolower( $brand ), $confs['brand'] ) !== false ) { update_site_option( 'boldgrid_connect_provider', $brand ); } } } return $confs; }, 10, 2 );
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Central uses the connect plugin to accomplish many tasks.
If the connect plugin is disabled for any reason, several tasks must still be done to ensure a smooth user journey.
The following code needs to be ran in the event the connect plugin is unavailable.
The text was updated successfully, but these errors were encountered: