plugin links not working

I’m developing a plugin with the latest version of WordPress (3.4.2) locally (XAMPP 1.7.7 [PHP: 5.3.8]) and for some reason the links are not working within the plugin. I just have a simple delete link that links to a ‘delete-gallery.php’ file from within the plugin admin page. This file (delete-gallery.php) only calls a function to delete the record from the database and redirects back to the page that called it (the plugin admin page). Simple enough. But, when the link is clicked I get directed to XAMPP root (localhost:8080/xampp) and not the requested destination (delete-gallery.php) for some reason.

$url = plugins_url('includes/delete-gallery.php', _FILE_);
echo '<a href="'.$url.'?gallery_id='.$gallery['gallery_id'].'">Delete</a>';

I know the hrefs’ path is correct on the link because it shows up in the status bar on hover, but for some reason it’s not locating the file locally on submission. If I set the destination to somewhere external (ie. google.com, etc) it works fine, but not locally within wordpress.

Read More

The permalink structure has been updated and the .htaccess file is currently as so:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

If I use a blank .htaccess file I don’t get redirected to the XAMPP root, but instead get the 404 error ‘Object not found! The requested URL was not found on this server. …’ when the link is clicked.

Is there something that needs to be set in .htaccess to allow redirecting locally within wordpress? I’m at a loss here. Any suggestions would be greatly appreciated.

Related posts

Leave a Reply

1 comment