From d17c069611261f8071f6b2e0bdbf9aad7d7692e3 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sun, 16 Oct 2016 10:43:07 +0100 Subject: [PATCH] don't do any checks until we know ACF is installed --- src/Models/Meta.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Models/Meta.php b/src/Models/Meta.php index 0927c17..8c84c9f 100644 --- a/src/Models/Meta.php +++ b/src/Models/Meta.php @@ -80,6 +80,10 @@ class Meta extends Model */ public static function acf($page = null, $name = null, $format = true) { + if (!function_exists('acf_format_value')) { + throw new UnsatisfiedDependencyException('Advanced Custom Fields must be installed to use field'); + } + if (is_object($page) && (is_subclass_of($page, Post::class) || $page instanceof Post)) { $page = $page->ID; } @@ -93,10 +97,6 @@ class Meta extends Model $page = Wordpress::id(); } - if (!function_exists('acf_format_value')) { - throw new UnsatisfiedDependencyException('Advanced Custom Fields must be installed to use field'); - } - $value = static::get($page, $name); if (is_serialized($value)) { -- libgit2 1.7.2