This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ---------------------------------------------------------------------------------------- | |
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/engine/plug/converter.php` | |
* ---------------------------------------------------------------------------------------- | |
*/ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $wpdb; | |
$wpdb->query("DELETE FROM $wpdb->terms WHERE term_id IN (SELECT term_id FROM $wpdb->term_taxonomy WHERE taxonomy LIKE 'pa_%')"); | |
$wpdb->query("DELETE FROM $wpdb->term_taxonomy WHERE taxonomy LIKE 'pa_%'"); | |
$wpdb->query("DELETE FROM $wpdb->term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM $wpdb->term_taxonomy)"); | |
$wpdb->query("DELETE FROM $wpdb->term_relationships WHERE object_id IN (SELECT ID FROM $wpdb->posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM $wpdb->postmeta WHERE post_id IN (SELECT ID FROM $wpdb->posts WHERE post_type IN ('product','product_variation'))"); | |
$wpdb->query("DELETE FROM $wpdb->posts WHERE post_type IN ('product','product_variation')"); | |
$wpdb->query("DELETE pm FROM $wpdb->postmeta pm LEFT JOIN $wpdb->posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Your Product ID | |
$product_id = 57; | |
$ecd_product = new WC_Product( $product_id ); | |
/** | |
* Check if product exists | |
*/ | |
if( $ecd_product->exists() ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$dashicons = array( | |
'' => 'dashicons-menu', | |
'' => 'dashicons-admin-site', | |
'' => 'dashicons-dashboard', | |
'' => 'dashicons-admin-post', | |
'' => 'dashicons-admin-media', | |
'' => 'dashicons-admin-links', | |
'' => 'dashicons-admin-page', | |
'' => 'dashicons-admin-comments', |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
# Database | |
db: | |
image: mysql:5.7 | |
volumes: | |
- db_data:/var/lib/mysql | |
- /Volumes/DATA/Development/rizwan_47/sample-project/misc/database:/mysql-db/ # Change path before semicolon here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download Latest WordPress | |
wget https://wordpress.org/latest.zip | |
# Unzip WP Zip file | |
unzip latest.zip | |
# (optional) change directory to something else | |
mv wordpress new_name | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT INTO | |
`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) | |
VALUES ( | |
NULL, 'rizwan', MD5('PASSWORD_HERE'), 'Riz', '[email protected]', '', NOW(), '', '0', 'Rizwan'); | |
SET @WPUserID = LAST_INSERT_ID(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemctl daemon-reload | |
systemctl enable jupyter.service | |
systemctl start jupyter.service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Following the direction from https://moz.com/blog/geolocation-the-ultimate-tip-to-emulate-local-search | |
function convert_uule( $location_name ) | |
{ | |
// Code for length that resets at 64 | |
$len = strlen($location_name) % 64; | |
// uule mapping array | |
$uule_map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'; |
OlderNewer