Skip to content

Instantly share code, notes, and snippets.

<?php
/**
* Plugin Name: WordPress Importer Post ID Preservation
* Description: When importing posts make sure that post ID from the original site is used on the destination site. This should only be used when first setting up an environment, or if the destination site is not canonical (e.g. a dev or staging environment).
* Author: Weston Ruter, XWP
*/
/**
* Force WordPress Importer to never honor the post_exists() check, since we want to override existing posts.
*
@clintN
clintN / WooCommerce JQuery datepicker
Last active November 18, 2019 15:27
Adds a datepicker widget to WooCommerce checkout
// Register main datepicker jQuery plugin script
add_action( 'wp_enqueue_scripts', 'enabling_date_picker' );
function enabling_date_picker() {
// Only on front-end and checkout page
if( is_admin() || ! is_checkout() ) return;
// Load the datepicker jQuery-ui plugin script
wp_enqueue_script( 'jquery-ui-datepicker' );
}