Fieldmanager
  • Package
  • Class
  • Tree
  • Todo

Packages

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

Classes

  • Fieldmanager_Autocomplete
  • Fieldmanager_Checkbox
  • Fieldmanager_Checkboxes
  • Fieldmanager_Colorpicker
  • Fieldmanager_Datepicker
  • Fieldmanager_DraggablePost
  • Fieldmanager_Field
  • Fieldmanager_Grid
  • Fieldmanager_Group
  • Fieldmanager_Hidden
  • Fieldmanager_Link
  • Fieldmanager_Media
  • Fieldmanager_Options
  • Fieldmanager_Password
  • Fieldmanager_Radios
  • Fieldmanager_RichTextArea
  • Fieldmanager_Select
  • Fieldmanager_TextArea
  • Fieldmanager_TextField

Class Fieldmanager_Media

A field to select an attachment via the WordPress Media Manager.

This field submits the selected attachment as an attachment ID (post ID).

Fieldmanager_Field
Extended by Fieldmanager_Media
Package: Fieldmanager\Field
Located at class-fieldmanager-media.php

Methods summary

public
# __construct( string $label = '', array $options = array() )

Construct default attributes

Construct default attributes

Parameters

$label
string
$label
$options
array
$options

Overrides

Fieldmanager_Field::__construct
public
# admin_print_scripts( )

Hook into admin_print_scripts action to enqueue the media for the current post

Hook into admin_print_scripts action to enqueue the media for the current post

public sanitized
# presave( mixed $value, mixed $current_value = array() )

Presave; ensure that the value is an absolute integer

Presave; ensure that the value is an absolute integer

Parameters

$value
mixed
$value If a single field expects to manage an array, it must override presave()
$current_value

Returns

sanitized
values.

Overrides

Fieldmanager_Field::presave
public string
# form_element( mixed $value = array() )

Form element

Form element

Parameters

$value
mixed
$value

Returns

string
HTML

Overrides

Fieldmanager_Field::form_element

Methods inherited from Fieldmanager_Field

_invalid_definition(), _unauthorized_access(), activate_submenu_page(), add_another(), add_meta_box(), add_page_form(), add_quickedit_box(), add_submenu_page(), add_term_meta_box(), add_user_form(), element_markup(), escape(), get_collapse_handle(), get_element_attributes(), get_element_id(), get_element_key(), get_element_label(), get_extra_element_classes(), get_form_name(), get_form_tree(), get_remove_handle(), get_sort_handle(), is_group(), is_repeatable(), preload_alter_values(), presave_all(), set_options(), single_element_markup(), wrap_with_multi_tools()

Magic methods summary

Properties summary

public string $field_class
#

Override field_class

Override field_class

public string $button_label
#

Button Label

Button Label

public string $modal_button_label
#

Button label in the media modal popup

Button label in the media modal popup

public string $modal_title
#

Title of the media modal popup

Title of the media modal popup

public string $thumbnail_class
#

Class to attach to thumbnail media display

Class to attach to thumbnail media display

public string $preview_size
#

Which size a preview image should be. Should be a string (e.g. "thumbnail", "large", or some size created with add_image_size) You can use an array here

Which size a preview image should be. Should be a string (e.g. "thumbnail", "large", or some size created with add_image_size) You can use an array here

public string $mime_type
#

What mime types are available to choose from. Valid options are "all" or a partial or full mimetype (e.g. "image" or "application/pdf").

What mime types are available to choose from. Valid options are "all" or a partial or full mimetype (e.g. "image" or "application/pdf").

public static boolean $has_registered_media
#

Static variable so we only load media JS once

Static variable so we only load media JS once

Properties inherited from Fieldmanager_Field

$add_more_label, $add_more_position, $attributes, $data_id, $data_type, $datasource, $debug, $default_value, $description, $description_after_element, $display_if, $escape, $extra_elements, $index, $index_filter, $inline_label, $input_type, $is_attachment, $label, $label_after_element, $label_element, $limit, $meta_boxes_to_remove, $minimum_count, $name, $one_label_per_item, $remove_default_meta_boxes, $required, $sanitize, $save_empty, $serialize_data, $skip_save, $sortable, $template, $validate, $validation_messages, $validation_rules

Fieldmanager API documentation generated by ApiGen 2.8.0