WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] Ajax post (2 posts)

  1. Arkadiusz Rzadkowolski
    Member
    Posted 1 year ago #

    Hello,
    I have got a simple question :)

    Why is it necessary for WPP to have request method as POST? It prevents me from effectively caching my webpages hence I had to disable it (500k+).

    Is it okay to switch to GET, or would it break some functionality?

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    There's no specific reason for that, it's just the way I like it. You can change it, though, by modifying this line:

    jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', {action: 'wpp_update', token: '<?php echo $nonce; ?>', id: <?php echo $id; ?>}, function(data){/*alert(data);*/});

    ... into:

    jQuery.get('<?php echo admin_url('admin-ajax.php'); ?>', {action: 'wpp_update', token: '<?php echo $nonce; ?>', id: <?php echo $id; ?>}, function(data){/*alert(data);*/});

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags