/**
  * Call all stored activities.
  *
  * Called by init method. List of activities stored by $init_activity are created by other objects called after
  * initialization.
  *
  * @since  4.2
  * @access public
  */
 protected function callActivities()
 {
     do_action('vc_mapper_call_activities_before');
     while ($activity = each($this->init_activity)) {
         list($object, $method, $params) = $activity[1];
         if ('mapper' === $object) {
             switch ($method) {
                 case 'map':
                     WPBMap::map($params['tag'], $params['attributes']);
                     break;
                 case 'drop_param':
                     WPBMap::dropParam($params['name'], $params['attribute_name']);
                     break;
                 case 'add_param':
                     WPBMap::addParam($params['name'], $params['attribute']);
                     break;
                 case 'mutate_param':
                     WPBMap::mutateParam($params['name'], $params['attribute']);
                     break;
                 case 'drop_all_shortcodes':
                     WPBMap::dropAllShortcodes();
                     break;
                 case 'drop_shortcode':
                     WPBMap::dropShortcode($params['name']);
                     break;
                 case 'modify':
                     WPBMap::modify($params['name'], $params['setting_name'], $params['value']);
                     break;
             }
         }
     }
 }
Example #2
0
/**
 * Shorthand function for WPBMap::dropParam
 * @param $name
 * @param $attribute_name
 */
function vc_remove_param($name = '', $attribute_name = '')
{
    return WPBMap::dropParam($name, $attribute_name);
}
Example #3
0
 public function callElementActivities($tag)
 {
     do_action('vc_mapper_call_activities_before');
     if (isset($this->element_activities[$tag])) {
         while ($activity = each($this->element_activities[$tag])) {
             list($method, $params) = $activity[1];
             switch ($method) {
                 case 'drop_param':
                     WPBMap::dropParam($params['name'], $params['attribute_name']);
                     break;
                 case 'add_param':
                     WPBMap::addParam($params['name'], $params['attribute']);
                     break;
                 case 'mutate_param':
                     WPBMap::mutateParam($params['name'], $params['attribute']);
                     break;
                 case 'drop_shortcode':
                     WPBMap::dropShortcode($params['name']);
                     break;
                 case 'modify':
                     WPBMap::modify($params['name'], $params['setting_name'], $params['value']);
                     break;
             }
         }
     }
 }