Skip to content

Commit

Permalink
Revert "Merge pull request #138 from globeandmail/chore/update-sectio…
Browse files Browse the repository at this point in the history
…n-names-to-use-wp-categories-sit-2503"

This reverts commit cc9113c, reversing
changes made to b54d5f7.
  • Loading branch information
Rahmon committed Oct 19, 2021
1 parent 4f2f157 commit a1526f8
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions includes/functions/content-sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,19 @@ function setup() {
return __NAMESPACE__ . "\\$function";
};

add_action( 'wp_after_insert_post', $n( 'track_event' ), 10, 4 );
add_action( 'transition_post_status', $n( 'track_event' ), 10, 3 );
}

/**
* Sending data to SnowPlow.
*
* @param int $post_id Post ID.
* @param WP_Post $post Post object.
* @param bool $update Whether this is an existing post being updated.
* @param null|WP_Post $post_before Null for new posts, the WP_Post object prior
* to the update for updated posts.
* @param string $new_status New post status.
* @param string $old_status Old post status.
* @param WP_Post $post Post object.
*
* @return null|WP_Error
*/
function track_event( $post_id, $post, $update, $post_before ) {

$new_status = $post->post_status;
$old_status = $post_before ? $post_before->post_status : '';
function track_event( $new_status, $old_status, $post ) {

// Don't send any event when creating new article.
if ( 'auto-draft' === $new_status || 'inherit' === $new_status ) {
Expand Down

0 comments on commit a1526f8

Please sign in to comment.