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
function devxwp_show_draft_products_on_frontend( $query ) { | |
// echo '<pre>'; | |
// print_r($query); | |
// echo '</pre>'; | |
if( ! current_user_can( 'administrator' ) ) { return; } | |
if ( ! is_admin() && $query->is_main_query() ) { | |
// Not a query for an admin page. | |
// It's the main query for a front end page of your site. |
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
/** | |
* Make order notes required | |
*/ | |
add_filter( 'woocommerce_checkout_fields' , 'dev_woocommerce_make_order_comments_required' ); | |
function dev_woocommerce_make_order_comments_required( $fields ) { | |
$fields['order']['order_comments']['required'] = true; | |
return $fields; | |
} | |
// add_action( 'woocommerce_after_checkout_validation', 'dev_woocommerce_add_notice_for_empty_order_comments' ); |
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
/** | |
* Code to activate comments for LearnDash elements. | |
*/ | |
add_filter( 'learndash_focus_mode_comments', 'learnwithbisht_learndash_focus_mode_comments', 10, 2 ); | |
function learnwithbisht_learndash_focus_mode_comments( $closed, $post ) { | |
/** | |
* Code to activate comments for course. | |
*/ | |
if( 'sfwd-courses' === $post->post_type ) { | |
$closed = 'open'; |
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
/** | |
* Code to get data posted from ninja popup. | |
*/ | |
add_action( 'ninja_popups_send_form', 'learnwithbisht_ninja_popups_send_form', 10, 1 ); | |
function learnwithbisht_ninja_popups_send_form( $filterAndActionData ) { | |
$post_data = $filterAndActionData['data']['post']; | |
$popup_ID = $post_data['popup_ID']; | |
$email = $post_data['email']; | |
/** write code here to use data as per requirement **/ | |
} |