Custom post type and single_template
-
If I use the members-plugin for the access control of my custom post type, then this works:
add_filter('members_enable_testtype_content_permissions', '__return_true');But as soon as I load a custom single template for this custom post type:
add_filter('single_template', array($this, 'load_course_template') ); [...] public function load_course_template($template) { global $post; if ( 'testtype' === $post->post_type && locate_template( array( 'single-testtype.php' ) ) === '' ) return plugin_dir_path( __FILE__ ) . '/theme/single-testtype.php'; return $template; }Then the access control is ignored.
Can I somehow include the access control of the members-plugin in this single-template, or is there another solution?Thanks!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Custom post type and single_template’ is closed to new replies.