uwebpro/wp-extends

A simple library to extend WP_Post

Installs: 77

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/uwebpro/wp-extends

v3.1 2020-07-27 09:07 UTC

This package is auto-updated.

Last update: 2025-09-27 21:36:33 UTC


README

Allowing you to use WordPress your way

WP_Post

<?php
use UWebPro\WordPress\Post as WP_Post;

class CareHomes extends WP_Post{
    public function location(): ?string
    {
        $category = \wp_get_post_terms($this->ID, 'locations');
        return !$category ? null : $category[0]->name;
    }
}