Hi @nicolamustone,
I have the same problem, looks like $post and $new_post are wiggy.
Here is my small test:
add_filter( 'wp_discord_post_is_new_post', 'wp_discord_post_block_regular_posts' );
function wp_discord_post_block_regular_posts( $new_post ) {
global $post;
if ( wp_discord_post_is_logging_enabled() ) {
error_log( sprintf( 'myOwnFilter: post_type: %s', $post->post_type ) );
error_log( sprintf( '-- post: %s', json_encode( $post )));
error_log( sprintf( '-- new_post: %s', json_encode( $new_post )));
}
return $new_post;
}
Log:
Array\n(\n [id] =] 1174\n [status] =] publish\n [date] =] 2018-10-20 23\n [current_time] =] 2018-10-20 23\n)\n
WP Discord Post - Post 1174 maybe is new. _wp_discord_post_published =
myOwnFilter: post_type:
-- post: null
-- new_post: true
I’m using WordPress 4.9.8 with PHP 7.2, Wellington Theme and plugin-version 2.1.0
-
This reply was modified 7 years, 7 months ago by jensherrmann.