Attach a private function at a hook?
No that’s impossible. When WordPress calls a method it has to be public. You could write a public method that is called on the hook which calls a private method inside. Not sure if that makes sense though …
No that’s impossible. When WordPress calls a method it has to be public. You could write a public method that is called on the hook which calls a private method inside. Not sure if that makes sense though …
When a POST is set to private, non-logged in users will receive a 404 message. If you dump the global variable $wp_query, var_dump($wp_query); ..you will notice that no post_status is present in the parameters returned therefore using the slug (or name parameter of query_vars array for example) we can get the post status of the … Read more
We had the same issue in one of our projects and we find the solution here This other doesn’t work in our case, but maybe is a second option for you.
from your code you need to change one for redirect user to specific page after login. Your code : $location = wp_login_url($_SERVER[“REQUEST_URI”]); Change it as $location = wp_login_url (i.e. http://www.testsite.com/start); // pass url of page where you want to redirect user after login Hope this will help you.
You can easily create private forums with the Simple:Press forum plugin. http://simple-press.com/ It can do a LOT more than just that, and for that reason might be overkill (not sure what other requirements you have), but if you are looking for a very flexible and powerful forum system, then I can recommend Simple:Press.
Yes, you can set up a separate, private blog that requires members to log in. You can do this with a plug-in called Members Only – it’s freely available from the WordPress plug-in repository. Anyone who visits the site who’s not logged in will be directed automatically to the login screen. After users log in, … Read more
It’s not possible to call a private method through an action or filter. When calling add_action or add_filter, WordPress adds the callback to a list of callbacks for that specific action or filter. Then, when do_action or apply_filters is called, WordPress uses call_user_func_array to call the linked functions and methods. As call_user_func_array is not called … Read more
I had a similar problem and here is the best solution I could come up with. The reason (I think) that private or non-published items show up in menus is that the menu items are themselves posts and have their own post_status. That means that in a situation where a page is marked private, the … Read more
Fetching private posts or custom post types via WP-API with basic authentication
As it doesn’t look as though the OP is coming back, I’m adding their answer as an answer rather than leaving it in the question: For everyone dealing with the same problem: I was able to fix it with a code snippet of another thread: https://wordpress.stackexchange.com/a/172556/87321 Just had to add the post status “pending”, so … Read more