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 | |
| # Basic Usage | |
| # requires that the user be logged in as an administrator and that a 'gwunrequire' parameter be added to the query string | |
| # http://youurl.com/your-form-page/?gwunrequire=1 | |
| new GWUnrequire(); | |
| # Enable for All Users (Including Visitors) | |
| # still requires the 'gwunrequire' parameter be added to the query string | |
| new GWUnrequire( 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
| <?php | |
| add_action( 'init', 'prefix_disable_post_page_analysis' ); | |
| /** | |
| * Conditionally disable the Yoast Page Analysis on post and page admin edit screens. | |
| * | |
| * @uses prefix_is_edit_screen | |
| * @return NULL if we're not on the right admin screen | |
| * @author Robert Neu <http://wpbacon.com> | |
| * @link http://auditwp.com/wordpress-seo-admin-columns/ |
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
| # You must set up two environment variables: | |
| # repoSlug = slug for WP Engine repository | |
| # themeDir = path from the top of the repository, to the theme directory | |
| git remote add production [email protected]:production/${repoSlug}.git | |
| git remote add staging [email protected]:staging/${repoSlug}.git | |
| cd ${themeDir} | |
| npm install | |
| npm install -g bower | |
| bower install |
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
| #!/usr/local/bin/zsh | |
| osascript \ | |
| -e 'tell application "Notes" to activate' \ | |
| -e 'delay 1' | |
| for f in $@*.html | |
| do | |
| filename=$(basename "$f") | |
| extension="${filename##*.}" |
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 | |
| /* | |
| USAGE | |
| add_action( 'gform_post_submission', 'mr_remove_form_entries' ); // ALL FORMS | |
| add_action( 'gform_post_submission_1', 'mr_remove_form_entries' ); // SPECIFIC FORM (ID = 1 in exmaple) | |
| */ | |
| add_action( 'gform_post_submission_1', 'mr_remove_form_entries' ); | |
| // Deletes entries from the database on the specified Gravity Forms form(s) | |
| function mr_remove_form_entries( $entry ){ |
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 // <~ don't add me in | |
| add_filter('mime_types', 'themeprefix_add_svg_images'); | |
| //Allow SVG Images Via Media Uploader | |
| function themeprefix_add_svg_images($mimetypes) { | |
| $mimetypes['svg'] = 'image/svg+xml'; | |
| return $mimetypes; | |
| } |
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 this to your Genesis Theme Settings Page | |
| in the Header and Footer Scripts Section | |
| <script type="text/javascript"> //Be sure to add this before and after too */ | |
| jQuery(document).ready(function($){ | |
| $('a[href$="newtab"]').attr('target','_blank'); | |
| }); | |
| //</script> |
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_action('admin_init', function () { | |
| // Redirect any user trying to access comments page | |
| global $pagenow; | |
| if ($pagenow === 'edit-comments.php') { | |
| wp_redirect(admin_url()); | |
| exit; | |
| } |
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
| // Place this in wp-config | |
| define( 'ACF_5_KEY', 'yourkeyhere' ); | |
| // Set ACF 5 license key on theme activation. Stick in your functions.php or equivalent. | |
| function auto_set_license_keys() { | |
| if ( ! get_option( 'acf_pro_license' ) && defined( 'ACF_5_KEY' ) ) { | |
| $save = array( | |
| 'key' => ACF_5_KEY, |
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 . -name \.AppleDouble -exec rm -rf {} \; |