HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux box12.multicloud.host 4.18.0-553.52.1.el8_10.x86_64 #1 SMP Wed May 14 09:36:12 EDT 2025 x86_64
User: kashmira (1008)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: /home/kashmira/.trash/stylo-core/assets/js/ajax.js
function stylo_activate_license() {

		console.log("clicked");
		jQuery("#actiavtionBTN").html('Working...');
		jQuery.ajax({
			url : ajaxurl,
			type : 'post',
			data : {
				action : 'stylothemes_activate',
			},
			success : function( response ) {
				jQuery("#wpacAjaxResponse").fadeIn();
				jQuery("#wpacAjaxResponse span").html(response);
				jQuery("#actiavtionBTN").html('Success');
				setTimeout(function() {
					location.reload();
				}, 1000);
			}
		});
	
}
function stylo_deactivate_license() {
		console.log("clicked");
		jQuery("#deactiavtionBTN").html('Working...');
		jQuery.ajax({
			url : ajaxurl,
			type : 'post',
			data : {
				action : 'stylothemes_deactivate',
			},
			success : function( response ) {
				jQuery("#wpacAjaxResponse").fadeIn();
				jQuery("#wpacAjaxResponse span").html(response);
				jQuery("#deactiavtionBTN").html('Success');
				setTimeout(function() {
					location.reload();
				}, 2000);
			}
		});
}
jQuery(document).ready(function($) {
	jQuery.ajax({
		url : ajaxurl,
		type : 'post',
		data : {
			action : 'license_info_panel',
		},
		success : function( response ) {
			jQuery("#licenseInfoPanel").html(response);
		}
	});
});
jQuery(document).ready(function($) {
    // AJAX function to fetch and display posts
    function fetchPosts() {
        jQuery.ajax({
            url: 'https://stylothemes.com/wp-json/wp/v2/posts?per_page=5', // Add the per_page parameter
			headers: {
				'Content-Type': 'application/x-www-form-urlencoded'
			},
            type: 'GET',
            dataType: 'json',
			crossDomain: true,
            success: function(response) {
                // Handle the response and display the posts
                if (response.length > 0) {
                    // Clear previous posts
                    $('#stylothemes-updates-restapi').empty();

                    // Loop through the posts and display them
                    $.each(response, function(index, post) {
                        var postHTML = '<h4><a href="' + post.link + '" target="_blank">' + post.title.rendered + '</a></h4>';
                        $('#stylothemes-updates-restapi').append(postHTML);
                    });
                } else {
                    $('#stylothemes-updates-restapi').html('No posts found.');
                }
            },
            error: function(xhr, status, error) {
                console.log(error);
            }
        });
    }

    // Call the fetchPosts function on page load
    fetchPosts();
});