-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat): add show on to settings, openpub-item and api
- Loading branch information
Showing
17 changed files
with
286 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,22 @@ | ||
# README # | ||
# README | ||
|
||
This README documents whatever steps are necessary to get this plugin up and running. | ||
|
||
## How do I get set up ## | ||
## How do I get set up | ||
|
||
* Unzip and/or move all files to the /wp-content/plugins/openpub-base directory | ||
* Log into WordPress admin and activate the ‘OpenPub Base’ plugin through the ‘Plugins’ menu | ||
* Go to the 'OpenPub instellingen pagina' in the left-hand menu to enter some of the required settings | ||
- Unzip and/or move all files to the /wp-content/plugins/openpub-base directory | ||
- Log into WordPress admin and activate the ‘OpenPub Base’ plugin through the ‘Plugins’ menu | ||
- Go to the 'OpenPub instellingen pagina' in the left-hand menu to enter some of the required settings | ||
|
||
## Hooks ## | ||
## Hooks | ||
|
||
See [Hooks](/docs/hooks.md) | ||
|
||
## REST API ## | ||
## REST API | ||
|
||
See [REST API](/docs/restapi.md) | ||
|
||
## Translations ## | ||
## Translations | ||
|
||
If you want to use your own set of labels/names/descriptions and so on you can do so. | ||
All text output in this plugin is controlled via the gettext methods. | ||
|
@@ -32,7 +32,7 @@ This plugin provides an easy interface for custom translations and a way to stor | |
For instructions how to use the 'Loco Translate' plugin, we advice you to read the Beginners's guide page on their website: https://localise.biz/wordpress/plugin/beginners | ||
or start at the homepage: https://localise.biz/wordpress/plugin | ||
|
||
## Running tests ## | ||
## Running tests | ||
|
||
To run the Unit tests go to a command-line. | ||
|
||
|
@@ -48,15 +48,33 @@ For code coverage report, generate report with command line command and view res | |
phpunit --coverage-html ./tests/coverage | ||
``` | ||
|
||
## Contribution guidelines ## | ||
## Shared environment | ||
|
||
### Writing tests ### | ||
If the openpub environment is shared by multiple websites and it is required to configure the websites where an openpub-item should be displayed on, follow the steps below: | ||
|
||
- Go to the 'OpenPub instellingen pagina' in the left-hand menu and look for the setting 'Show on'. Check the checkbox. | ||
|
||
When this setting is enabled this plugin creates a taxonomy 'Show on'. | ||
|
||
- Add terms to the taxonomy so the terms can be used in the editor of an openpub-item. | ||
|
||
This plugin also adds a select element to the editor of an openpub-item. | ||
|
||
- Look for the select beneath the heading 'External'. | ||
- Select the websites you want this item to be displayed on. | ||
|
||
The selected websites are able now to make requests to the items endpoint and only retrieve openpub-items that are intended for the selected website. | ||
Example url: https://url/wp-json/owc/openpub/v1/items?source={blog_slug} | ||
|
||
## Contribution guidelines | ||
|
||
### Writing tests | ||
|
||
Have a look at the code coverage reports to see where more coverage can be obtained. | ||
Write tests | ||
Create a Pull request to the OWC repository | ||
|
||
### Who do I talk to ### | ||
### Who do I talk to | ||
|
||
IF you have questions about or suggestions for this plugin, please contact | ||
[Holgers Peters](mailto:[email protected]) from Gemeente Buren. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
return [ | ||
'show_on' => [ | ||
'id' => 'show_on', | ||
'title' => __('External', 'openpub-base'), | ||
'post_types' => ['openpub-item'], | ||
'context' => 'normal', | ||
'priority' => 'low', | ||
'autosave' => true, | ||
'fields' => [ | ||
'settings' => [ | ||
[ | ||
'name' => __('Show on', 'openpub-base'), | ||
'desc' => __('Select websites where this item should be displayed on.', 'openpub-base'), | ||
'id' => 'show_on_active', | ||
'type' => 'taxonomy', | ||
'taxonomy' => 'openpub-show-on', | ||
'field_type' => 'select_advanced', | ||
'required' => 1, | ||
'multiple' => 1 | ||
], | ||
] | ||
] | ||
] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.