Skip to content

Instantly share code, notes, and snippets.

@pmtpro
pmtpro / wordpress_export_to_json.php
Created February 14, 2023 00:44 — forked from jsnelders/wordpress_export_to_json.php
Export all core WordPress data (posts, pages, attachments, comments, tags, categories and users) to a JSON formatted file.
<?php
/**
* Plugin Name: WordPress Export to JSON
* Plugin URI: https://jsnelders.com/
* Description: Export all WordPress posts, pages, comments, tags, commments and users to a JSON file.
* Author: Jason Snelders
* Author URI: http://jsnelders.com
* Version: 2020-01-30.1
**/
@pmtpro
pmtpro / example.js
Created February 6, 2021 14:07 — forked from magemore/example.js
upload image from clipboard on ctrl+v event on page
function uploadFile(file) {
var formData = new FormData();
formData.append("userfile", file);
var request = new XMLHttpRequest();
request.onload = function () {
if (request.status == 200) {
document.location.href='/';
} else {
alert('Error! Upload failed');
}