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 | |
# siteslug="SITE_SLUG" | |
read -p "Enter site slug: " siteslug | |
# sitename="SITE_NAME" | |
read -p "Enter site name: " sitename | |
read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 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
terminus wp mydomain.live -- search-replace 'dev-mydomain.pantheonsite.io' 'mydomain.com' --all-tables --dry-run |
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
// List of old urls and corresponding new target urls. | |
$redirects = array( | |
'/url_01' => '/new-url-01', | |
'/url_02' => '/new-url-02', | |
); | |
// Redirect multiple old to new urls. | |
// Note: make sure environment is set correctly | |
if ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) && | |
( $_ENV['PANTHEON_ENVIRONMENT'] === 'dev' ) && |
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
/** | |
* Jump to error in EE checkout | |
*/ | |
function ee_test_click_event_handler(){ | |
wp_add_inline_script( | |
'ee_form_section_validation', | |
'jQuery( "#spco-go-to-step-finalize_registration-submit" ).click(function( event ) { | |
alert( "Handler for .click() called." ); | |
});' | |
); |
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 a custom ticket selector | |
*/ | |
add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector__template_path', 'tip_custom_ticket_selector_template_location'); | |
function tip_custom_ticket_selector_template_location(){ | |
return get_stylesheet_directory() . '/tip_ticket_selector.template.php'; | |
} |
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
INSERT INTO `wp_users` (`user_login`, `user_pass`, `user_nicename`, `user_email`, `user_status`) | |
VALUES ('myusername', MD5('mypass321'), 'FirstName LastName', '[email protected]', '0'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) | |
VALUES (NULL, (Select max(id) FROM wp_users), 'wp_user_level', '10'); |
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
# BEGIN HTTPS Redirect | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^old.com$ [OR] | |
RewriteCond %{HTTP_HOST} ^www.old.com$ | |
RewriteRule (.*)$ https://www.new.org/$1 [R=301,L] | |
</IfModule> | |
# END HTTPS Redirect |
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
/** | |
* Delete ALL WooCommerce tax rates | |
* | |
* Add to your theme functions.php then go to woocommerce -> system status -> tools and there will be a delete all tax rates button http://cld.wthms.co/tXvp | |
*/ | |
add_filter( 'woocommerce_debug_tools', 'custom_woocommerce_debug_tools' ); | |
function custom_woocommerce_debug_tools( $tools ) { | |
$tools['woocommerce_delete_tax_rates'] = 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
/** | |
* Add class to specific WordPress navigation menu link | |
* Reference: https://codex.wordpress.org/Plugin_API/Filter_Reference/nav_menu_link_attributes | |
*/ | |
add_filter('nav_menu_link_attributes', 'ivycat_account_secondary_menu_link_attributes', 10, 4); | |
function ivycat_account_secondary_menu_link_attributes($atts, $item, $args, $depth){ | |
if ($args->menu->slug == 'utility' && $item->ID == 26){ | |
$class = "account_button"; |
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
** | |
* Remove labels from Gravity Forms form fields on focus and input | |
* Can easily be adapted to forms of any origin | |
*/ | |
jQuery(function ($) { | |
jQuery.fn.labelOver = function(overClass) { | |
return this.each(function(){ | |
var label = jQuery(this); |
NewerOlder