manychois / wp-wpx
A utility library for overriding WordPress default HTML output easily
v0.0.3
2018-09-12 02:21 UTC
Requires
- php: >=7.0
- ivopetkov/html5-dom-document-php: >=0.6.1
- manychois/views: >=0.1.0
Requires (Dev)
- php: >=7.0
- johnpbloch/wordpress-core: 4.9.5
- phpunit/phpunit: 6.*
This package is auto-updated.
Last update: 2025-03-20 12:48:59 UTC
README
Wpx provides you a set of utility functions to help you developing WordPress themes or plugins.
Installation
composer require manychois/wp-wpx
Then in your plugin file or theme functions.php, write this to start using Wpx:
require_once(__DIR__ . '/vendor/autoload.php'); $wpx = new \Manychois\Wpx\Utility(new \Manychois\Wpx\WpContext()); $wpx->activate();
Features
- Check UtilityInterface for available methods. Some highlights:
minimizeHead()
Remove certain WordPress default stuff in<head>
tag, e.g. generator tag, emoji script.registerStyle()
/registerScript()
Outputting tag like<link rel="stylesheet" href="..." integrity="..." crossorigin="anonymous" />
has become possible.getMenuItem()
No more manipulating output fromwp_nav_menu()
. Wpx provides you hierarchy of menu data for extreme flexibility.getPostPaginationLinks()
Again, no more manipulation on output frompaginate_links()
.
- Bundle
\Manychois\Views\View
to help you build HTML template in parent-child structure. Reference: https://github.com/manychois/php-views - Provide
\Manychois\Wpx\TagBuilder
to simplify HTML tag construction. - Register useful stylesheets and JavaScripts for admin pages:
- wpx-jquery-ui: CSS of Jquery UI theme Smoothness.
- wpx-codemirror: Latest CodeMirror core script.
To-do list
- Increase unit test code coverage.
- Add helper styles and functions to simplify plugin admin screen development.
License
This project is licensed under MIT License.
Author
This library is created by Siu Pang Tommy Choi.