Collection of various tools for parsing and performing DML operations on a WordPress database
Find a file
Victor Westerlund 729663a113 feat: add Post::clone() method for shallow copying a Post (#18)
This PR adds a new static method `Post::clone()` which takes a `Post` instance as an argument and creates a new shallow copy of that Post. The copied Post is then returned from this method.

Reviewed-on: https://codeberg.org/vlw/wp/pulls/18
2026-02-24 11:52:12 +01:00
src feat: add Post::clone() method for shallow copying a Post (#18) 2026-02-24 11:52:12 +01:00
.gitignore fix: import Database from scaffolding lib and remove instances from .env.ini (#1) 2026-02-12 15:27:00 +01:00
composer.json initial commit 2026-02-12 13:19:50 +01:00
composer.lock refactor: use Database instance from scaffold library (#16) 2026-02-24 11:51:14 +01:00
LICENSE initial commit 2026-02-12 13:19:50 +01:00
README.md feat: add basic support for the plugin "Redirection" (#17) 2026-02-24 11:51:37 +01:00

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();

Plugins

This library also has support for the following plugins:

Plugin Versions Reference
Redirection 5.3.10 (limited support) Plugins/redirection