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
/** | |
* Add new allowed media types | |
*/ | |
function mjt_add_mime_types( $wp_get_mime_types ) { | |
$wp_get_mime_types['webp'] = 'image/webp'; | |
$wp_get_mime_types['svg'] = 'image/svg+xml'; | |
$wp_get_mime_types['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; | |
$wp_get_mime_types['pdf'] = 'application/pdf'; | |
return $wp_get_mime_types; |
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
<!-- Include in Divi > Theme Options > Integrations > Add code to the <head> of your blog --> | |
<link rel="preload" href="wp-content/themes/Divi/core/admin/fonts/modules/all/modules.ttf" as="font" type="font/ttf" crossorigin= "anonymous"> |
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
#show siteurl | |
wp db query "SELECT * FROM wp_options WHERE option_name = 'siteurl';" | |
#show home | |
wp db query "SELECT * FROM wp_options WHERE option_name = 'home';" | |
#update siteurl | |
wp db query "UPDATE wp_options SET option_value = 'https://newsiteurl.com' WHERE option_name = 'siteurl';" | |
#update home |
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 | |
## exit script on error | |
set -e | |
# Variables | |
WP_PATH="/var/www/mattjones.tech" | |
RCLONE_DRIVE_NAME="b2" | |
BACKUP_PATH="/home/matt/tmp" | |
DATE=$(date +"%Y-%m-%d") |
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 | |
# Register custom post types on the 'init' hook. | |
add_action( 'init', 'my_register_post_types' ); | |
/** | |
* Registers post types needed by the plugin. | |
* | |
* @since 1.0.0 | |
* @access public |
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
//disable additional css | |
function remove_additional_css( $wp_customize ) { | |
$wp_customize->remove_section('custom_css'); | |
} | |
add_action('customize_register', 'remove_additional_css'); | |
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
# Magically copy your public key to a remote server and add it to authorized_keys with this handy one-liner. | |
# -i flag accepts the path to the file that will be uploaded. | |
# final argument is the username@host-destination root directory. | |
ssh-copy-id -i ~/.ssh/some-key.pub [email protected] | |
# To confirm the copy was successful (supposing you can recognize your public key when you see it) | |
ssh [email protected] && cat /.ssh/authorized_keys |
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
add_action('wp', 'test'); | |
function test() { | |
//get file modified time of style.css | |
$time = filemtime('./style.css'); | |
$msg = "style.css was modified at: " . $time; | |
$log_file = fopen(ABSPATH . '/theme_file_edit_logs.txt', 'a'); | |
fwrite($log_file, $msg); | |
fclose($log_file); | |
} |
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 | |
# Install SSH and Git | |
sudo apt-get update | |
sudo apt-get install -y openssh-server git | |
# Prompt user for email | |
read -p "Enter your email for SSH key generation: " email | |
# Generate SSH keys with different names and ed25519 algorithm |
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
-- display the current admin email | |
select * from wp_options where option_name = 'admin_email'; | |
--update admin email | |
update wp_options set option_value = '[email protected]' where option_name = 'admin_email'; |
NewerOlder