WP Favorite Posts plugin causes an error as is and must be updated to work with the current version of Jquery.
In your plugin file wp-favorite-posts/wpfp.js you must update .live()
function to a .on()
function. Jquery
.live()
is a deprecated function (from JQuery 1.7+) and removed completely from jQuery 1.9+. You can instead use .on() or .bind() methods:
http://api.jquery.com/on/
http://api.jquery.com/bind/
The updated code should be as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
jQuery(document).ready( function($) { $('.wpfp-link').on('click', function() { dhis = $(this); wpfp_do_js( dhis, 1 ); // for favorite post listing page if (dhis.hasClass('remove-parent')) { dhis.parent("li").fadeOut(); } return false; }); }); function wpfp_do_js( dhis, doAjax ) { loadingImg = dhis.prev(); loadingImg.show(); beforeImg = dhis.prev().prev(); beforeImg.hide(); url = document.location.href.split('#')[0]; params = dhis.attr('href').replace('?', '') + '&ajax=1'; if ( doAjax ) { jQuery.get(url, params, function(data) { dhis.parent().html(data); if(typeof wpfp_after_ajax == 'function') { wpfp_after_ajax( dhis ); // use this like a wp action. } loadingImg.hide(); } ); } } |