Created
May 24, 2017 07:18
-
-
Save pehaa/84eb9a9f28378d444e986e972704f263 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'ginger_login_link_visible', '__return_false' ); | |
add_filter( 'phtpb_config_data', 'ginger_demo_phtpb_config_data' ); | |
function ginger_demo_phtpb_config_data( $data ) { | |
$rev_sliders = array(); | |
if ( class_exists( 'RevSlider' ) ) { | |
$slider = new RevSlider(); | |
$arrSliders = $slider->getArrSliders(); | |
if ( $arrSliders ) { | |
foreach ( $arrSliders as $rev_slider ) { | |
$rev_sliders[ $rev_slider->getAlias() ] = $rev_slider->getTitle(); | |
} | |
} | |
} | |
$data['phtpb_revslider'] = array( | |
'label' => 'phtpb_revslider', | |
'title' => esc_html__( 'Revolution Slider', 'yaga' ), | |
'icon' => 'fa fa-exchange', | |
'phtpb_admin_type' => 'module', | |
'fields' => array( | |
'phtpb_id' => array( | |
'title' => esc_html__( 'Choose slider', 'yaga' ), | |
'type' => 'select', | |
'options' => $rev_sliders | |
), | |
), | |
'phtpb_admin_mode' => 'simple', | |
'create_with_settings' => true, | |
'is_disabled' => ! class_exists( 'RevSlider' ) | |
); | |
return $data; | |
} | |
add_action( 'ginger_addons_class_loaded', 'ginger_child_addons_class_loaded' ); | |
function ginger_child_addons_class_loaded() { | |
add_filter( 'ginger_phtpb_shortcode_template', 'ginger_child_phtpb_shortcode_template', 10, 2 ); | |
class Ginger_Child_PeHaa_Themes_Page_Builder_Shortcode_Template extends Ginger_PeHaa_Themes_Page_Builder_Shortcode_Template { | |
protected function phtpb_revslider() { | |
if ( ! class_exists( 'RevSlider' ) ) { | |
return; | |
} | |
if ( ! $this->phtpb_id_string ) { | |
return; | |
} | |
$content = "[rev_slider $this->phtpb_id_string]"; | |
return do_shortcode( $content ); | |
} | |
} | |
} | |
function ginger_child_phtpb_shortcode_template( $content, $name ) { | |
return new Ginger_Child_PeHaa_Themes_Page_Builder_Shortcode_Template( $name ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment