Nest PPWP Inside Other Shortcode
-
I’m using PPWP lite partial protection using shortcodes. Using the WordPress built-in editor, the construct
> [ppwp passwords=”pass1 pass2″]
> super secret stuff
> [/ppwp]works perfectly. The page renders with the password field, and when “pass1” is entered in the field the super secret stuff is shown. Awesome! However, I’m trying to wrap your shortcodes in my own shortcodes in order to pass dynamically-generated passwords to PPWP. In functions.php I have written
>function outer($atts, $content=null){
>
> //get passwords from server: secret.pwd currently contains “pass1 pass2 ”
> $new_pwds = file_get_contents(“/path/to/server/secret.pwd”);
>
> $html = <<<EOD
>[ppwp passwords=”$new_pwds”]
>$content
>[/ppwp]
>EOD;
>
> return do_shortcode($html);
>}
>add_shortcode( ‘outer_block’ , ‘outer’ );Now my construct in the WP editor is
> [outer_block]
> super secret content
> [/outer_block]which, I feel, almost works as I want it to. The super secret stuff is hidden, and the password entry is shown. But when I submit “pass1” in the password field, I get the usual error message “Please enter the correct password!”
Is there a hook that I have to include? Am I forgetting something basic? Is this Pro-only functionality? Please let me know ??
- The topic ‘Nest PPWP Inside Other Shortcode’ is closed to new replies.