[resolved] Admin UI pages (2 posts)

  1. Workshopshed
    Posted 4 years ago #

    When making an admin UI for a plugin you effectively need to code a HTML form and populate it with PHP data. This means that you end up with code similar to the following.

    <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p>

    I was wondering if anyone knew any techniques that would avoid this swapping back and forth between HTML and PHP and also separate the layout from the code?

    Feel free to point me at any existing plugins that have that kind of feature.

  2. Workshopshed
    Posted 4 years ago #

    The WordPress Amazon Associate by MDBitz - Matthew John Denton has an extention to the WP_Widget class that adds some functionality to make writing forms simpler and less error prone.

    I've also created my own functions as follows:


Topic Closed

This topic has been closed to new replies.

About this Topic