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
## binary shortcuts | |
alias node='nodejs' | |
alias wp='~/wp-cli.phar' | |
## environment specific frecents | |
alias clients='cd ~/public_html/clients/' | |
alias staging='cd ~/public_html/staging/' | |
## directory traversal | |
alias ..='cd ../' |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(wp-content/uploads/\d{4}/\d\d/.*\.jpg)$ https://<your-production-url>.com/$1 [QSA,L] | |
RewriteRule ^(wp-content/uploads/\d{4}/\d\d/.*\.png)$ https://<your-production-url>.com/$1 [QSA,L] | |
</IfModule> |
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
# replace <domainname> with your domain name | |
# replace <directoryname> with the name of the directory where WordPress is located | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP_HOST} ^(www.)?<domainname>.com$ | |
RewriteCond %{REQUEST_URI} !^/<directoryname>/ | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ /<directoryname>/$1 |
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 | |
/** | |
* create a custom query, using specific arguments, making sure to reset | |
* the query afterward. | |
*/ | |
function create_secondary_query() { | |
// for list of possible arguments, @see https://developer.wordpress.org/reference/classes/wp_query/#parameters | |
$args = array( |
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
/** | |
* credit to: https://wordpress.stackexchange.com/q/291735 | |
* | |
*/ | |
/** | |
* remove the slug from published gallery permalinks. | |
* | |
* Makes sure to only touch our CPT | |
* |
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
<h2>Contact Info</h2> | |
<div style="margin-bottom: 10px;"><br> | |
<p> | |
Name: <b>{field:name}</b><br> | |
Email: <b><a href="mailto:{field:email}">{field:email}</a></b><br> | |
Phone: <b><a href="tel:{field:phone}">{field:phone}</a></b><br> | |
</p> | |
</div> | |
<hr> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test mail services</title> | |
</head> | |
<body> | |
<h1>Test out the mail functionality on a server</h1> | |
<?php | |
$timestamp = "today"; | |
// $timestamp = new DateTime('Y-m-d H:i:s'); |
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
.vscode/ | |
.well-known/ | |
info/ | |
*/*/error_log | |
*.log | |
*.mmdb | |
*/*/node_modules | |
*.sh | |
*.sql |
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
i=1 | |
touch urls.txt | |
COUNT=$(wc -l sites.txt) | |
for SITE in $(cat sites.txt) | |
do | |
cd $SITE | |
echo "Working on $SITE ($i of $COUNT)..." | |
echo "## $SITE" >> ../urls.txt | |
url=$(wp option get siteurl) | |
postURL="/wp-login.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
i=1 | |
touch users.txt | |
COUNT=$(wc -l sites.txt) | |
for SITE in $(cat sites.txt) | |
do | |
cd $SITE | |
echo "Working on $SITE ($i of $COUNT)..." | |
echo "## $SITE" >> ../users.txt | |
wp user list --role=administrator --fields=user_login,user_email >> ../users.txt | |
echo "----------------" >> ../users.txt |
OlderNewer