-
-
Save billerickson/7dc6f51596bcb9aedd8fedcf58f72bf4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Only update share counts on single post | |
* | |
* @param array $update_queue | |
* @return array | |
*/ | |
function be_update_share_count_on_single( $update_queue ) { | |
if( is_singular() && !empty( $update_queue ) ) | |
$update_queue = array_key_exists( get_queried_object_id(), $update_queue ) ? array( get_queried_object_id() => $update_queue[get_queried_object_id()] ) : array(); | |
else | |
$update_queue = array(); | |
return $update_queue; | |
} | |
add_filter( 'ea_share_count_update_queue', 'be_update_share_count_on_single' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment