Skip to content

Instantly share code, notes, and snippets.

@ivandoric
Last active September 10, 2025 12:44
Show Gist options
  • Select an option

  • Save ivandoric/c314e006b17cfee14a3b877021c692a5 to your computer and use it in GitHub Desktop.

Select an option

Save ivandoric/c314e006b17cfee14a3b877021c692a5 to your computer and use it in GitHub Desktop.
jQuery.ajax({
url: '/wp-admin/admin-ajax.php',
type: 'POST',
data: {
action: 'update_portfolio_data'
},
success: function(response) {
console.log('Success:', response);
},
error: function(xhr, status, error) {
console.log('Error:', error);
}
});
fetch('/wp-json/')
.then(response => {
const serverDate = response.headers.get('date');
console.log('WP Server Time:', new Date(serverDate));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment