PHP code example of uwebpro / wp-extends

1. Go to this page and download the library: Download uwebpro/wp-extends library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uwebpro / wp-extends example snippets



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;
    }
}