Search code examples
wordpresspermalinks

WordPress Plugin development and 404 error


I have created some custom pages for my plugin, also I have a form which is submitted from the front-end. But, when submit button of that form is pressed, it redirects me to 404 page. After updating permalinks to "post-name", it works but all I want is that the form submit should properly work no matter what sort of permalink is set at the settings.

Some help on this will be highly appreciated.

Thanks!


Solution

  • One can use like this: action="<?php echo get_permalink( get_page_by_path( 'page-id' ) ) ?>" in the front-end form. Caution: page must exist.

    Thanks!