Home API td_api_thumb::update

td_api_thumb::update

Available on: Newsmag V1.8+, Newspaper V5+
This api call is used to update the parameters of an existing thumbnail.

Usage:

<?php td_api_thumb::update( $id, $params_array ) ?>

Parameters:

$id (string) (required)

  • the thumbnail id – has to match with one of the thumbnails which are already registered in the theme

$params_array (array) (required)

  • an array which contains the parameters of the thumbnail
Key name
Type
Description
name string the thumbnail name
width integer the thumbnail width in pixels
height integer the thumbnail height in pixels
crop mixed the cropping method (array, true or false), it is passed to the add_image_size() function, for more information check the following resources – functionextra
post_format_icon_size string specify what play icon to load for video posts (small or normal)
used_on array the locations on which thumb appears, it’s just an info and appears in Theme Panel -> Block Settings

Examples:

In the following example we’ll update the existing Thumbnail 100×75 , you can see how the code looks on plugin, ex:

td_api_thumb::update('td_100x75',
    array(
        'name' => 'td_100x75',
        'width' => 100,
        'height' => 75,
        'crop' => array('center', 'top'),
        'post_format_icon_size' => 'small',
        'used_on' => array(
            'Module 6, 7', 'Block 1, 2, 7, 8'
        )
    )
);