快速编辑

Ashuwp Framework框架在6.0以上版本后,自定义字段支持添加到快速编辑中。
效果图1:

效果图2:

添加方法:

在自定义字段的配置数组中,添加quick_edit参数并设置为true即可。

简单范例:

  1. /*****Meta Box********/
  2. $meta_conf = array(
  3.   'title' => 'Meta box example',
  4.   'id'=>'example_box',
  5.   'page'=>array('page','post'),
  6.   'context'=>'normal',
  7.   'priority'=>'low'
  8. );
  9. $ashu_meta = array();
  10. $ashu_meta[] = array(
  11.   'name' => 'Input Example',
  12.   'id'   => 'text_example',
  13.   'desc' => 'A text input example, Default content:"Hello ashuwp."',
  14.   'std'  => 'Hello ashuwp.',
  15.   'type' => 'text',
  16.   'quick_edit'=>true //设置quick_edit参数为true,这个文本框Input Example就会出现在文章快速编辑中。
  17. );
  18. //下面的Textarea Example没有设置quick_edit参数,不会出现在快速编辑中。
  19. $ashu_meta[] = array(
  20.   'name' => 'Textarea Example',
  21.   'id'   => 'textarea_example',
  22.   'desc' => 'A textarea example, Default content:"Default content."',
  23.   'std'  => 'Default content.',
  24.   'type' => 'textarea'
  25. );
  26. $new_box = new ashuwp_postmeta_feild($ashu_meta$meta_conf);

注意:

1. 快速编辑目前仅文章自定义字段可用,分类字段暂不支持。

2. 快速编辑仅支持文本框、文本域等,即type的类型为'text', 'numbers_array', 'color', 'radio', 'checkbox', 'textarea', 'select'可用。