Skip to content

Instantly share code, notes, and snippets.

@wpmonks
wpmonks / placeholders.css
Last active June 16, 2020 14:18
Style Your Gravity Forms Placeholder
#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 August 6, 2018 22:25
remove divi cpt style action
/**
* 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 May 31, 2021 13:06
[Frontend Snippets][Editing product data tabs] Add a custom tab
/**
* 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 August 20, 2023 14:58
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.
<?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