<?php
$date = new DateTime('2000-01-01');
echo $date->format('Y-m-d H:i: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
<?php | |
/** | |
* Remove admin bar | |
**/ | |
add_filter('show_admin_bar', '__return_false'); | |
?> |
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 | |
/** Season - Custom taxonomy added to product **/ | |
add_action( 'init', 'custom_taxonomy_season' ); | |
function custom_taxonomy_season() { | |
$labels = array( | |
'name' => 'Season', | |
'singular_name' => 'Season', | |
'menu_name' => 'Season', | |
'all_items' => 'All Seasons', | |
'parent_item' => 'Parent Item', |
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
https://yoursite.com/wp-login.php?action=enter_recovery_mode |
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 nano /etc/hosts | |
sudo killall -HUP mDNSResponder |
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
SELECT table_schema AS "Database", | |
ROUND(SUM(data_length + index_length) / 1024 / 1024, 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; | |
SELECT table_name AS "Table", | |
ROUND(((data_length + index_length) / 1024 / 1024), 2) AS "Size (MB)" | |
FROM information_schema.TABLES | |
WHERE table_schema = "database_name" | |
ORDER BY (data_length + index_length) DESC; |
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
Shift + e: cycles through different memory units in the total memory info | |
e: ycles through different memory units for process lines | |
t: cycles through different displays for CPU % bar |
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
Source URL: ^(\/(?!wp-admin|wp-login).*)$ | |
Target URL: https://main-website.com/$1 |
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
#find files that have certain string | |
grep -rnl '/home/directory' -e 'string_you_want_to_search' | |
#find lines that have certain string | |
grep 'string_you_want_to_search' '/file/path' | |
#find IP Address for Logs in Cloudways Application | |
find /home/app-directory/logs/php-app.access.log* -type f -exec grep "IP_ADDRESS" {} \; |
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
du -sh * | sort -h |