HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux srvntsweb01 6.8.0-55-generic #57-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 12 23:42:21 UTC 2025 x86_64
User: admntserv (1000)
PHP: 8.3.6
Disabled: NONE
Upload Files
File: /var/www/ethnikamauricia.com/wp-content/themes/soledad/js/post-like.js
jQuery( document ).ready( function () {
	jQuery( 'body' ).on( 'click', '.penci-post-like', function ( event ) {
		event.preventDefault();
		var $this = jQuery( this ),
			post_id = $this.data( "post_id" ),
			like_text = $this.data( "like" ),
			unlike_text = $this.data( "unlike" ),
			$selector = $this.children('.dt-share' );
			if( $this.hasClass( 'single-like-button' ) ) {
				$selector = $this.parent().find('.count-number-like');
			}
		var	$like = parseInt( $selector.text() );
		if ( $this.hasClass( 'liked' ) ) {
			$this.removeClass( 'liked' );
			$this.prop( 'title', 'Like' );
			$selector.html( ( $like - 1 ) );
		}
		else {
			$this.addClass( 'liked' );
			$this.prop( 'title', 'Unlike' );
			$selector.html( ( $like + 1 ) );
		}

		jQuery.ajax( {
			type: "post",
			url : ajax_var.url,
			data: "action=penci-post-like&nonce=" + ajax_var.nonce + "&penci_post_like=&post_id=" + post_id
		} );
	} );
} );