Releases: SebKay/oop-wp
Releases · SebKay/oop-wp
v3.0.0
v2.1.0
This release includes:
Changes to OOPWP\PostTypes\Post
- New
::setOption
method to set the post thumbnail size and CSS classes. - New
::withThumbnail
method to get the post thumbnail. This is so the thumbnail can be conditionally loaded to stop it loading whenever you create a new post class. - New
::thumbnail
method for displaying the thumbnail HTML.
Example of setting, getting and displaying the thumbnail:
use OOPWP\PostTypes\Post;
$post_obj = new Post(get_the_ID());
$post_obj
->setOption('thumbnail_size', 'post-thumbnail')
->setOption('thumbnail_classes', 'test-1 test-2')
->withThumbnail();
echo $post_obj->thumbnail();