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
# MariaDB is throwing an error when attempting to use variables. You will have to hardcode the database tables | |
SET @username = 'YOUR_USER_NAME'; | |
SET @password = 'YOUR_PASSWORD'; | |
SET @nicename = 'YOUR_NICENAME'; | |
SET @email_address = 'YOUR_EMAIL_ADDRESS'; | |
SET @fullname = 'YOUR_FULL_NAME'; | |
SET @wpdb_prefix = 'wp_'; | |
SET @wpdb_users_table = CONCAT(@wpdb_prefix,'', 'users'); | |
SET @wpdb_usermeta_table = CONCAT(@wpdb_prefix,'', 'usermeta'); |
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
// http://www.regexr.com/397dr | |
/\((.*?)\)/s |
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
sudo ./Applications/XAMPP/xamppfiles/xampp enablessl |
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
{ | |
"folders": | |
[ | |
{ | |
"follow_symlinks": true, | |
"path": "." | |
} | |
], | |
"settings": | |
{ |
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 | |
ini_set('memory_limit','1500M'); | |
/** | |
* Update/Covert all WooCommerce Products data to a new post type | |
* | |
* Moving all WooCommerce custom data to a new custom post type. Should only be executed from CLI since it uses so many processes. | |
* | |
* @author De'Yonte W. <[email protected]> | |
* @return void | |
*/ |
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
tar -cvzf filename.tar.gz folder | |
tar -cvjf filename.tar.bz2 folder # even more compression |
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_filter( 'template_include', 'my_callback' ); | |
function my_callback( $original_template ) { | |
if ( some_condition() ) { | |
return SOME_PATH . '/some-custom-file.php'; | |
} else { | |
return $original_template; | |
} |
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
#initialize PHP interactive shell | |
php -a | |
require 'wp-load.php';ini_set('memory_limit',-1);require 'wp-admin/includes/admin.php';require 'wp-admin/includes/upgrade.php';wp_upgrade(); |
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 | |
/** | |
Get first value from multidimensional serialized array | |
*/ | |
function get_value_from_multidimensional_array( $possible_array ){ | |
if( is_array($possible_array) ){ | |
$maybe_serialized = @unserialize($possible_array[0]); | |
if( $maybe_serialized !== false ){ | |
$possible_array[0] = $maybe_serialized; |