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
| 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 | |
| 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. <admin@rxnlabs.com> | |
| * @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
| { | |
| "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
| 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
| // 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
| # 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
| <?php | |
| ini_set('memory_limit','3200M'); | |
| // This script is to solve the problem of doing database search and replace | |
| // when developers have only gone and used the non-relational concept of | |
| // serializing PHP arrays into single database columns. It will search for all | |
| // matching data on the database and change it, even if it's within a serialized | |
| // PHP array. | |
| // The big problem with serialised arrays is that if you do a normal DB | |
| // style search and replace the lengths get mucked up. This search deals with |
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 get_headers_curl($response){ | |
| $headers = array(); | |
| $header_text = substr($response, 0, strpos($response, "\r\n\r\n")); | |
| foreach (explode("\r\n", $header_text) as $i => $line){ | |
| if ($i === 0) | |
| $headers['http_code'] = $line; |