__($open_multiple_faqs, 'pippin')) ); } public function create_faq_shortcode($atts){ $id = 0; extract(shortcode_atts(array( "id" => '', ), $atts ) ); $status = get_post_status( $id); $is_faq = get_post_type($id); if($status == 'publish' && $is_faq == 'faq'){ $faq_list = $this->faq_list($id); return $faq_list; }else{ return "[FAQ id='".$id."']"; } } public function add_data_into_the_content($shortcode_content) { if(is_single()){ $id = get_the_ID(); echo $this->faq_list($id); } return $shortcode_content; } public function faq_list($id){ $get_faq_data = get_post_meta( $id, FAQ_META_KEY, true); $get_faq_color = get_post_meta( $id, FAQ_SETTINGS_META_KEY, true); $faq_cleaned_color = isset ( $get_faq_color) ? $get_faq_color :''; $faq_settings_enable_option = get_post_meta( $id,FAQ_SETTINGS_ENABLE_OPTION ,true); $general_settings = get_option('faq_settings'); $use_post_settings = isset($faq_settings_enable_option['use_post_settings']) ? $faq_settings_enable_option['use_post_settings']: ''; $post_url = get_post_permalink($id); $updated_date = get_the_modified_date(get_option('date_format'),$id); $date = apply_filters( 'updated_date', $updated_date); $i = 1; $count = 0; $url = get_edit_post_link($id); if(isset($general_settings['show_updated_date']) && $general_settings['show_updated_date']){ $show_updated_date = $general_settings['show_updated_date']; }else{ $show_updated_date = ''; } if(!empty($get_faq_data)){ ob_start(); ?>

get_manage_settings_fields(); $general_settings = array(); $general_settings['title_color'] = $fieldset['title_color']['value']; $general_settings['title_bg_color'] = $fieldset['title_bg_color']['value']; $general_settings['content_color'] = $fieldset['content_color']['value']; $general_settings['content_bg_color'] = $fieldset['content_bg_color']['value']; $general_settings['accordion_display_style_on_load'] = $fieldset['accordion_display_style_on_load']['value']; } if($use_post_settings == '' or $use_post_settings == 'no' ){ $title_color = $general_settings['title_color']; $title_bg_color = $general_settings['title_bg_color']; $content_color = $general_settings['content_color']; $content_bg_color = $general_settings['content_bg_color']; }else{ $title_color = $faq_cleaned_color['title_color']; $title_bg_color = $faq_cleaned_color['title_bg_color']; $content_color = $faq_cleaned_color['content_color']; $content_bg_color = $faq_cleaned_color['content_bg_color']; } $acoordian_nature = $general_settings['accordion_display_style_on_load']; if(($acoordian_nature == 'open') and ($count == 1)){ $open = "open"; }else { $open = ""; } ?>

'; $facebook = ''; $email = ''; $linkedin = ''; $select_share_buttons = isset ($general_settings['social_share_options']) ? $general_settings['social_share_options'] : 'empty'; $share_buttons = explode(',', $select_share_buttons); if(implode(" ",$share_buttons) =='empty'){ $share_button_title =''; }else{ $share_button_title = stripslashes($general_settings['share_button_title']); } if(!empty($general_settings['enable_share_button'])){ $enable_share_button = $general_settings['enable_share_button']; }else{ $enable_share_button = 'empty'; } if($enable_share_button =='true'){ echo "

"; echo "" . $share_button_title . ''; echo in_array("linkedin", $share_buttons) ? $linkedin: ""; echo in_array("facebook", $share_buttons) ? $facebook : ""; echo in_array("twitter", $share_buttons) ? $twitter : ""; echo in_array("email", $share_buttons) ? $email: ""; echo in_array("pinterest ", $share_buttons) ? $Pinterest: ""; echo "

"; } $show_edit =''; if((current_user_can('administrator') and !is_singular('faq')) or (current_user_can( 'manage_woocommerce') and !is_singular('faq'))) {echo $show_edit; } ?>