Skip to content

Instantly share code, notes, and snippets.

@wpmonks
wpmonks / placeholders.css
Last active Jun 16, 2020
Style Your Gravity Forms Placeholder
View placeholders.css
#gform_wrapper_1 .gform_fields .gfield input::-webkit-input-placeholder {
/* Chrome/Opera/Safari */
color: pink;
}
#gform_wrapper_1 .gform_fields .gfield input::-moz-placeholder {
/* Firefox 19+ */
color: pink;
}
#gform_wrapper_1 .gform_fields .gfield input:-ms-input-placeholder {
/* IE 10+ */
@mrkdevelopment
mrkdevelopment / functions.php
Created Aug 6, 2018
remove divi cpt style action
View functions.php
/**
* Disable new divi crazy crap code for CPT
**/
function disable_cptdivi()
{
remove_action( 'wp_enqueue_scripts', 'et_divi_replace_stylesheet', 99999998 );
}
add_action('init', 'disable_cptdivi');
@woogists
woogists / wc-add-custom-tab.php
Last active Aug 5, 2020
[Frontend Snippets][Editing product data tabs] Add a custom tab
View wc-add-custom-tab.php
/**
* Add a custom product data tab
*/
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' );
function woo_new_product_tab( $tabs ) {
// Adds the new tab
$tabs['test_tab'] = array(
'title' => __( 'New Product Tab', 'woocommerce' ),
@mannieschumpert
mannieschumpert / gist:8334811
Last active Jul 13, 2020
Filter the submit button in Gravity Forms to change the <input type="submit> element to a <button> element. There's an example in the Gravity Forms documentation, but it lacks the proper code to show your custom button text, AND removes important attributes like the onclick that prevents multiple clicks. I was trying to solve that.
View gist:8334811
<?php
// filter the Gravity Forms button type
add_filter("gform_submit_button", "form_submit_button", 10, 2);
function form_submit_button($button, $form){
// The following line is from the Gravity Forms documentation - it doesn't include your custom button text
// return "<button class='button' id='gform_submit_button_{$form["id"]}'>'Submit'</button>";
// This includes your custom button text:
return "<button class='button' id='gform_submit_button_{$form["id"]}'>{$form['button']['text']}</button>";
}
// Oops this strips important stuff
You can’t perform that action at this time.