I want Wordpress to display data from DB so that it can be viewed by a particular user with its own plug-in.

Asked 2 years ago, Updated 2 years ago, 112 views

I created my own plug-in that allows Wordpress to display data from DB, but I want to be able to pre-check (so-called preview function) with a specific user before publishing it.
I searched by short code, preview, authentication, etc., but I didn't get any tips for the solution.
If you need help, please help us solve this problem.

wordpress

2022-09-30 18:38

1 Answers

If you want to preview the draft article, add the extraction criteria so that articles with post_status of 'draft' are also covered (publish:publish draft).

'post_status'=>array('draft','public')

However, if you are loading your own data, you may want to refer to the poststatus in the table:wp_posts.
Also, the preview display is displayed in the get parameter "?preview=true"


2022-09-30 18:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.