Persisting custom field data

You already know that default fields and taxonomies are automatically saved to the database on post publish. In order to complete the topic creation process, we need to save the custom field data to the meta tables. As usual, we have to update the constructor of the WPWAF_Model_Topic class to add the necessary actions to match the following code:

    public function __construct() {       // Instance variable initializations       // Other actions       add_action('save_post', array($this, 'save_topic_meta_data'));     } 

WordPress doesn't offer an out-of-the-box solution for form validation, as most websites don't have complex forms. This becomes a considerable limitation in web applications. So, let's explore the possible workarounds ...

Get Wordpress Web Application Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.