init_meta_box_by_version

Depending on what CF7 version is active, we use the appropiate hook!.

Description

init_meta_box_by_version(); 

Usage

  1. if ( !function_exists( 'init_meta_box_by_version' ) ) { 
  2. require_once '/inc/slider_meta_box.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = init_meta_box_by_version(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/inc/slider_meta_box.php  
  1. function init_meta_box_by_version() { 
  2. $plugin_folder = get_plugins( '/' . 'contact-form-7' ); 
  3. $plugin_file = 'wp-contact-form-7.php'; 
  4. if($plugin_folder) { 
  5. $CF7Version = $plugin_folder[$plugin_file]['Version']; 
  6. if ( $CF7Version < 4.2 ) { 
  7. add_action( 'wpcf7_add_meta_boxes', 'cf7style_meta_box' ); 
  8. } else { 
  9. add_filter( 'wpcf7_editor_panels', 'cf7style_add_template_panel' );