MLA_Thumbnail

Class MLA (Media Library Assistant) Thumbnails provides support for Featured Image generation

package

Media Library Assistant

since 2.13

Methods

Generate WordPress-style (4.7+) thumbnail image

_generate_wordpress_thumbnail(string $post_id, string $file, array $args, array $old_sizes = NULL) : array
static

Adapted from /wp-admin/includes/image.php function wp_generate_attachment_metadata()

since 2.40

Arguments

$post_id

string

ID of the source item

$file

string

Source file path and name

$args

array

Image file information, based on $_FILE in PHP uploads

$old_sizes

array

Existing WordPress-style thumbnail images to be deleted

Response

array

Sizes specifications for attachment metadata

Load the plugin's Style Sheet and Javascript files

admin_enqueue_scripts( $page_hook) : void
static
since 2.13

Arguments

$page_hook

Initialization function, similar to __construct()

initialize() : void
static
since 2.13

Begin an MLA_List_Table bulk action

mla_list_table_begin_bulk_action(array $item_content, string $bulk_action) 
static

Prepare the thumbnail generation options.

since 2.13

Arguments

$item_content

array

NULL, to indicate no handler.

$bulk_action

string

the requested action.

Process an MLA_List_Table custom bulk action

mla_list_table_custom_bulk_action(array $item_content, string $bulk_action, integer $post_id) : object
static

Creates new items from the "Bulk Thumbnail" list.

since 2.13

Arguments

$item_content

array

NULL, to indicate no handler.

$bulk_action

string

the requested action.

$post_id

integer

the affected attachment.

Response

object

updated $item_content. NULL if no handler, otherwise ( 'message' => error or status message(s), 'body' => '' )

End an MLA_List_Table bulk action

mla_list_table_end_bulk_action(array $item_content, string $bulk_action) 
static

Add the query arguments required for the "Generated Thumbnails" filter.

since 2.13

Arguments

$item_content

array

NULL, to indicate no handler.

$bulk_action

string

the requested action.

Filter the MLA_List_Table bulk actions

mla_list_table_get_bulk_actions(array $actions) : array
static

Adds the "Thumbnail" action to the Bulk Actions list.

since 2.13

Arguments

$actions

array

An array of bulk actions. Format: 'slug' => 'Label'

Response

array

updated array of actions.

Load the MLA_List_Table dropdown help menu template

mla_list_table_help_template(array $template_array, string $file_name, string $file_suffix) 
static

Add the thumbnail generation options documentation.

since 2.13

Arguments

$template_array

array

NULL, to indicate no replacement template.

$file_name

string

the complete name of the default template file.

$file_suffix

string

the $screen->id or hook suffix part of the template file name.

MLA_List_Table inline edit parse

mla_list_table_inline_parse( $html_markup,  $item_template,  $item_values) : array
static
since 2.13

Adds Bulk Translate form and the Language dropdown markup used for the Quick and Bulk Edit forms.

Arguments

$html_markup

$item_template

$item_values

Response

array

updated HTML markup for the Quick and Bulk Edit forms

Filter the "sticky" submenu URL parameters

mla_list_table_submenu_arguments(array $submenu_arguments, object $include_filters) : array
static

Maintains the list of "Generated Thumbnails" items in the URLs for filtering the table display.

since 2.13

Arguments

$submenu_arguments

array

Current view, pagination and sort parameters.

$include_filters

object

True to include "filter-by" parameters, e.g., year/month dropdown.

Response

array

updated submenu_arguments.

Add a subdirectory to the wp_upload_dir results

upload_dir(array $uploads) 
static
since 2.54

Arguments

$uploads

array

Array of upload directory data with keys of 'path', 'url', 'subdir, 'basedir', and 'error'.

Constants

Uniquely identifies the Thumbnails bulk action

MLA_GFI_ACTION
since
var

Properties

Options for the thumbnail generation bulk action

bulk_action_options : array
static
since
var

Type(s)

array

Items returned by custom bulk action(s)

bulk_action_includes : array
static
since
var

Type(s)

array