I've installed a theme on my word press that uses Visual Composer. But after installing it I found out that the theme has disabled some element from Visual Composer. After quit some time i found the file that is being executed to remove these elements.
I created a child theme in order to override this function but with no luck.
the original function goes like this:
if ( ! function_exists('remove-elements-from-vc') ) {
function remove-elements-from-vc() {
/*** Remove Grid Elements if grid elements disabled */
vc_remove_element('vc_basic_grid');
vc_remove_element('vc_media_grid');
vc_remove_element('vc_masonry_grid');
vc_remove_element('vc_masonry_media_grid');
vc_remove_element('vc_icon');
vc_remove_element('vc_button2');
vc_remove_element("vc_custom_heading");
/*** Remove unused parameters from grid elements */
if (function_exists('vc_remove_param')) {
vc_remove_param('vc_basic_grid', 'button_style');
vc_remove_param('vc_basic_grid', 'button_color');
vc_remove_param('vc_basic_grid', 'button_size');
vc_remove_param('vc_basic_grid', 'filter_color');
vc_remove_param('vc_basic_grid', 'filter_style');
vc_remove_param('vc_media_grid', 'button_style');
vc_remove_param('vc_media_grid', 'button_color');
vc_remove_param('vc_media_grid', 'button_size');
vc_remove_param('vc_media_grid', 'filter_color');
vc_remove_param('vc_media_grid', 'filter_style');
vc_remove_param('vc_masonry_grid', 'button_style');
vc_remove_param('vc_masonry_grid', 'button_color');
vc_remove_param('vc_masonry_grid', 'button_size');
vc_remove_param('vc_masonry_grid', 'filter_color');
vc_remove_param('vc_masonry_grid', 'filter_style');
vc_remove_param('vc_masonry_media_grid', 'button_style');
vc_remove_param('vc_masonry_media_grid', 'button_color');
vc_remove_param('vc_masonry_media_grid', 'button_size');
vc_remove_param('vc_masonry_media_grid', 'filter_color');
vc_remove_param('vc_masonry_media_grid', 'filter_style');
vc_remove_param('vc_basic_grid', 'paging_color');
vc_remove_param('vc_basic_grid', 'arrows_color');
vc_remove_param('vc_media_grid', 'paging_color');
vc_remove_param('vc_media_grid', 'arrows_color');
vc_remove_param('vc_masonry_grid', 'paging_color');
vc_remove_param('vc_masonry_grid', 'arrows_color');
vc_remove_param('vc_masonry_media_grid', 'paging_color');
vc_remove_param('vc_masonry_media_grid', 'arrows_color');
}
}
add_action('vc_after_init', 'remove-elements-from-vc');
}
And this is what I'm trying to do in my child theme in functions.php:
add_action( 'vc_after_init', 'undo-remove-elements-from-vc' );
function undo-remove-elements-from-vc(){
remove_action( 'vc_after_init', 'remove-elements-from-vc');
}
the function that is causing this action is in a file called "visual-composer-config.php" and it's being loaded from a sibling file called "load.php"
if (visual_composer_installed()) {
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/visualcomposer/visual-composer-functions.php';
include_once ELATED_FRAMEWORK_MODULES_ROOT_DIR.'/visualcomposer/visual-composer-config.php';
}
I don't want to edit the original theme codes in case of any theme update later on, the changes will be removed. So i need to find a solution from the Child Theme.
Thanks