-
-
Save onwp/9f22337fd8cd294c71425297ee67baf5 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