mirror of
https://codeberg.org/vlw/wp.git
synced 2026-02-26 03:51:58 +01:00
Collection of various tools for parsing and performing DML operations on a WordPress database
With this PR we can (among actually creating taxonomies and terms) assign and remove terms from a post with the following ```php $post = new Post(123); $term = new Term(321); ``` Add a term to a post: ```php $post->add_term($term); ``` Remove a term from a post: ```php $post->remove_term($term); ``` Reviewed-on: https://codeberg.org/vlw/wp/pulls/6 |
||
|---|---|---|
| src | ||
| .gitignore | ||
| composer.json | ||
| composer.lock | ||
| LICENSE | ||
| README.md | ||
This library is a collection of various tools for parsing and performing DML operations on a WordPress database and its content. It is meant to be used as a stand-alone library and does not require WordPress to be installed.
Installation
composer require vlw/wp
How to use
A variety of tools are available, refer to the documentation for each tool to see its usage instructions.
For example:
use vlw\WP\Posts\Post;
// Retrieve a new Post instance for post ID 1234
$post = new Post(1234);
// Retrieve the content for this post
$post->post_content;
// Update the datetime modified for this post
$post->post_modified = new DateTimeImmutable();