michaeluno / admin-page-framework

Facilitates WordPress plugin and theme development.
http://admin-page-framework.michaeluno.jp/
Other
337 stars 71 forks source link

"inline_mixed" can not be used with "AdminPageFramework_Widget". #274

Closed wadadanet closed 6 years ago

wadadanet commented 6 years ago

"inline_mixed" can not be used with "AdminPageFramework_Widget". Field Types in "inline_mixed" are displayed, but can not be saved. Also, the repeatable function does not appear to work.

Versions

Code

class My_Widget extends AdminPageFramework_Widget {
    public function load( $oAdminWidget ) {
        $array = array(
            "1" => 1,
            "2" => 2,
            "3" => 3,
        );
        $this->addSettingField(
            array(
                'field_id' => 'my_id',
                'type' => 'inline_mixed',
                'title' => 'title',
                'repeatable' => true,
                'sortable' => true,
                'content' => array(
                    array(
                        'title'         => 'select',
                        'field_id'      => 'select',
                        'type'          => 'select',
                        'label'         => $array,
                    ),
                ),
            )
        );
    }
    public function content( $sContent, $aArguments, $aFormData ) {
    }
}
new My_Widget(
    'my widget',
    array(
        'description'   => 'description',
    )
);

Step

URL: /wp-admin/widgets.php

1. Select 2

image

2. Save

3. It returns to the state where "1" is selected

image

michaeluno commented 6 years ago

I could confirm the problem. Thanks for the report.