Linux 软件免费装
Banner图

Admin Page Framework

开发者 Michael Uno
miunosoft
pcraig3
更新时间 2022年4月15日 11:48
捐献地址: 去捐款
PHP版本: 3.4 及以上
WordPress版本: 5.9.3
版权: GPLv2 or later
版权网址: 版权信息

标签

forms widgets themes custom post type fields options settings plugins API framework library admin pages developers meta box

下载

1.0.2.1 1.0.2.2 1.0.2.3 1.0.3 1.0.3.1 1.0.3.2 1.0.4 1.0.4.3 1.0.4.4 2.0.0 2.0.1 2.1.5 2.1.6 2.1.7 2.1.7.1 2.1.7.2 3.0.0 3.0.0.1 3.0.1 3.0.1.1 3.0.1.2 3.0.1.4 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.1.0 3.1.1 3.1.2 3.1.3 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.6 3.5.0 3.5.1.1 3.5.10 3.5.11 3.5.2 3.5.3 3.5.4 3.5.6 3.5.7 3.5.7.1 3.5.8 3.5.9 3.6.0 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.7.0 3.7.1 3.7.10 3.7.11 3.7.12 3.7.14 3.7.15 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.6.1 3.7.7 3.7.8 3.8.0 3.8.1 3.8.10 3.8.11 3.8.12 3.8.13 3.8.14 3.8.8 3.8.9 1.0.2 3.8.2 1.0.0.1 1.0.3.3 1.0.4.1 1.0.4.2 2.1.4 3.0.1.3 3.1.4 3.4.1 3.5.12 3.6.1 3.7.13 3.7.9 3.8.17 3.8.18 3.8.19 3.8.20 3.8.21 3.8.23 3.8.24 3.8.25 3.8.26 3.8.27 3.8.28 3.8.3 3.8.4 1.0.1.1 3.8.29 3.8.5 1.0.1.2 2.0.2 2.1.2 2.1.3 3.5.5 3.8.15 3.8.31 3.8.32 1.0.0.0 3.4.0 3.8.16 3.8.30 3.8.33 3.8.34 3.8.6 1.0.0.2 3.8.7 3.9.0 3.9.1

详情介绍:

Reduce the Time Spent for Plugin and Theme Development One of the time-consuming part of developing WordPress plugins and themes is creating setting pages. As you more and more write plugins and themes, you will soon realize major part of code can be reused. Admin Page Framework aims to provide reusable code that eliminates the necessity of writing repeated code over and over again. You will have more organized means of building option pages with the framework. Extend the library class and pass your arrays defining the form elements to the predefined class methods. The library handles all the complex coding behind the scene and creates the pages and the forms for you. Create Essential Page and Form Components for Your Users Construct Simple Yet Complex Setting Forms Produce a Series of Products with the Framework Extensibility If you are planning to create a product possibly extended with an unlimited number of add-ons, take advantage of the framework's native extensibility. The created admin pages and forms will become highly extensible with the automatically created hooks. In other words, it empowers other developers to customize your plugin or theme. That will result on making your projects grow. Also, use the framework as a library and your plugin or theme does not have to require an extra dependency to be installed. Therefore, your product will be perfectly portable. Built-in Field Types Bundled Custom Field Types With custom field types, you can create more detailed customized field outputs. The demo component includes the following example custom field types. If you want a field type that are not listed here, you can check the field type pack or request a new one in the forum. 开始 To get started, go to Dashboard -> Admin Page Framework -> About -> Getting Started. Demo Activate the demo pages to see the possible features of the framework. To activate it, go to Dashboard -> Admin Page Framework -> Add Ons -> Demo. 程序文档 Notes: this framework does not do anything by itself. If you are not a developer, you do not need this.

安装:

  1. Upload admin-page-framework.zip via Dashboard -> Plugins -> Add New -> Upload Plugin.
  2. Activate it.
For usage instructions to get started, go to Dashboard -> Admin Page Framework -> About -> Getting Started and create your first plugin.

屏幕截图:

  • **Text Fields**
  • **Selector and Checkboxes**
  • **Image, Media, and File Upload**
  • **Form Input Verification**
  • **Import and Export**
  • **Taxonomy and Post Type Checklists**
  • **Color Pickers and Buttons**
  • **Custom Post Type and Meta Box**
  • **Contextual Help Pane**
  • **Taxonomy Field**
  • **Meta Boxes in Pages Added by Framework**
  • **Repeatable Sections, Section Tabs and Section Title Field**
  • **Widget Form**
  • **User Meta Fields**

其他记录:

Use Unique Page Slug The framework internally uses the add_submenu_page() function to register sub menu pages. When the same page slug is registered for multiple root pages, only the last registered callback gets triggered. The other ones will be ignored. This means if you choose a very simple page slug such as about for your plugin/theme's information page and then if there is another plugin using the same page slug, your users will get either of your page or the other. To avoid this, make sure to use a unique page slug. One way to do that is to add a prefix like apf_about. Use the files generated with the component generator There is one thing you need to be careful when you include the framework: the framework version conflicts. Imagine you publish a plugin using the framework v3.4.6 and your plugin user installs a plugin using the framework v3.0.0 which is below your framework version. If the other plugin loads earlier than yours, your plugin may not work properly and vice versa. There is a way to avoid such a conflict: change the PHP class names of the framework you include. All the class names have the prefix AdminPageFramework so just change it to something like MyPlugin_AdminPageFramework. Go to Dashboard -> Admin Page Framework -> Tools -> Generator. Set the prefix in the option field and download the files. If you do not modify the framework class names, you are supposed to extend the AdminPageFramework factory class. class MyAdminPage extends AdminPageFramework { ... } When you modify the framework class names, make sure you extend the class with the modified name. class MyAdminPage extends MyPlugin_AdminPageFramework { ... } For more detailed instruction, go to Dashboard -> Admin Page Framework -> About -> Getting Started. By the time WordPress's minimum required PHP version becomes 5.3 or higher, we can use name spaces then this problem will be solved. Change Framework's System Messages The default messages defined by the framework can be changed. For example, when you import a setting with the framework, the setting notice "The options have been updated." will be displayed. If you want to change it to something else, modify the oMsg object. It has the aMessages public property array holding all the messages that the framework uses. Get comfortable with the 'attributes' array argument In each field definition array, you can set the attributes arguments which defines the HTML attributes of the field so that you can modify the output of the field by passing attribute values. The argument accepts the values as an array. Each element represents the attribute's name and value. The array key corresponds to the name of the attribute and the value to the attribute value. For example, array( 'field_id' => 'interval', 'title' => __( 'Interval', 'task-scheduler' ), 'type' => 'number', 'attributes' => array( 'min' => 0, 'step' => 1, 'max' => 24, ), ), In addition, you can change the attributes of the following container elements by setting their key and passing a nested attribute array. This submit button will float right. array( 'field_id' => 'submit', 'type' => 'submit', 'save' => false, 'value' => __( 'Save', 'task-scheduler' ), 'label_min_width' => 0, 'attributes' => array( 'field' => array( 'style' => 'float:right; clear:none; display: inline;', ), ), ) For meta box and widget form fields (as they have slightly different styling than generic admin pages), array( 'field_id' => 'submit_in_meta_box', 'type' => 'submit', 'save' => false, 'show_title_column' => false, 'label_min_width' => 0, 'attributes' => array( 'field' => array( 'style' => 'float:right; width:auto;', ), ), ), Change Preview Image Size of the 'image' Field Type To specify a custom size to the preview element of the image field type, set an attribute array like the below, where 300px is the max width. array( 'field_id' => 'my_image_field_id', 'title' => __( 'Image', 'admin-page-framework-demo' ), 'type' => 'image', 'attributes' => array( 'preview' => array( 'style' => 'max-width: 200px;', ), ), ), Display items of 'radio' field type one per line To display radio button items one per line, set the label_min_width to 100%. array( 'field_id' => 'my_radio_field_id', 'title' => __( 'Radio Button', 'admin-page-framework-demo' ), 'type' => 'radio', 'label_min_width' => '100%', 'label' => array( 'a' => __( 'This is a.', 'admin-page-framework-demo' ), 'b' => __( 'This is b.', 'admin-page-framework-demo' ), 'c' => __( 'This is a.', 'admin-page-framework-demo' )c ), ), Set default field value To set the initial value of a field, use the default argument in the field definition array. array( 'field_id' => 'my_text_field_id', 'title' => __( 'My Text Input Field', 'admin-page-framework-demo' ), 'type' => 'text', 'default' => 'This text will be displayed for the first time that the field is displayed and will be overridden when a user set an own value.', ), Always display a particular value in a field The value argument in the definition array can suppress the saved value. This is useful when you want to set a value from a different data source or create a wizard form that stores the data in a custom location. array( 'field_id' => 'my_text_field_id', 'title' => __( 'My Text Input Field', 'admin-page-framework-demo' ), 'type' => 'text', 'value' => 'This will be always set.', ), If it is a repeatable field, set values in numerically indexed sub-elements. array( 'field_id' => 'my_text_field_id', 'title' => __( 'My Text Input Field', 'admin-page-framework-demo' ), 'type' => 'text', 'repeatable' => true, 'value' => 'the first value', array( 'value' => 'the second value', ), array( 'value' => 'the third value', ), ), Alternately, you may use the options_{instantiated class name} filter to suppress the options so that setting the value argument is not necessary. See examples, https://gist.github.com/michaeluno/c30713fcfe0d9d45d89f, https://gist.github.com/michaeluno/fcfac27825aa8a35b90f,

更新日志:

3.9.1 - 2022/04/14 3.9.0 - 2022/03/02 Old Change Log See here