Skip to content

Commit

Permalink
Merge pull request #50 from newfold-labs/update/ignore-private-post-t…
Browse files Browse the repository at this point in the history
…ypes

Ignore post types that aren't public
  • Loading branch information
wpscholar authored Nov 29, 2023
2 parents 80b3286 + e14e8a4 commit 6dc2730
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions includes/Listeners/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public function register_hooks() {
*/
public function post_status( $new_status, $old_status, $post ) {

$post_type = get_post_type_object( $post->post_type );

/**
* Ignore all logging from the "Rest API Log" plugin
*
* @link https://wordpress.org/plugins/wp-rest-api-log/
* Ignore all post types that aren't public
*/
if ( 'wp-rest-api-log' === $post->post_type ) {
if ( $post_type->public !== true ) {
return;
}

Expand Down

0 comments on commit 6dc2730

Please sign in to comment.