Last active
March 25, 2020 11:40
-
-
Save lelandf/7e17a706bc3476630af3c0ad649042e2 to your computer and use it in GitHub Desktop.
Publicize LearnDash groups
This file contains hidden or 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 leland_learndash_public_groups( $args, $post_type ) { | |
// Based off of this: https://gregrickaby.com/2016/06/modify-wordpress-custom-post-type/ | |
// If not Groups CPT, bail. | |
if ( 'groups' !== $post_type ) { | |
return $args; | |
} | |
// Add additional Products CPT options. | |
$groups_args = array( | |
'public' => true, | |
'publicly_queryable'=> true, | |
); | |
// Merge args together. | |
return array_merge( $args, $groups_args ); | |
} | |
add_filter( 'register_post_type_args', 'leland_learndash_public_groups', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment