oc1ober Posted March 10, 2021 Share Posted March 10, 2021 (edited) I'm Shortcode wordpress but it doesn't work, the purpose is to show the content to designated members... For example: in a post or page, Only allow members id1, id7, id25...Visit, And other members cannot view the content, Please edit it for me... Thank you. add_shortcode( 'userid', 'check_user_id' ); function check_user_id($atts, $content = null) { if(current_user_id) {return '<p>' . $content . '</p>';} else {return "";} } [userid_logged_in id = "id1","id7","id25","id27"] Content displayed [/userid_logged_in] Edited March 10, 2021 by oc1ober Link to comment Share on other sites More sharing options...
dsonesuk Posted March 11, 2021 Share Posted March 11, 2021 You should really take this to a Wordpress forum or specific Wordpress plugin forum, this forum is web development in general. That said I would have thought it would be to a integer number 25, otherthan a alphanumeric such as 'id25'. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now