The Comment Redirection Url is shown below. That’s the url inserted into the Comment Redirection Message HTML Template displayed at the bottom of each post instructing users where the post’s comments are located.
Adding the Field HTML
We add the Fieldset HTML using the quick_edit_custom_box filter function.
Populating our Custom Field on Page Load
There seems to be a lot going on here, but only because I designed it to allow developers to bypass the entire WordPress framework stack and pull a value directly out of MySQL if they wanted to. Really, only 3 things are happening here. We
- Setup a MySQL Connection (either through wp-config.php or a custom config.php which bypasses the WordPress stack)
- Run a query and retrieve the post comment_redirection_url meta property from the database
- Echo it back to the Ajax post request
And that’s how we add a new Quick Edit Form field and populate existing field values. Like I said, all of the source code is available on the WordPress Plugin Download page if you need to dig into it more for your own plugin.
Until next time, Happy WordPress Plugin Coding!