https://github.com/uppercod/wp-uppercod-data
https://github.com/uppercod/wp-uppercod-data
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/uppercod/wp-uppercod-data
- Owner: UpperCod
- Created: 2022-02-18T17:20:55.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-25T18:23:02.000Z (about 4 years ago)
- Last Synced: 2025-02-15T18:36:40.335Z (over 1 year ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# UpperCodShortCodeData
This plugin allows access through shortcode to information of the shared concurrent object
for wordpress, by default $post.
## Installation
click on the `Code` button and then click on `Download ZIP` and install as a plugin in wordpress.
## Syntax
```
[$ [...filters] ]
```
1. ``: Property to access of the current object.
2. `[...filters]`: Optional filters to apply to the data selected by ``.
## Example
get page title
```txt
[$ title]
```
get page date
```txt
[$ date]
```
get page date and apply filter
```txt
[$ date date="Y"]
```
## Default filters
```php
[
"date" => function ($option, $value) {
return wp_date($option, is_numeric($value) ? $value : strtotime($value));
},
"json" => function ($option, $value) {
return JSON_ENCODE($value);
},
"md5" => function ($option, $value) {
return md5($value);
},
"striptags" => function ($option, $value) {
return striptags($value);
},
"htmlencode" => function ($option, $value) {
return htmlentities($value);
},
"urlencode" => function ($option, $value) {
return urlencode($value);
},
"base64encode" => function ($option, $value) {
return base64_encode($value);
},
"slug" => function ($option, $value) {
return sanitize_title($value);
},
"numberformat" => function ($option, $value) {
return number_format_i18n($value);
},
"filter" => function ($option, $value) {
return apply_filter($option, $value);
},
];
```
You can add more filters by accessing the global variable `$UpperCodShortcodeData`.