Permalink
Browse files

One change for two reasons. $entry_views doesn't need to be an object…

…. Changed this global variable to $_entry_views_post_id since it's the only thing we're assigning and it's used privately.
  • Loading branch information...
1 parent d56c1bd commit cfdc320995a9efe95f8a8fd940b6c7cc3758891a @justintadlock committed Jul 26, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 extensions/entry-views.php
View
@@ -26,7 +26,7 @@
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* @package EntryViews
- * @version 0.2.1
+ * @version 0.2.2
* @author Justin Tadlock <justin@justintadlock.com>
* @copyright Copyright (c) 2010 - 2012, Justin Tadlock
* @link http://justintadlock.com
@@ -75,7 +75,7 @@ function entry_views_post_type_support() {
* @return void
*/
function entry_views_load() {
- global $entry_views;
+ global $_entry_views_post_id;
/* Check if we're on a singular post view. */
if ( is_singular() ) {
@@ -87,7 +87,7 @@ function entry_views_load() {
if ( post_type_supports( $post->post_type, 'entry-views' ) ) {
/* Set the post ID for later use because we wouldn't want a custom query to change this. */
- $entry_views->post_id = get_queried_object_id();
+ $_entry_views_post_id = get_queried_object_id();
/* Enqueue the jQuery library. */
wp_enqueue_script( 'jquery' );
@@ -182,13 +182,13 @@ function entry_views_update_ajax() {
* @return void
*/
function entry_views_load_scripts() {
- global $entry_views;
+ global $_entry_views_post_id;
/* Create a nonce for the AJAX request. */
$nonce = wp_create_nonce( 'entry_views_ajax' );
/* Display the JavaScript needed. */
- echo '<script type="text/javascript">/* <![CDATA[ */ jQuery(document).ready( function() { jQuery.post( "' . admin_url( 'admin-ajax.php' ) . '", { action : "entry_views", _ajax_nonce : "' . $nonce . '", post_id : ' . $entry_views->post_id . ' } ); } ); /* ]]> */</script>' . "\n";
+ echo '<script type="text/javascript">/* <![CDATA[ */ jQuery(document).ready( function() { jQuery.post( "' . admin_url( 'admin-ajax.php' ) . '", { action : "entry_views", _ajax_nonce : "' . $nonce . '", post_id : ' . $_entry_views_post_id . ' } ); } ); /* ]]> */</script>' . "\n";
}
?>

0 comments on commit cfdc320

Please sign in to comment.