Skip to content

Instantly share code, notes, and snippets.

@lelandf
Last active March 25, 2020 11:40
Show Gist options
  • Save lelandf/7e17a706bc3476630af3c0ad649042e2 to your computer and use it in GitHub Desktop.
Save lelandf/7e17a706bc3476630af3c0ad649042e2 to your computer and use it in GitHub Desktop.
Publicize LearnDash groups
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