From 87f11b329ca23d2d8001d72158983ebdc12b9966 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Tue, 25 Oct 2016 17:00:34 +0100 Subject: [PATCH] Merge branch 'master' of https://github.com/koselig/library --- src/Models/Post.php | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/src/Models/Post.php b/src/Models/Post.php index 4c72208..7a2bbf1 100644 --- a/src/Models/Post.php +++ b/src/Models/Post.php @@ -44,20 +44,6 @@ class Post extends Model } /** - * The "booting" method of the model. - * - * @return void - */ - protected static function boot() - { - parent::boot(); - - static::addGlobalScope('published', function (Builder $builder) { - $builder->where('post_status', 'publish'); - }); - } - - /** * Get a post by its slug. * * @param $slug @@ -213,17 +199,19 @@ class Post extends Model })->get(); } - /** - * Retrieves the navigation to next/previous post, when applicable. - * - * @see get_the_post_navigation() - * @param array $args - * @return string - */ + /** + * Retrieves the navigation to next/previous post, when applicable. + * + * @see get_the_post_navigation() + * + * @param array $args + * + * @return string + */ public static function navigation($args = []) { return get_the_post_navigation($args); - } + } /** * Get the permalink for this post. @@ -318,4 +306,18 @@ class Post extends Model { return new WP_Post((object) $this->toArray()); } + + /** + * The "booting" method of the model. + * + * @return void + */ + protected static function boot() + { + parent::boot(); + + static::addGlobalScope('published', function (Builder $builder) { + $builder->where('post_status', 'publish'); + }); + } } -- libgit2 1.7.2