URL Redirect and Bulk Actions in wp_list_table

Understand hierarchy, You don’t need to redirect as form are posting values on same page. function process_bulk_action() { // Some security check code here // Get the bulk action $action = $this->current_action(); if ($action == ‘bulk_trash’) { // Code for the “delete process” $delete_ids = esc_sql($_POST[‘bulk-delete’]); //loop over the array of record ids foreach($delete_ids as … Read more

$_SESSION variables lost during OAuth callback

With my version of wordpress there is NO session. So when I call $_SESSION[‘callback_state’]=stuff it’ll gladly save it to a temporary stack local variable instead of with the actual session. So before you redirect do: if (!session_id()) {session_start();} //then the normal redirect header(“location: $newUrl”); exit(0);

Creating intro page in wordpress

1) Use meta tag fro redirection <meta http-equiv=”Refresh” content=”6; URL=yoururlhere” /> Where the current page will redirect to the given url after 6 seconds. 2) For showing the intro page only for new visitors that is if somebody already seen that it must not be displayed again. for that check in your page header.php add … Read more

Plugin Redirect After Activation

You add this as your activation hook: register_activation_hook(__FILE__, ‘srpt_plugin_activate’); but the function is my_plugin_activate not srpt_plugin_activate. This is based on the fact that there is no function srpt_plugin_activate, and looking at the code my_plugin_activate fills its place in the flow. Is this a typo in the question or in the live code? Plus, re your … Read more

301 Redirect Custom URL hierarchy to WordPress Posts

One option is to Add URL Rewrite Rules. Create an API Endpoint in WordPress is a good tutorial as well as The Rewrite API: The Basics. Monkeyman Rewrite Analyzer is a great way to test what you created. Just be sure to flush your permalinks after each change. This is also a good example which … Read more

WordPress redirect loop on nginx + apache reverse proxy

Issue was caused by nginx serving example.com/index.php while WordPress was redirecting to example.com/, thus causing a redirect loop. This is the working config I used to fixed the redirect loop: server { server_name example.com; root /var/www/example.com; index index.php; listen 443 ssl; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; location / { try_files $uri @apache; … Read more

Redirection errors

If you can get in over FTP then edit wp-config.php define(‘WP_HOME’,’http://bjj.iamrobbiegreen.com’); define(‘WP_SITEURL’,’http://bjj.iamrobbiegreen.com’); Or you can change it directly in the database. Prefer the first method. You may have server level configuration issues though. Its hard to tell. Resetting back to the original URL should at least get you back into the site. Then you can … Read more

Temporary redirect prevents getting $_POST array

A brief background on the behavior of 3xx status codes A 302 redirect is treated differently across browsers. Partially because of the variance of 302 in HTTP/1.0 and HTTP/1.1. HTTP 1.1 302 Found specifies that the request must not automatically be reprocessed at the returned location URI unless it can be confirmed by the user. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)