首页    >    新闻资讯    >   wordpress 设置框架

wordpress 设置框架

      wordpress设置框架的目的是让wordpress插件通过有效的创建一个包装器API可以轻松的开发出一个设置界面,使其能够简单的对页面进行设置和维护。创建设置页面变得简单容易:

$wpsf_settings[] = array(
    'section_id' => 'general',
    'section_title' => 'General Settings',
    'section_description' => 'Some intro description about this section.',
    'section_order' => 5,
    'fields' => array(
        array(
            'id' => 'text',
            'title' => 'Text',
            'desc' => 'This is a description.',
            'type' => 'text',
            'std' => 'This is std'
        ),
        array(
            'id' => 'select',
            'title' => 'Select',
            'desc' => 'This is a description.',
            'type' => 'select',
            'std' => 'green',
            'choices' => array(
                'red' => 'Red',
                'green' => 'Green',
                'blue' => 'Blue'
            )
        ),

        // add as many fields as you need…

    )
);
然后wordpress 设置框架(WPSF)为您生成设置表单:它类似于:


wordpress 设置框架

 

来源:http://gilbert.pellegrom.me/wordpress-settings-framework/

分类:新闻资讯

标签:, ,

* 版权声明:作者WordPress啦! 转载请注明出处。