td_api_block::update

Available on: Newspaper V11+

This api call is used to update the parameters of an existing block.

Usage:

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

Parameters:

$id (string) (required)

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

$params_array (array) (required)

  • an array which contains the parameters of the block
  • most of the parameters are passed to the vc_map function of visual composer
Key name
Type
Description
map_in_td_composer boolean enable/disable the block appearance in tagDiv Composer
name string the block title, it appears in Visual Composer
base string shortcode tag. For [my_shortcode] shortcode base is my_shortcode
class string CSS class which will be added to the shortcode’s content element in the page edit screen in Visual Composer backend edit mode
controls string undocumented VC parameter. Default: “full”
category string category which best suites to describe functionality of this shortcode. Default category: Blocks. You can add your own category, simply enter new category title here
tdc_category string Blocks(tagDiv composer) …
icon string URL or CSS class with icon image, the icon is displayed in Visual Composer
file string the path for the block template file
params array the array of parameters received from the block settings panel

Examples:

In the following example we’ll update the existing Flex Block 1 , you can see how the code looks on plugin, we use the variables which were introduced in the Plugin Method section: