Skip to content

Commit

Permalink
Update module for Newfold
Browse files Browse the repository at this point in the history
  • Loading branch information
wpscholar committed Mar 8, 2022
1 parent cbe553c commit 459556e
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/satis-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.WEBHOOK_TOKEN }}
repository: bluehost/satis
event-type: 'Trigger Satis Build'
repository: newfold-labs/satis
event-type: 'satis-build'
client-payload: >-
{
"vendor": "${{ github.repository_owner }}",
Expand Down
21 changes: 5 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,16 @@ Single sign-on functionality for WordPress.

## Installation

### 1. Add the Bluehost Satis to your `composer.json`.
### 1. Add the Newfold Satis to your `composer.json`.

```bash
composer config repositories.bluehost composer https://bluehost.github.io/satis
composer config repositories.newfold composer https://newfold.github.io/satis
```

### 2. Require the `newfold/wp-module-sso` package.
### 2. Require the `newfold-labs/wp-module-sso` package.

```bash
composer require newfold/wp-module-sso
composer require newfold-labs/wp-module-sso
```

## Usage

## More on NewFold WordPress Modules

* <a href="https://github.com/bluehost/endurance-wp-module-loader#endurance-wordpress-modules">What are modules?</a>
* <a href="https://github.com/bluehost/endurance-wp-module-loader#creating--registering-a-module">Creating/registering
modules</a>
* <a href="https://github.com/bluehost/endurance-wp-module-loader#installing-from-our-satis">Installing from our
Satis</a>
* <a href="https://github.com/bluehost/endurance-wp-module-loader#local-development">Local development notes</a>
* <a href="https://github.com/bluehost/endurance-wp-module-loader#understanding-the-module-lifecycle">Understanding the
module lifecycle</a>
[More on NewFold WordPress Modules](https://github.com/newfold-labs/wp-module-loader)
39 changes: 19 additions & 20 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
<?php

use function NewfoldLabs\WP\ModuleLoader\register;

if ( function_exists( 'add_action' ) ) {
add_action( 'plugins_loaded', 'newfold_module_register_sso' );
}

/**
* Register the SSO module.
*/
function newfold_module_register_sso() {
eig_register_module(
array(
'name' => 'sso',
'label' => __( 'SSO', 'endurance' ),
'callback' => 'newfold_module_load_sso',
'isActive' => true,
'isHidden' => false,
)
add_action(
'plugins_loaded',
function () {

register(
[
'name' => 'sso',
'label' => __( 'SSO', 'endurance' ),
'callback' => function () {
require __DIR__ . '/sso.php';
},
'isActive' => true,
'isHidden' => true,
]
);

}
);
}

/**
* Load the SSO module.
*/
function newfold_module_load_sso() {
require dirname( __FILE__ ) . '/sso.php';
}
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
{
"name": "newfold/wp-module-sso",
"description": "Single sign-on functionality for WordPress.",
"name": "newfold-labs/wp-module-sso",
"description": "Single sign-on functionality for Newfold WordPress sites.",
"license": "GPL-2.0-or-later",
"repositories": [
{
"type": "composer",
"url": "https://newfold-labs.github.io/satis/",
"only": [
"newfold-labs/*"
]
},
{
"type": "composer",
"url": "https://bluehost.github.io/satis/",
Expand All @@ -22,7 +29,7 @@
],
"autoload": {
"psr-4": {
"NewFold\\SSO\\": "includes"
"NewFoldLabs\\WP\\Module\\SSO\\": "includes"
},
"files": [
"bootstrap.php"
Expand Down
2 changes: 1 addition & 1 deletion includes/SSO_AJAX_Handler.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NewFold\SSO;
namespace NewFoldLabs\WP\Module\SSO;

class SSO_AJAX_Handler {

Expand Down
2 changes: 1 addition & 1 deletion includes/SSO_Helpers.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NewFold\SSO;
namespace NewFoldLabs\WP\Module\SSO;

class SSO_Helpers {

Expand Down
2 changes: 1 addition & 1 deletion includes/SSO_REST_Controller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace NewFold\SSO;
namespace NewFoldLabs\WP\Module\SSO;

class SSO_REST_Controller extends \WP_REST_Controller {

Expand Down
4 changes: 2 additions & 2 deletions sso.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use NewFold\SSO\SSO_AJAX_Handler;
use NewFold\SSO\SSO_REST_Controller;
use NewFoldLabs\WP\Module\SSO\SSO_AJAX_Handler;
use NewFoldLabs\WP\Module\SSO\SSO_REST_Controller;

new SSO_AJAX_Handler();

Expand Down

0 comments on commit 459556e

Please sign in to comment.