Fieldmanager
  • Package
  • Class
  • Tree
  • Todo

Packages

  • Fieldmanager
    • Context
    • Datasource
    • Field
    • Util
  • None

Classes

  • Fieldmanager_Context
  • Fieldmanager_Context_Page
  • Fieldmanager_Context_Post
  • Fieldmanager_Context_QuickEdit
  • Fieldmanager_Context_Storable
  • Fieldmanager_Context_Submenu
  • Fieldmanager_Context_Term
  • Fieldmanager_Context_User

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
Extended by Fieldmanager_Context_Storable
Extended by Fieldmanager_Context_QuickEdit
Package: Fieldmanager\Context
Located at context/class-fieldmanager-context-quickedit.php

Methods summary

public
# __construct( string $title, string|string[] $post_types, callable $column_display_callback, callable $column_title = '', Fieldmanager_Field $fm = Null )

Add a context to a fieldmanager

Add a context to a fieldmanager

Parameters

$title
string
$title
$post_types
string|string[]
$post_types
$column_display_callback
callable
$column_not_empty_callback
$column_title
callable
$column_empty_callback
$fm
Fieldmanager_Field
$fm
public
# add_custom_columns( array $columns )

manage_{$post_type}_posts_columns callback, as QuickEdit boxes only work on custom columns.

manage_{$post_type}_posts_columns callback, as QuickEdit boxes only work on custom columns.

Parameters

$columns
array
$columns
public
# manage_custom_columns( string $column_name, integer $post_id )

manage_posts_custom_column callback

manage_posts_custom_column callback

Parameters

$column_name
string
$column_name
$post_id
integer
$post_id
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() ).

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() ).

Parameters

$column_name
string
$column_name
$post_type
string
$post_type
$values
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().

Callback for wp_ajax_fm_quickedit_render. Renders a form with pre-filled values to replace the one generated by $this->add_quickedit_box().

Returns

string
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()

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()

Parameters

$post_id
integer
$post_id
public
# save_to_post_meta( integer $post_id, array $data = null )

Helper to save an array of data to post meta

Helper to save an array of data to post meta

Parameters

$post_id
integer
$post_id
$data
array
$data

Magic methods summary

Properties summary

public string $title
#

Title of QuickEdit box; also used for the column title unless $column_title is specified.

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

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.

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

What post types to render this Quickedit form

public Fieldmanager_Group $fm
#

Base field

Base field

Properties inherited from Fieldmanager_Context_Storable

$taxonomies_to_save

Properties inherited from Fieldmanager_Context

$save_keys, $uniqid

Fieldmanager API documentation generated by ApiGen 2.8.0