Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/wpup/functions/archive/refs/heads/master.zipOn Packagist as wpup/functions:
composer require wpup/functionsNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
REST API Functions
Bring functions into WordPress REST API.
Example
Create hello.php in wp-content/themes/NAME/functions/hello.php
<?php
function handler($request) {
return 'Hello, world';
}
Call it
GET /wp-json/functions/v1/hello
"Hello, world"
Supported HTTP methods for each function file are:
GET, POST, PUT, PATCH, DELETE
Namespaces and classes are supported as well.
<?php
namespace MyNamespace;
class MyClass {
public function handler($request) {
return 'Hello, world';
}
}
Install
composer require wpup/functions
Filters
Short documenation about filters, read the source code to find out more about each filter.
functions_file- Modify file pathfunctions_handle- Modify function/method string name (that are used forcall_user_func)functions_directories- Modify which directories the plugin should scan for functions files. Default iswp-content/themes/NAME/functions
License
MIT © Fredrik Forsmo
Releases
1 release.
Tag
Published
v1.0.0
latest
Oct 31, 2018 7 years ago
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.