Skip to content

Commit 384a5fc

Browse files
author
Andrei Igna
committed
Updated - readme with more info
1 parent 67ead10 commit 384a5fc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

readme.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ WordPress Helpers
1515
#### Installation
1616

1717
Add `layered/wp-helpers` as a require dependency in your `composer.json` file:
18-
``` bash
18+
```bash
1919
$ composer require layered/wp-helpers
2020
```
2121

2222
#### Register post type
2323

2424
Example of adding a Post Type, create a `CustomPostType` instance with name as first argument:
25-
```
25+
```php
2626
CustomPostType::add('idea', [
2727
'labels' => [
2828
'name' => __('Ideas', 'my-theme-or-plugin')
@@ -40,7 +40,7 @@ CustomPostType::add('idea', [
4040
#### Meta Fields
4141

4242
Meta Fields are custom fields that can be easily added to Posts, Terms, Comments and Users. They are registered with default WordPress flow, showing up as columns in list views, editable fields on edit pages, editable fields for Quick/Bulk edit screens and REST Api:
43-
```
43+
```php
4444
MetaFields::instance()->addPostMeta('second-heading', [
4545
'name' => 'Second Heading',
4646
'type' => 'text',
@@ -55,12 +55,12 @@ MetaFields::instance()->addPostMeta('second-heading', [
5555

5656
#### Q
5757

58-
Q adds support for asynchronous actions for WordPress plugins and themes. It has a simple API, only include the file and switch from `do_action()` to `queue_action()`. Processing is handled in background, making requests load qicker. Example:
59-
```
60-
// keeps the request hanging until actions is complete
58+
Q adds support for asynchronous actions in plugins and themes. Simple use, only include the file and switch from `do_action()` to `queue_action()`. Processing is handled in background, making web requests load qicker. Example:
59+
```php
60+
// keeps request hanging until action is complete
6161
do_action('resource_hungry_action', 'data', 4, 'action');
6262

63-
// only starts the action and the rest of code is handled quicker
63+
// queues the action to be handled in background
6464
queue_action('resource_hungry_action', 'data', 4, 'action');
6565
```
6666

0 commit comments

Comments
 (0)