PHP code example of innocode-digital / wp-github-oauth
1. Go to this page and download the library: Download innocode-digital/wp-github-oauth library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
innocode-digital / wp-github-oauth example snippets
`
define( 'GITHUB_OAUTH_CLIENT_ID', '' );
define( 'GITHUB_OAUTH_CLIENT_SECRET', '' );
define( 'GITHUB_OAUTH_ORGANIZATION', 123456 ); // Organization ID
define( 'GITHUB_OAUTH_TEAMS2ROLES', [
'super_admin' => [
123456, 234567,
], // Applicable to Multisite, will be the same as 'administrator' for single sites
'administrator' => [
345678,
],
'editor' => [
456789, 567890, 654321,
],
] );
`
add_filter( 'innocode_github_oauth_scope', function ( array $scope ) {
return $scope; // Default is array containing 'user:email' and 'read:org'.
} );
`
add_filter( 'innocode_github_oauth_endpoint_mask', function ( $mask, $endpoint ) {
return $mask; // Default is EP_ROOT constant.
}, 10, 2 );
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.