Hi mjdigital,
Thank you 🙂
1. Yes, you are right, this is the bug and I will fix this issue in the next plugin release. At this moment you can go into plugin folder extensive-vc/constants.php open this file and find this code below
define( 'EXTENSIVE_VC_THEME_ROOT_PATH', get_template_directory() );
and replace it with this
define( 'EXTENSIVE_VC_THEME_ROOT_PATH', get_stylesheet_directory() );
2. If I understand, you want to add additional VC options for some shortcode?
If I’m right, you’ll have to wait a little while until I try few solutions in my side. Thanks for your patience.
Not perfect/good solutions:
1. For example you can try to override whole class with that shortcode, inside plugin folder you have condition if class_exist for all shortcodes, so you can be able to override whole class from different places.
2. Also there is a hook extensive_vc_action_include_shortcodes_file where you can include your own shortcode, just create additional copy of plugin shortcode, modify it with your parameters, with your templates and set your shortcode name and you will get what you want.
Best regards,
Nenad
Nenad
Thanks for the reply – for the time being I will do as you suggest and tweak the plugin core files and use the extensive_vc_action_include_shortcodes_file to insert a tweaked clone of the elements I need to update.
Thanks again for all your time on this, it is a great plugin.
Mark
Hi mjdigital,
You are welcome, but now I have better news 🙂
New plugin update is arrived, just update you version of plugin and you will get additional hook extensive_vc_filter_shortcode_params to add additional shortcode parameters.
Example functions how you can do that are
if ( ! function_exists( 'extensive_vc_blockquote_additional_params' ) ) {
function extensive_vc_blockquote_additional_params( $params, $shortcode_base ) {
if ( $shortcode_base === 'evc_blockquote' ) {
$params[] = array(
'type' => 'textfield',
'param_name' => 'some_text_field',
'heading' => esc_html__( 'Some Text Field', 'extensive-vc' )
);
return $params;
}
}
add_filter( 'extensive_vc_filter_shortcode_params', 'extensive_vc_blockquote_additional_params', 10, 2 );
}
if ( ! function_exists( 'extensive_vc_set_blockquote_additional_params_default_value' ) ) {
/**
* @param array $out The output array of shortcode attributes.
* @param array $pairs The supported attributes and their defaults.
* @param array $atts The user defined shortcode attributes.
* @param string $shortcode The shortcode name.
*
* @return array
*/
function extensive_vc_set_blockquote_additional_params_default_value( $out, $pairs, $atts, $shortcode ) {
$out['some_text_field'] = '';
return $out;
}
add_filter( 'shortcode_atts_evc_blockquote', 'extensive_vc_set_blockquote_additional_params_default_value', 10, 4 );
}
I hope this helps you.
Best regards,
Nenad
-
This reply was modified 7 years, 11 months ago by
Jan Dembowski.
-
This reply was modified 7 years, 11 months ago by
Nenad Obradovic. Reason: Grammar fix
Nenad
That’s perfect – I’ve updated the plugin and tried out the new hooks and they do exactly what I needed for this project.
Thanks so much for getting that sorted – brilliant plugin and brilliant support. I’ll make sure to give it 5 stars for you.
Mark
Hi Mark,
You are welcome ☺
Thanks so much for this kind of words and for the rating. ☺
Best regards,
Nenad