WP-ajax-like-button icon indicating copy to clipboard operation
WP-ajax-like-button copied to clipboard

Undefined index: at_nonce

Open abouasy opened this issue 6 years ago • 0 comments

error : like-metabox.php line 62

fixed by replace function "save_like_metabox" with below function

function save_like_metabox_NEW($post_id) {
	
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return;
	
    if (array_key_exists('_likes_count', $_POST) && wp_verify_nonce($_POST['wp_nonce'], __FILE__)) {
        update_post_meta($post_id,'_likes_count',$_POST['_likes_count']);
    }    
	if (array_key_exists('_likers', $_POST) && wp_verify_nonce($_POST['wp_nonce'], __FILE__)) {
        update_post_meta($post_id,'_likers',$_POST['_likers']);
    }
}
add_action('save_post', 'save_like_metabox_NEW');

abouasy avatar Apr 25 '18 09:04 abouasy