vc_map_update()

⌘K
  1. Home
  2. Docs
  3. Inner API
  4. vc_map_update()

vc_map_update()

After vc_map() function call all mapping data is stored in memory, if you need to modify one of the existing parameters you can use vc_map_update()function to do that. This is useful if you want to make a simple change to the existing content elements. For example: Change content element name.

<?php vc_map_update( $shortcode, $settings ); ?>

Params

Param name
Type
Description
$shortcodeStringShortcode base. For [my_shortcode] shortcode base is my_shortcode. For default “Message box” element, base is “vc_message”
$settingsArrayArray with list of settings that should be updated for desired content element. List of settings that can be changed

Example

How to change default name and category values for “Message box” content element.

<?php
$settings = array (
  'name' => __( 'new name', 'my-text-domain' ),
  'category' => __( 'New category name', 'my-text-domain' )
);
vc_map_update( 'vc_message', $settings ); // Note: 'vc_message' was used as a base for "Message box" element
?>

 

Was this article helpful to you? No Yes 2

How can we help?