Permalink
Browse files

Renames ajax_get_popular to simply get_popular

  • Loading branch information...
1 parent 5a557e5 commit 46614332574ed5d7f1cb9c2b295ef184723c11d8 @cabrerahector committed Nov 7, 2013
Showing with 7 additions and 7 deletions.
  1. +7 −7 wordpress-popular-posts.php
@@ -295,8 +295,8 @@ public function __construct() {
add_action('wp_ajax_wpp_clear_data', array( $this, 'clear_data' ));
// Add ajax hook for widget
- add_action('wp_ajax_wpp_ajax_get_popular', array( $this, 'ajax_get_popular') );
- add_action('wp_ajax_nopriv_wpp_ajax_get_popular', array( $this, 'ajax_get_popular') );
+ add_action('wp_ajax_wpp_get_popular', array( $this, 'get_popular') );
+ add_action('wp_ajax_nopriv_wpp_get_popular', array( $this, 'get_popular') );
// Check if images can be created
if ( extension_loaded('ImageMagick') || (extension_loaded('GD') && function_exists('gd_info')) )
@@ -402,7 +402,7 @@ public function widget( $args, $instance ) {
<script type="text/javascript">//<![CDATA[
jQuery(document).ready(function(){
jQuery.get('<?php echo admin_url('admin-ajax.php'); ?>', {
- action: 'wpp_ajax_get_popular',
+ action: 'wpp_get_popular',
id: '<?php echo $this->number; ?>'
}, function(data){
jQuery('#<?php echo $widget_id; ?>').append(data);
@@ -2614,15 +2614,15 @@ private function __format_content($string, $data = array(), $rating) {
}
return html_entity_decode( $string, ENT_QUOTES, $this->charset );
- }
-
+ }
/**
- * Builds list via AJAX
+ * Returns HTML list via AJAX
*
* @since 2.3.3
+ * @return string
*/
- function ajax_get_popular( ) {
+ public function get_popular( ) {
if ( is_numeric($_GET['id']) && (intval($_GET['id']) == floatval($_GET['id'])) && ($_GET['id'] != '') ) {
$id = $_GET['id'];

0 comments on commit 4661433

Please sign in to comment.