Property | Type | Description | |
---|---|---|---|
$_metabox_title | * Title for dfi metabox | ||
$_textDomain | * Plugin text domain | ||
$_userFilter | * Users post type filter for dfi metabox |
Method | Description | |
---|---|---|
__construct ( ) | Constructor. Hooks all interactions to initialize the class. | |
add_metabox_classes ( $classes ) : string | Add custom class 'featured-meta-box' to meta box | |
ajax_callback ( ) : Void | Load new featured meta box via ajax | |
dfi_action_links ( array $links ) : array | Add upgrade link | |
enqueue_admin_scripts ( ) : Void | Add required admin scripts | |
featured_meta_box ( Object $post, Array $featured ) : Void | Featured meta box as seen in the admin | |
get_all_featured_images ( integer $post_id = null ) : Array | Retrieve featured images for specific post(s) including the default Featured Image | |
get_featured_images ( integer $post_id = null ) : Array | Retrieve featured images for specific post(s) | |
get_image_alt ( String $image_url ) : String | Get image alternate text | |
get_image_alt_by_id ( integer $attachment_id ) : String | Get image alternate text by attachment id | |
get_image_caption ( String $image_url ) : String | Get image caption | |
get_image_caption_by_id ( integer $attachment_id ) : String | Get image caption by id | |
get_image_description ( String $image_url ) : String | Get image description | |
get_image_description_by_id ( integer $attachment_id ) : String | Get image description by id | |
get_image_id ( String $image_url ) : integer | Null | Gets attachment id from given image url | |
get_image_thumb ( String $image_url, String $size = 'thumbnail' ) : String | Get image thumbnail url of specific size by image url | |
get_image_title ( String $image_url ) : String | Get image title | |
get_image_title_by_id ( integer $attachment_id ) : String | Get image title by id | |
get_image_url ( integer $attachment_id, String $size = 'full' ) : String | Get image url of the image by attachment id | |
get_link_to_image ( integer $attachment_id ) : string | null | Get link to image | |
get_nth_featured_image ( integer $position, integer $post_id = null ) : Array | Fetches featured image data of nth position | |
get_post_attachment_ids ( integer $post_id ) : Array | Get all attachment ids of the post | |
initialize_featured_box ( ) : Void | Add featured meta boxes dynamically | |
is_attached ( $attachment_id, $post_id ) : boolean | Check if the image is attached with the particular post | |
load_plugin_textdomain ( ) : void | Load the plugin's textdomain hooked to 'plugins_loaded'. | |
media_attachment_custom_fields ( $form_fields, $post ) : Array | Add custom fields in media uploader | |
media_attachment_custom_fields_save ( $post, $attachment ) : Array | Save values of media uploader custom fields | |
save_meta ( integer $post_id ) : Void | Update featured images in the database | |
update_notice ( ) : Void | Add update notice. Displayed in plugin update page. |
Method | Description | |
---|---|---|
_get_attachment_id ( String $image_url ) : string | Get attachment id of the image by image url | |
_get_number_translation ( integer $number ) : String | Translates more than one digit number digit by digit. | |
_get_real_upload_path ( string $img ) : string | Check to see if the upload url is already available in path. | |
_nonce_field ( string $key ) : string | Create a nonce field | |
_verify_nonces ( ) : boolean | Verify metabox nonces |
Method | Description | |
---|---|---|
__get_protocol ( ) : string | Return site protocol | |
_dfi_add_meta_box ( Array $postTypes, Object $featured = null, integer $i = null ) : Void | adds meta boxes | |
_get_featured_box ( String $featuredImgTrimmed, String $featuredImg, String $featuredId, String $thumbnail, $postId ) : String | Returns featured box html content | |
_separate ( string $urlString, string $state = 'thumb' ) : string | null | Separate thumb and full image url from given URL string | |
execute_query ( $query ) | Helper functions |
public __construct ( ) |
protected _get_attachment_id ( String $image_url ) : string | ||
$image_url | String | url of the image |
return | string |
protected _get_number_translation ( integer $number ) : String | ||
$number | integer | Integer to be translated |
return | String | Translated number |
protected _get_real_upload_path ( string $img ) : string | ||
$img | string | |
return | string |
protected _nonce_field ( string $key ) : string | ||
$key | string | Nonce key |
return | string |
protected _verify_nonces ( ) : boolean | ||
return | boolean |
public add_metabox_classes ( $classes ) : string | ||
$classes | classes to add in the meta box | |
return | string |
public ajax_callback ( ) : Void | ||
return | Void |
public dfi_action_links ( array $links ) : array | ||
$links | array | Action links |
return | array |
public enqueue_admin_scripts ( ) : Void | ||
return | Void |
public featured_meta_box ( Object $post, Array $featured ) : Void | ||
$post | Object | global post object |
$featured | Array | array containing featured image count |
return | Void |
public get_all_featured_images ( integer $post_id = null ) : Array | ||
$post_id | integer | id of the current post |
return | Array | An array of images or an empty array on failure |
public get_featured_images ( integer $post_id = null ) : Array | ||
$post_id | integer | id of the current post |
return | Array |
public get_image_alt ( String $image_url ) : String | ||
$image_url | String | url of an image |
return | String |
public get_image_alt_by_id ( integer $attachment_id ) : String | ||
$attachment_id | integer | attachment id of an image |
return | String |
public get_image_description ( String $image_url ) : String | ||
$image_url | String | url of an image |
return | String |
public get_image_description_by_id ( integer $attachment_id ) : String | ||
$attachment_id | integer | attachment id of an image |
return | String |
public get_image_id ( String $image_url ) : integer | Null | ||
$image_url | String | url of an image |
return | integer | Null | attachment id of an image |
public get_image_thumb ( String $image_url, String $size = 'thumbnail' ) : String | ||
$image_url | String | url of an image |
$size | String | size of the image to fetch (thumbnail, medium, full) |
return | String |
public get_image_title ( String $image_url ) : String | ||
$image_url | String | url of an image |
return | String |
public get_image_title_by_id ( integer $attachment_id ) : String | ||
$attachment_id | integer | attachment id of an image |
return | String |
public get_image_url ( integer $attachment_id, String $size = 'full' ) : String | ||
$attachment_id | integer | attachment id of an image |
$size | String | size of the image to fetch (thumbnail, medium, full) |
return | String |
public get_nth_featured_image ( integer $position, integer $post_id = null ) : Array | ||
$position | integer | position of the featured image |
$post_id | integer | id of the current post |
return | Array | if found, null otherwise |
public get_post_attachment_ids ( integer $post_id ) : Array | ||
$post_id | integer | id of the current post |
return | Array |
public initialize_featured_box ( ) : Void | ||
return | Void |
public is_attached ( $attachment_id, $post_id ) : boolean | ||
$attachment_id | attachment id of an image | |
$post_id | id of the current post | |
return | boolean |
public load_plugin_textdomain ( ) : void | ||
return | void |
public media_attachment_custom_fields ( $form_fields, $post ) : Array | ||
$form_fields | Array Fields to include in media attachment form | |
$post | Array Post data | |
return | Array |
public media_attachment_custom_fields_save ( $post, $attachment ) : Array | ||
$post | Array The post data for database | |
$attachment | Array Attachment fields from $_POST form | |
return | Array |
public update_notice ( ) : Void | ||
return | Void |