This file contains 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 unwanted fields from Gravity Forms export - updated by Robin Scott of Silicon Dales | |
add_filter( 'gform_export_fields', function ( $form ) { | |
// array of field IDs I never want to see on the export page | |
$fields_to_remove = array( | |
'payment_amount', | |
'payment_date', | |
'payment_status', | |
'transaction_id', | |
'user_agent', | |
'ip', |
This file contains 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
// Robin Scott added this here for use in SiliconDales.com, but the snippet comes from Gravity Forms docs, here: https://docs.gravityforms.com/gform_export_fields/ | |
add_filter( 'gform_export_fields', function ( $form ) { | |
// only limit the fields available for export form form ID 3 | |
if ( $form['id'] == 3 ) { | |
// array of field IDs I never want to see on the export page | |
$fields_to_remove = array( | |
'payment_amount', | |
'payment_date', | |
'payment_status', | |
'transaction_id', |
This file contains 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 functions.php, a custom plugin, or a snippets plugin to remove the description tab in woocommerce | |
// by Robin Scott of Silicon Dales - full info at https://silicondales.com/tutorials/woocommerce-tutorials/remove-description-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'sd_remove_product_tabs', 98 ); | |
function sd_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); | |
return $tabs; | |
} |
This file contains 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
// Automatically complete woocommerce orders on successful payment (skip "processing") - Robin Scott for SiliconDales.com | |
add_action( 'woocommerce_thankyou', 'sd_woocommerce_auto_complete_order' ); | |
function sd_woocommerce_auto_complete_order( $order_id ) { | |
if ( ! $order_id ) { | |
return; | |
} | |
$order = wc_get_order( $order_id ); | |
$order->update_status( 'completed' ); | |
} |
This file contains 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 the tabs from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
unset( $tabs['additional_information'] ); // Remove the additional information tab | |
return $tabs; |
This file contains 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 the description tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['description'] ); // Remove the description tab | |
return $tabs; | |
} |
This file contains 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 the reviews tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['reviews'] ); // Remove the reviews tab | |
return $tabs; | |
} |
This file contains 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 the additional information tab from woocommerce - posted by Robin Scott of Silicon Dales @ https://silicondales.com/tutorials/woocommerce-tutorials/remove-tab-woocommerce/ | |
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 ); | |
function woo_remove_product_tabs( $tabs ) { | |
unset( $tabs['additional_information'] ); // Remove the additional information tab | |
return $tabs; | |
} |
This file contains 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
// How to add a shortcode into a PHP theme file in WordPress. By Robin Scott of Silicon Dales. More here: https://silicondales.com/tutorials/wordpress-tutorials/use-shortcodes-wordpress-theme-files/ | |
<?php echo do_shortcode("[YOURSHORTCODE]"); ?> |
This file contains 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 child theme functions.php to change the way reviews display in WooCommerce to not show full name. | |
// Details here: https://silicondales.com/tutorials/woocommerce/woocommerce-change-review-author-display-name-username/ | |
// By Robin Scott for Silicon Dales | |
add_filter('get_comment_author', 'my_comment_author', 10, 1); | |
function my_comment_author( $author = '' ) { | |
// Get the comment ID from WP_Query | |
$comment = get_comment( $comment_ID ); | |
if (!empty($comment->comment_author) ) { | |
if($comment->user_id > 0){ |