March 2020
Beginner
660 pages
18h 28m
English
Follow these steps to create a shortcode for restricting content inside posts and pages:
add_shortcode('wpccp_chapter7_restrict_access','wpccp_chapter7_restrict_access');function wpccp_chapter7_restrict_access($atts,$content){ $atts = shortcode_atts( array( 'type' => 'all', 'role' => '', ), $atts ); // Step 3 code should be placed after this line return $content;}
if(isset($atts['type'])){ ...Read now
Unlock full access