Create an empty git repo or reinitialize an existing one
$ git init
/* Regular jQuery */ | |
$('.hideable').on('click', function() { | |
$(this).hide(); | |
}) | |
/* Compatibility Mode */ | |
jQuery('.hideable').on('click', function() { | |
jQuery(this).hide(); | |
}) |
<?php | |
//* OPTIONAL STEP - Keep the form disappearing. | |
//* Gravity Forms notification popup instead of the page redirect or AJAX notification. | |
//* Props to @WilliamAlexander in the comments | |
//* @link https://anythinggraphic.net/gravity-forms-notification-popup | |
add_filter( 'gform_confirmation', 'ag_custom_confirmation', 10, 4 ); | |
function ag_custom_confirmation( $confirmation, $form, $entry, $ajax ) { | |
add_filter( 'wp_footer', 'ag_overlay'); |
While in the OpenCart back-end, navigate to Customers>Customers and then open up a console and type: | |
$('input[name*=\'selected\']').prop('checked', true); | |
$('#form-customer').submit(); | |
This will remove all customers from the current page. | |
(It's a quicker version of clicking to select all customers of the page and then the delete button and accept JS prompt box..) |
/* | |
Update _price to be equal to _sales_price when there is a sales price set | |
*/ | |
UPDATE `wp_postmeta` AS p | |
LEFT JOIN `wp_postmeta` AS sp ON p.post_id = sp.post_id | |
SET p.meta_value = sp.meta_value | |
WHERE p.meta_key = '_price' | |
AND sp.meta_key = '_sale_price' | |
AND sp.meta_value != '' |
function mask_theme_files_urls() { | |
$theme_name = next(explode('/themes/', get_stylesheet_directory())); | |
global $wp_rewrite; | |
$new_non_wp_rules = array( | |
'css/(.*)' => 'wp-content/themes/'. $theme_name . '/css/$1', | |
'js/(.*)' => 'wp-content/themes/'. $theme_name . '/js/$1', | |
'images/wordpress-urls-rewrite/(.*)' => 'wp-content/themes/'. $theme_name . '/images/wordpress-urls-rewrite/$1', | |
); | |
$wp_rewrite->non_wp_rules += $new_non_wp_rules; |
SELECT `p`.`ID`, `p`.`post_title`, `p`.`post_name`, `pm`.`meta_value` | |
FROM `wp_posts` AS `p` | |
LEFT JOIN `wp_postmeta` AS `pm` ON `p`.`ID` = `pm`.`post_id` | |
WHERE `post_type` = 'post' | |
AND `pm`.`meta_key` = '_fgj2wp_old_k2_id' | |
LIMIT 0, 100 |
// Register Custom Post Type Portfolio | |
// Post Type Key: portfolio | |
function create_portfolio_cpt() { | |
$labels = array( | |
'name' => __( 'Portfolios', 'Post Type General Name', 'cube-cpt-portfolio' ), | |
'singular_name' => __( 'Portfolio', 'Post Type Singular Name', 'cube-cpt-portfolio' ), | |
'menu_name' => __( 'Portfolios', 'cube-cpt-portfolio' ), | |
'name_admin_bar' => __( 'Portfolio', 'cube-cpt-portfolio' ), | |
'archives' => __( 'Portfolio Archives', 'cube-cpt-portfolio' ), |
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl'); |
Create an empty git repo or reinitialize an existing one
$ git init