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
This PR adds very basic support for manipulating the database tables associated with the plugin "[Redirection](https://wordpress.org/plugins/redirection/)". Only the `Items` table is implemented with this PR, and a single method `Item::match()` that tests a URL for matches in Redirection
Reviewed-on: https://codeberg.org/vlw/wp/pulls/17
Co-authored-by: vlw <victor@vlw.se>
Co-committed-by: vlw <victor@vlw.se>
Bumped vlw/scaffold to 1.7.6 and make use of the `Database::instance()` method.
This is an almost-fix for issue #15. It will not close it though. The Database class is still a hot mess.
Reviewed-on: https://codeberg.org/vlw/wp/pulls/16
`site_url` is not needed for every operation, let's make it a method that can be called as needed instead of always setting it as static property on the `Database` class.
Reviewed-on: https://codeberg.org/vlw/wp/pulls/13
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
This PR fixes instancing issues with `Database` due to not being able to locate its parent class from the scaffolding library. This is definitely kind of strange and should probably be investigated further. It might be because we're not autoloading these files from the library itself.
We also remove loading of Database credentials from `.env.ini` as that does not make any sense for a bundled library. Database credentials are now provided to the constructor of the `Database` class.
Reviewed-on: https://codeberg.org/vlw/wp/pulls/1