Ajax for non-logged-in users

The wp_ajax_{action} hook only fires for logged in users. For logged-out users the action wp_ajax_nopriv_{action} is triggered on an ajax request – so you need to hook into that as well.

How to use WordPress authentication on non-WordPress page?

Just add this at the top of your file: require_once($_SERVER[‘DOCUMENT_ROOT’].’/wp-blog-header.php’); // If you run multisite, you might nees this to prevent 404 error header(‘HTTP/1.1 200 OK’); Note that the file must be in the same folder as your theme. Then you can use is_user_logged_in before executing the rest of the script. If use is not … Read more

custom XMLRPC method plus authentication of user & WooCommerce order

I sent it to you on Twitter, but here it is again. I made this little class to help me do XML-RPC faster. abstract class MZAXMLRPC { protected $calls = Array(); protected $namespace = “myxmlrpc”; function __construct($namespace){ $this->namespace = $namespace; $reflector = new ReflectionClass($this); foreach ( $reflector->getMethods(ReflectionMethod::IS_PUBLIC) as $method){ if ($method->isUserDefined() && $method->getDeclaringClass()->name != get_class()){ … Read more

How to secure or disable the RSS feeds?

As pointed out in the comments by @kaiser, your question is very similar to this question. In fact, the question itself holds the answer. To disable all feeds add the following code… function itsme_disable_feed() { wp_die( __( ‘No feed available, please visit the <a href=”‘. esc_url( home_url( “https://wordpress.stackexchange.com/” ) ) .'”>homepage</a>!’ ) ); } add_action(‘do_feed’, … Read more