Created
August 19, 2021 16:21
-
-
Save lelandf/9c9cdf9510f3894b4134b2433eda565b to your computer and use it in GitHub Desktop.
Add custom field support to LearnDash post types
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
// https://developer.wordpress.org/reference/functions/add_post_type_support/ | |
add_action( 'init', 'lelandf_custom_fields_support_learndash' ); | |
function lelandf_custom_fields_support_learndash() { | |
$post_types = [ | |
'sfwd-courses', | |
'sfwd-lessons', | |
'sfwd-topic', | |
]; | |
foreach ( $post_types as $post_type ) { | |
add_post_type_support( $post_type, 'custom-fields' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment