Skip to content

Commit

Permalink
fix(content-distribution): persist site hash (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelpeixe authored Jan 15, 2025
1 parent 74c9119 commit 120b759
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion includes/content-distribution/class-outgoing-post.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ public function get_post() {
* @return string The network post ID.
*/
public function get_network_post_id() {
return md5( $this->post->ID . get_bloginfo( 'url' ) );
$site_hash = get_option( 'newspack_network_content_distribution_hash' );
if ( ! $site_hash ) {
$site_hash = md5( get_bloginfo( 'url' ) );
update_option( 'newspack_network_content_distribution_hash', $site_hash );
}
return md5( $site_hash . $this->post->ID );
}

/**
Expand Down

0 comments on commit 120b759

Please sign in to comment.