Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a base WP_Backstage_Field class, and move out all field code to classes that extend this class #94

Open
theenoahmason opened this issue Oct 24, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@theenoahmason
Copy link
Member

theenoahmason commented Oct 24, 2022

This should have all of the methods needed to construct a new field in a more normalized way, and will allow us to get methods out of WP_Backstage and WP_Backstage_Component classes into a more appropriate place. This will also pave the way for extensions and extra fields to be added in a normalized way.

See: https://github.com/dreamsicle-io/wp-backstage/wiki/Development#developing-fields

The interface should have a signature similar to this:

class WP_Backstage_field {

    public $type = 'text';
    public $default_args = array();
    public $is_non_regular_text = false;
    public $is_remove_label_for = false;
    public $is_textarea_control = false;

    public function __construct() {}

    public function init() {}

    public function render() {}

    public function sanitize() {}

    public function format_value() {}

    public function format_column_value() {}

    public function inline_style() {}

    public function inline_script() {}

}
@theenoahmason theenoahmason added the enhancement New feature or request label Oct 24, 2022
@theenoahmason theenoahmason self-assigned this Oct 24, 2022
@theenoahmason theenoahmason changed the title Create a base WP_Backstage_Field class, and move out all field code to classes that extend this class. Create a base WP_Backstage_Field class, and move out all field code to classes that extend this class Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant