Class Fieldmanager_Context_QuickEdit
Use fieldmanager to add fields to the "quick edit" (post list inline editing) and save data primarily to post meta.
- Fieldmanager_Context
- Fieldmanager_Context_Storable
- Fieldmanager_Context_QuickEdit
Methods summary
public
|
#
__construct( string $title, string|string[] $post_types, callable $column_display_callback, callable $column_title = '',
Add a context to a fieldmanager |
public
|
#
add_custom_columns( array $columns )
manage_{$post_type}_posts_columns callback, as QuickEdit boxes only work on custom columns. |
public
|
#
manage_custom_columns( string $column_name, integer $post_id )
manage_posts_custom_column callback |
public
|
#
add_quickedit_box( string $column_name, string $post_type, mixed $values = array() )
quick_edit_custom_box callback. Renders the QuickEdit box. Renders with blank values here since QuickEdit boxes cannot access to the WP post_id. The values will be populated by an ajax-fetched form later (see $this->render_ajax_form() ). |
public
string
|
#
render_ajax_form( )
Callback for wp_ajax_fm_quickedit_render. Renders a form with pre-filled values to replace the one generated by $this->add_quickedit_box(). |
public
|
#
save_fields_for_quickedit( integer $post_id )
Takes $_POST data and saves it to, calling save_to_post_meta() once validation is passed When using Fieldmanager as an API, do not call this function directly, call save_to_post_meta() |
public
|
#
save_to_post_meta( integer $post_id, array $data = null )
Helper to save an array of data to post meta |
Magic methods summary
Properties summary
public
string
|
$title |
#
Title of QuickEdit box; also used for the column title unless $column_title is specified. |
public
string
|
$column_title |
#
Override $title for the column in the list of posts |
public
callable
|
$column_display_callback |
#
QuickEdit fields are tied to custom columns in the list of posts. This callback should return a value to display in a custom column. |
public
string[]
|
$post_types |
#
What post types to render this Quickedit form |
public
|
$fm |
#
Base field |