This file contains hidden or 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
<iframe src="http://pluto.tv/embed/little-things?mute=false" width="950" height="534" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> |
This file contains hidden or 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
DELETE FROM wp_6_woocommerce_order_itemmeta; | |
DELETE FROM wp_6_woocommerce_order_items; | |
DELETE FROM wp_6_comments WHERE comment_type = 'order_note'; | |
DELETE FROM wp_6_postmeta WHERE post_id IN ( SELECT ID FROM wp_6_posts WHERE post_type = 'shop_order' ); | |
DELETE FROM wp_6_posts WHERE post_type = 'shop_order'; | |
DELETE FROM wp_7_woocommerce_order_itemmeta; | |
DELETE FROM wp_7_woocommerce_order_items; | |
DELETE FROM wp_7_comments WHERE comment_type = 'order_note'; | |
DELETE FROM wp_7_postmeta WHERE post_id IN ( SELECT ID FROM wp_7_posts WHERE post_type = 'shop_order' ); |
This file contains hidden or 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
DELETE relations.*, taxes.*, terms.* | |
FROM wp_8_term_relationships AS relations | |
INNER JOIN wp_8_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_8_terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM wp_8_posts WHERE post_type='product'); | |
DELETE FROM wp_8_postmeta WHERE post_id IN (SELECT ID FROM wp_8_posts WHERE post_type = 'product'); | |
DELETE FROM wp_8_posts WHERE post_type = 'product'; |
This file contains hidden or 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 | |
// By default wp_ for standard WP-installations | |
$prefix = 'wp_'; | |
// Database infos here | |
$host = 'localhost'; | |
$username = 'user'; | |
$password = 'password'; | |
$db = 'dbname'; |
This file contains hidden or 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
#!/bin/bash | |
# wp-cli is mandatory in order this script to work | |
# call the script manually by running ./backup.sh | |
# or add the script to the crontab to run periodically | |
# it will create a dump of your database and .zip of your wp-content folder | |
cd /var/www/wordpress/ # path to your site | |
# Backup database | |
wp db export --database=staging backups/`date +%Y%m%d`_database.sql --add-drop-table |
This file contains hidden or 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 | |
// add code below in your functions.php file in your active theme | |
add_theme_support( 'post-thumbnails' ); | |
add_image_size( 'new-custom-featured-image', 800, 600, true ); | |
add_filter( 'image_size_names_choose', 'custom_sizes' ); |
This file contains hidden or 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` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) | |
VALUES ('mile', MD5('mile123'), 'Mile B. Milosheski', '[email protected]', '0'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10'); |
This file contains hidden or 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 | |
function hook_redirect_to_london() { | |
if ( !is_user_logged_in() ) { | |
?> | |
<script> | |
jQuery.get("https://freegeoip.net/json", function (response) { | |
console.log(response.country_code, 1); | |
switch(response.country_code) { |
This file contains hidden or 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
$wpdb->query( "DELETE relations.*, taxes.*, terms.* | |
FROM $wpdb->term_relationships AS relations | |
INNER JOIN $wpdb->term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN $wpdb->terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM $wpdb->posts WHERE post_type='baby-names-lists')"); | |
$wpdb->query( "DELETE FROM `$wpdb->termmeta` | |
WHERE |
This file contains hidden or 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 | |
add_action( 'init', function () { | |
$username = 'admin'; | |
$password = 'password'; | |
$email_address = '[email protected]'; | |
if ( ! username_exists( $username ) ) { | |
$user_id = wp_create_user( $username, $password, $email_address ); | |
$user = new WP_User( $user_id ); | |
$user->set_role( 'administrator' ); |