BluePrint-Q
  • Namespace
  • Class

Namespaces

  • bpq
  • ski

Classes

  • bootstrap
  • convert
  • cz_checkbox_ctl
  • cz_color_palette_ctl
  • cz_date_picker_ctl
  • cz_detail_ctl
  • cz_divider_1_ctl
  • cz_divider_2_ctl
  • cz_drop_categories_ctl
  • cz_drop_ctl
  • cz_drop_image_sizes_ctl
  • cz_drop_menu_items_ctl
  • cz_drop_menus_ctl
  • cz_drop_pages_ctl
  • cz_drop_post_types_ctl
  • cz_drop_posts_ctl
  • cz_drop_tags_ctl
  • cz_drop_taxonomies_ctl
  • cz_drop_terms_ctl
  • cz_drop_users_ctl
  • cz_dummy_ctl
  • cz_media_library_ctl
  • cz_number_bar_ctl
  • cz_radio_image_align_x_ctl
  • cz_radio_image_align_y_ctl
  • cz_radio_image_alignment_ctl
  • cz_radio_image_ctl
  • cz_radio_image_sidebar_layout_ctl
  • cz_radio_image_site_span_layout_ctl
  • cz_radio_text_ctl
  • cz_text_area_ctl
  • cz_textbox_ctl
  • db
  • db_recordset
  • drop
  • mail
  • math
  • mb_checkbox_ctl
  • mb_ctl
  • mb_date_picker_ctl
  • mb_detail_ctl
  • mb_divider_ctl
  • mb_drop_ctl
  • mb_media_library_ctl
  • mb_number_bar_ctl
  • mb_radio_image_ctl
  • mb_radio_image_sidebar_layout_ctl
  • mb_radio_image_site_span_layout_ctl
  • mb_radio_text_ctl
  • mb_repeater_ctl
  • mb_text_area_ctl
  • mb_text_ctl
  • mb_text_notice_ctl
  • mb_textbox_ctl
  • media
  • metabox
  • path
  • post
  • question
  • sanitize
  • string
  • textbox

Traits

  • cz_supplement

Functions

  • customize_register_section
  • cz_enqueue
  • init
  • metabox_sample

Class media

The main WP database class where database interactions can be grouped together for consistency.

Namespace: ski
Located at packages/ski.web/services/ski.wp.media.php

Methods summary

public static array
# find_ids_like_slug( string $slug_like = null, boolean $mime_type = 'image', integer $num_ids_desired = 0 )

Returns an array of all attachment IDs present in the media library that match a given slug pattern.

Returns an array of all attachment IDs present in the media library that match a given slug pattern.

Parameters

$slug_like
string
$slug_like Search for attachments that match this name; can use SQL 'like' wildcards
$mime_type
boolean
$mime_type Can be something like 'image' to find 'image/png', 'image/jpg', etc; or null for everything
$num_ids_desired
integer
$num_ids_desired The first X rows will be returned; otherwise use 0 for everything

Returns

array
If found, an array of attachment IDs; otherwise, null
public static array
# find_first_id_like_slug( string $slug_like = null, boolean $mime_type = 'image' )

Returns the first-found attachment ID present in the media library that matches a given slug pattern.

Returns the first-found attachment ID present in the media library that matches a given slug pattern.

Parameters

$slug_like
string
$slug_like Search for attachments that match this name; can use SQL 'like' wildcards
$mime_type
boolean
$mime_type Can be something like 'image' to find 'image/png', 'image/jpg', etc; or null for everything

Returns

array
If found, a single attachment ID; otherwise, null
public static array
# find_image_ids_like_slug( string $slug_like = null, integer $num_ids_desired = 0 )

Returns an array of all image IDs present in the media library that match the given slug pattern.

Returns an array of all image IDs present in the media library that match the given slug pattern.

Parameters

$slug_like
string
$slug_like Search for images that match this name; can use SQL 'like' wildcards
$num_ids_desired
integer
$num_ids_desired The first X rows will be returned; otherwise use 0 for everything

Returns

array
If found, an array of image IDs; otherwise, null
public static array
# find_first_image_id_like_slug( string $slug_like = null )

Returns the first-found image ID present in the media library that matches a given slug pattern.

Returns the first-found image ID present in the media library that matches a given slug pattern.

Parameters

$slug_like
string
$slug_like Search for an image that matches this name; can use SQL 'like' wildcards

Returns

array
If found, a single image ID; otherwise, null
public static array
# get_meta_info( integer $attachment_id, boolean $include_sizes = false )

Retrieves information on an attachment. Oddly, no native function exists in WordPress to give this kind of info all-in-one.

Retrieves information on an attachment. Oddly, no native function exists in WordPress to give this kind of info all-in-one.

Parameters

$attachment_id
integer
$attachment_id The ID of the attachment whose info is desired
$include_sizes
boolean
$include_sizes Set to 'true' and the returned array will contain an embedded array with the 'src' for each image size

Returns

array
This array contains 'alt', 'caption', 'description', 'href', 'src', and 'title' (and optionally, 'sizes')
public static strubg
# generate_resized_image_html_by_original_path( string $path, string $size = 'full', string $title = '', string $class = '' )

Return the sized-specific HTML for a full path image. Specifically, if you send it something like 'http://www.mysite.com/stuff.png' and you ask for the 'medium' registered WP side, you might get something back like 'http://www.mysite.com/stuff-300x300.png'.

Return the sized-specific HTML for a full path image. Specifically, if you send it something like 'http://www.mysite.com/stuff.png' and you ask for the 'medium' registered WP side, you might get something back like 'http://www.mysite.com/stuff-300x300.png'.

Parameters

$path
string
$path The full path of the image desired
$size
string
$size A thumbnail slug; can be 'medium', 'thumbnail', etc; defaults to 'full'
$title
string
$title An optional attribute to be used in the generated HTML
$class
string
$class An optional class to apply to the generated HTML

Returns

strubg
The generated resized image markup
public static strubg
# generate_image_html_by_id( integer $id, string $size = 'full', string $title = '', string $class = '' )

Return the HTML for an image ID. WordPress already offers this kind of functionality, but it is being added here to pair up with the sibling function - generate_image_html_by_slug.

Return the HTML for an image ID. WordPress already offers this kind of functionality, but it is being added here to pair up with the sibling function - generate_image_html_by_slug.

Parameters

$id
integer
$id The ID of the image desired
$size
string
$size A thumbnail slug; can be 'medium', 'thumbnail', etc; defaults to 'full'
$title
string
$title An optional attribute to be used in the generated HTML
$class
string
$class An optional class to apply to the generated HTML

Returns

strubg
The generated image markup
public static strubg
# generate_image_html_by_slug( string $slug, string $size = 'full', string $title = '', string $class = '' )

Return the HTML for an image slug. Oddly, WordPress only offers this kind of functionality against an ID, not a slug.

Return the HTML for an image slug. Oddly, WordPress only offers this kind of functionality against an ID, not a slug.

Parameters

$slug
string
$slug The name of the image desired; can use SQL 'like' wildcards
$size
string
$size A thumbnail slug; can be 'medium', 'thumbnail', etc; defaults to 'full'
$title
string
$title An optional attribute to be used in the generated HTML
$class
string
$class An optional class to apply to the generated HTML

Returns

strubg
The generated image markup
public static array
# get_image_sizes( boolean $include_dimensions = false )

Returns a list of image sizes registered in the active WP database.

Returns a list of image sizes registered in the active WP database.

Parameters

$include_dimensions
boolean
$include_dimensions If set to 'true', an element in the list might look like this: 'medium 300x300'

Returns

array
A list of sizes as string (e.g. 'thumbnail', 'medium', 'full', etc)

Link

http://codex.wordpress.org/Function_Reference/get_intermediate_image_sizes
public static string
# get_attachment_alt_text( integer $attachment_id )

Attachments can have 'alternative text' specified by the user. Unfortunately, this value does not live in the attachment/post object - instead, it is stored as a custom field and the key is not so obvious. Thus, this accessor.

Attachments can have 'alternative text' specified by the user. Unfortunately, this value does not live in the attachment/post object - instead, it is stored as a custom field and the key is not so obvious. Thus, this accessor.

Parameters

$attachment_id
integer
$attachment_id The ID of the attachment whose alt text is sought

Returns

string
The alt text, if found; otherwise, an empty string

Link

http://wordpress.org/support/topic/get-alternate-text-from-attachments

Magic methods summary

BluePrint-Q API documentation generated by ApiGen 2.8.0