Stuff made easily on Wordpress
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
js
src
.gitignore
LICENSE
README.md
composer.json
morepress.php

README.md

Morepress

Stuff made easily on Wordpress.

Installation

composer require daidais/morepress

Features

Post

Create from id:

$mp_post = new \Morepress\Post(23);

Create from \WP_Post:

global $post;
$mp_post = new \Morepress\Post($post);

Check if exists:

if($mp_post->exists())
{
    // Do stuff
}

Get attribute:

$mp_post->ID;
$mp_post->post_name;
// etc.

Update post:

$mp_post->update(array(
    'post_status' => 'publish',
));

Add meta:

$mp_post->addMeta('meta_key', 'meta_value', true);

Update meta:

$mp_post->updateMeta('meta_key', 'meta_value', 'prev_meta_value')

Get meta:

$mp_post->getMeta('meta_key', true);

Delete meta:

$mp_post->deleteMeta('meta_key', 'meta_value');

Get time:

$mp_post->getTime();