Skip to content

Commit 405fb8e

Browse files
Merge pull request #281 from jmslbam/issue/236
Don't check if object is an Clarkson_Object
2 parents 0697141 + b348bbe commit 405fb8e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Objects.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function get_objects( array $posts ): array {
167167
*
168168
* @return Clarkson_Object Clarkson Post object.
169169
*/
170-
public function get_object( \WP_Post $post ): Clarkson_Object {
170+
public function get_object( \WP_Post $post ): object {
171171
$cc = Clarkson_Core::get_instance();
172172

173173
$types = array(
@@ -235,10 +235,11 @@ public function get_object( \WP_Post $post ): Clarkson_Object {
235235
* } );
236236
*/
237237
$object_creation_callback = apply_filters( 'clarkson_core_create_object_callback', false, $class_to_load, $post->ID );
238+
238239
if ( is_callable( $object_creation_callback ) ) {
239-
$clarkson_object = call_user_func_array( $object_creation_callback, array( $post->ID ) );
240-
if ( $clarkson_object instanceof Clarkson_Object ) {
241-
return $clarkson_object;
240+
$object = call_user_func_array( $object_creation_callback, array( $post->ID ) );
241+
if ( is_object( $object ) ) {
242+
return $object;
242243
}
243244
}
244245

0 commit comments

Comments
 (0)