Try using the $post parameter:
add_action( 'pending_to_publish', 'sa_ads_count' );
function sa_ads_count( $post )
{
// use the $post variable here, not the missing global.
}
Try using the $post parameter:
add_action( 'pending_to_publish', 'sa_ads_count' );
function sa_ads_count( $post )
{
// use the $post variable here, not the missing global.
}