Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/interact.../vendor/saltus/framewor...
File: README.md
# Saltus Framework
[0] Fix | Delete
Saltus Framework helps you develop WordPress plugins that are based on Custom Post Types.
[1] Fix | Delete
[2] Fix | Delete
We built it to make things easier and faster for developers with different skills. Add metaboxes, settings pages and other enhancements with just a few lines of code.
[3] Fix | Delete
[4] Fix | Delete
### Features
[5] Fix | Delete
* Create Custom Post Types easily
[6] Fix | Delete
* Control all labels and messages
[7] Fix | Delete
* Add administration columns
[8] Fix | Delete
* Add administration lists
[9] Fix | Delete
* Add settings pages
[10] Fix | Delete
* Add metaboxes
[11] Fix | Delete
* Enable cloning
[12] Fix | Delete
* Enable single entry export
[13] Fix | Delete
* Enable drag&drop reordering
[14] Fix | Delete
* Create Taxonomies easily
[15] Fix | Delete
* Control labels
[16] Fix | Delete
* Associate with any existing post type
[17] Fix | Delete
[18] Fix | Delete
### Requirements
[19] Fix | Delete
[20] Fix | Delete
Saltus Framework requires PHP 7.0+
[21] Fix | Delete
[22] Fix | Delete
## Getting Started
[23] Fix | Delete
[24] Fix | Delete
### Demo
[25] Fix | Delete
[26] Fix | Delete
Refer to the [Framework Demo](https://github.com/SaltusDev/framework-demo) for a complete plugin example and to the [Wiki](https://github.com/SaltusDev/saltus-framework/wiki) for complete documentation.
[27] Fix | Delete
[28] Fix | Delete
[29] Fix | Delete
Once the framework is included in your plugin, you can initialize it the following way:
[30] Fix | Delete
[31] Fix | Delete
```php
[32] Fix | Delete
if ( class_exists( \Saltus\WP\Framework\Core::class ) ) {
[33] Fix | Delete
[34] Fix | Delete
/*
[35] Fix | Delete
* The path to the plugin root directory is mandatory,
[36] Fix | Delete
* so it loads the models from a subdirectory.
[37] Fix | Delete
*/
[38] Fix | Delete
$framework = new \Saltus\WP\Framework\Core( dirname( __FILE__ ) );
[39] Fix | Delete
$framework->register();
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* Initialize plugin after this
[43] Fix | Delete
*/
[44] Fix | Delete
[45] Fix | Delete
}
[46] Fix | Delete
```
[47] Fix | Delete
[48] Fix | Delete
The framework will search for a model file, by default in the folder `src/models`. This can be changed using a filter.
[49] Fix | Delete
[50] Fix | Delete
A model file should return one array or a multidimensional array of models to build the Custom Post Types or Taxonomies. Simple example:
[51] Fix | Delete
[52] Fix | Delete
```php
[53] Fix | Delete
return [
[54] Fix | Delete
'type' => 'cpt',
[55] Fix | Delete
'name' => 'movie',
[56] Fix | Delete
];
[57] Fix | Delete
```
[58] Fix | Delete
[59] Fix | Delete
The above example will create a Custom Post Type 'movie'.
[60] Fix | Delete
[61] Fix | Delete
Several models in same file:
[62] Fix | Delete
[63] Fix | Delete
```php
[64] Fix | Delete
return [
[65] Fix | Delete
[
[66] Fix | Delete
'type' => 'cpt',
[67] Fix | Delete
'name' => 'movie',
[68] Fix | Delete
],
[69] Fix | Delete
[
[70] Fix | Delete
'type' => 'category',
[71] Fix | Delete
'name' => 'genre',
[72] Fix | Delete
'associations' => [
[73] Fix | Delete
‘movie’,
[74] Fix | Delete
],
[75] Fix | Delete
],
[76] Fix | Delete
];
[77] Fix | Delete
```
[78] Fix | Delete
[79] Fix | Delete
The above example will create a Custom Post Type 'movie' and a hierarchical Taxonomy 'genre' associated with the Custom Post Type 'movie'.
[80] Fix | Delete
[81] Fix | Delete
## Models
[82] Fix | Delete
[83] Fix | Delete
Currently there are 2 types of Model, one for **Custom Post Types** and another for **Taxonomies**. Depending what you define, you’ll have different parameters available.
[84] Fix | Delete
[85] Fix | Delete
### Model type = ‘cpt’
[86] Fix | Delete
[87] Fix | Delete
| Parameter | Description |
[88] Fix | Delete
| --- | --- |
[89] Fix | Delete
| active | `boolean` - sets this model to active or inactive |
[90] Fix | Delete
type | `string` - type of model |
[91] Fix | Delete
name | `string` - identifier of the custom post type |
[92] Fix | Delete
features | `array` - Features that this CPT will support (More Info Soon) |
[93] Fix | Delete
supports | `array` - refer to the supports argument of the [register_post_type](https://developer.wordpress.org/reference/functions/register_post_type/) function from WordPress |
[94] Fix | Delete
labels | `array` - Everything related with labels for this custom post type (More Info Soon) |
[95] Fix | Delete
options | `array` - Refer to the second argument in the [register_post_type](https://developer.wordpress.org/reference/functions/register_post_type/) function from WordPress |
[96] Fix | Delete
block_editor | `boolean` - if the Block Editor should be enabled or not |
[97] Fix | Delete
meta | `array` - Information for the Metaboxes for this CPT (More Info Soon) |
[98] Fix | Delete
settings | `array` - Information for the Settings page of this CPT (More Info Soon) |
[99] Fix | Delete
[100] Fix | Delete
Example File for a CPT Model (Soon)
[101] Fix | Delete
[102] Fix | Delete
[103] Fix | Delete
### Model type = ‘category’ or ‘tag’
[104] Fix | Delete
[105] Fix | Delete
| Parameter | Description |
[106] Fix | Delete
| --- | --- |
[107] Fix | Delete
type | `string` - ‘category’ // or 'tag' to set it to non-hierarchical automatically |
[108] Fix | Delete
name | `string` - identifier of this taxonomy |
[109] Fix | Delete
associations | `string` - to what CPT it should be associated |
[110] Fix | Delete
labels | `array` - Everything related with labels for this custom post type (More Info Soon) |
[111] Fix | Delete
options | `array` - Refer to the third parameter for register_taxonomy function from WordPress |
[112] Fix | Delete
[113] Fix | Delete
Example File for a Taxonomy Model (Soon)
[114] Fix | Delete
[115] Fix | Delete
## Filters/Hooks
[116] Fix | Delete
[117] Fix | Delete
(More Info Soon)
[118] Fix | Delete
[119] Fix | Delete
[120] Fix | Delete
## Credits and Licenses:
[121] Fix | Delete
[122] Fix | Delete
Includes a simplified version of SoberWP/Models. Their license is in lib/sobwewp/models/LICENSE.md. Is used to load php/json/yaml models of CPT.
[123] Fix | Delete
[124] Fix | Delete
Includes the [Codestart Framework](https://codestarframework.com/) which is [licensed under GPL](https://codestarframework.com/license/).
[125] Fix | Delete
[126] Fix | Delete
Includes support for [github-updater](https://github.com/afragen/github-updater) to keep track on updates through the WordPress backend.
[127] Fix | Delete
* Download [github-updater](https://github.com/afragen/github-updater)
[128] Fix | Delete
* Clone [github-updater](https://github.com/afragen/github-updater) to your sites plugins/ folder
[129] Fix | Delete
* Activate via WordPress
[130] Fix | Delete
[131] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function