From 9f258ccf3e9ff2b5cc2c7cbbf037cef585a651f0 Mon Sep 17 00:00:00 2001 From: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:13:33 +1100 Subject: [PATCH] Use `instanceof` in place of `is_a()`. --- docs/snippets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/snippets.md b/docs/snippets.md index 0a8e6be5a..1c2a438aa 100644 --- a/docs/snippets.md +++ b/docs/snippets.md @@ -98,7 +98,7 @@ add_filter( 'dt_push_post_args', function( $post_body, $post, $args, $connection // When pushing to an external connection, we use the REST API, so the name of the field is `date`. // But when pushing to an internal connection, the attributes are sent to wp_insert_post, which expects `post_date`. - $field_prefix = is_a( $connection, 'Distributor\ExternalConnections\WordPressExternalConnection' ) ? '' : 'post_'; + $field_prefix =( $connection instanceof \Distributor\ExternalConnections\WordPressExternalConnection ) ? '' : 'post_'; $post_body[ $field_prefix . 'date'] = $post->post_date; $post_body[ $field_prefix . 'date_gmt'] = $post->post_date_gmt;