Created
December 4, 2018 13:16
-
-
Save jom/46ef6647c454b11e2abe1df0d9ef3ad6 to your computer and use it in GitHub Desktop.
Prevent Product Dropdown on Sensei Course Page
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
<?php | |
add_action( 'add_meta_boxes', function() { | |
remove_meta_box( 'course-wc-product', 'course', 'side' ); | |
add_meta_box( 'course-wc-product', __( 'WooCommerce Product', 'woothemes-sensei' ), function() { | |
if ( ! function_exists( 'Sensei' ) ) { return; } | |
global $post; | |
$select_course_woocommerce_product = get_post_meta( $post->ID, '_course_woocommerce_product', true ); | |
echo '<input type="hidden" name="' . esc_attr( 'woo_course_noonce' ) . '" id="' . esc_attr( 'woo_course_noonce' ) . '" value="' . esc_attr( wp_create_nonce( plugin_basename( Sensei()->plugin_path ) ) ) . '" />'; | |
echo '<label for="wc-course-product-id">Product ID</label><br />'; | |
echo '<input type="text" id="wc-course-product-id" value="' . esc_attr( absint( $select_course_woocommerce_product ) ) . '" name="course_woocommerce_product" />'; | |
}, 'course', 'side', 'default' ); | |
}, 21 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment