Pings: Allow ping functions to accept WP_Post objects as well as post IDs.
This removes the use of several global $wpdb instances, as well as bringing the ping functions into line with other post-related functions, which will accept a post ID or WP_Post object.