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'; |
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('wp_kses_allowed_html', 'acf_add_allowed_iframe_tag', 10, 2); | |
| function acf_add_allowed_iframe_tag($tags, $context) { | |
| if($context === 'acf') { | |
| $tags['iframe'] = array( | |
| 'src' => true, | |
| 'height' => true, | |
| 'width' => true, | |
| 'frameborder' => true, |
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
| <? | |
| //prevent gravity forms submissions containing URLS | |
| //filter hook 'gform_field_validation_1_12' identifies a Gravity Form with an ID of 1 and a Field ID of 12 | |
| //second argument for the filter can be anything, it's just referencing the name of the function to run | |
| add_filter( 'gform_field_validation_1_12', 'validate_input_1_12', 10, 4 ); | |
| function validate_input_1_12( $result, $value, $form, $field ) { | |
| $nourl_pattern = '(ftp|http|https|www|.com|.net|.org|.io|.biz|.info|.mil|.edu|.gov|.me|.int|FTP|HTTP|HTTPS|WWW|.COM|.NET|.ORG|.IO|.BIZ|.INFO|.MIL|.EDU|.GOV|.ME|.INT)'; | |
| if (preg_match( $nourl_pattern, $value ) ) { |
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 | |
| #update all the things | |
| sudo apt update && | |
| sudo apt upgrade -y && | |
| #install all the dependencies |
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
| <? | |
| //load as ES6 | |
| function load_as_ES6($tag, $handle, $source) { | |
| if('tagname' === $handle) { | |
| $tag = '<script src="' . $source . '" type="module" ></script>'; | |
| } | |
| return $tag; | |
| } | |
| add_filter('script_loader_tag', 'load_as_ES6', 10, 3); |
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
| <? | |
| $args = [ | |
| 'post_type' => 'any', | |
| 'post_status' => 'publish', | |
| 'order' => 'ASC', | |
| 'post__not_in' => [253, 236] | |
| ]; | |
| $loop = new WP_Query( $args ); | |
| if ( $loop->have_posts() ) : |
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
| #This is a fake config for demonstration purposes only. This hostname isn't real. | |
| Host hostname-staging | |
| User user-2flis9vgsdf | |
| Hostname 9v0asdles.hostname.io | |
| IdentityFile ~/.ssh/hostname | |
| IdentitiesOnly yes |
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 | |
| /** | |
| * WordPress Query Comprehensive Reference | |
| * Compiled by luetkemj - luetkemj.com | |
| * | |
| * CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
| * Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
| */ | |
| $args = array( |
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
| //load as ES6 | |
| function load_as_ES6($tag, $handle, $source) { | |
| if('some-script-handle' === $handle) { | |
| $tag = '<script src="' . $source . '" type="module" ></script>'; | |
| } | |
| return $tag; | |
| } | |
| add_filter('script_loader_tag', 'load_as_ES6', 10, 3); |
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
| echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf |