Advertisement
Guest User

Untitled

a guest
May 5th, 2022
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.20 KB | None | 0 0
  1. <?php
  2.  
  3. function webriti_busiprof_services() {
  4. $default_content = false;
  5. $current_options = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  6. $busiprof_service_content = get_theme_mod('busiprof_service_content', $default_content);
  7. if ($current_options['enable_services'] == "on") {
  8. if (!empty($current_options)) {
  9. if (empty($busiprof_service_content)) {
  10.  
  11. $old_theme_servives = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  12.  
  13. if ($old_theme_servives['service_image_one'] != '' || $old_theme_servives['service_icon_one'] != '' || $old_theme_servives['service_title_one'] != '' || $old_theme_servives['service_text_one'] != '' || $old_theme_servives['service_image_two'] != '' || $old_theme_servives['service_icon_two'] != '' || $old_theme_servives['service_title_two'] != '' || $old_theme_servives['service_text_two'] != '' || $old_theme_servives['service_image_three'] != '' || $old_theme_servives['service_icon_three'] != '' || $old_theme_servives['service_title_three'] != '' || $old_theme_servives['service_text_three'] != '' || $old_theme_servives['service_image_four'] != '' || $old_theme_servives['service_icon_four'] != '' || $old_theme_servives['service_title_four'] != '' || $old_theme_servives['service_text_four'] != '') {
  14.  
  15. $busiprof_service_content = json_encode(array(
  16. array(
  17. 'icon_value' => isset($old_theme_servives['service_icon_one']) ? $old_theme_servives['service_icon_one'] : '',
  18. 'image_url' => isset($old_theme_servives['service_image_one']) ? $old_theme_servives['service_image_one'] : '',
  19. 'choice' => 'customizer_repeater_icon',
  20. 'title' => isset($old_theme_servives['service_title_one']) ? $old_theme_servives['service_title_one'] : '',
  21. 'text' => isset($old_theme_servives['service_text_one']) ? $old_theme_servives['service_text_one'] : '',
  22. 'link' => '',
  23. 'id' => 'customizer_repeater_56d7ea7f40b56',
  24. 'color' => '#e91e63',
  25. ),
  26. array(
  27. 'icon_value' => isset($old_theme_servives['service_icon_two']) ? $old_theme_servives['service_icon_two'] : '',
  28. 'image_url' => isset($old_theme_servives['service_image_two']) ? $old_theme_servives['service_image_two'] : '',
  29. 'choice' => 'customizer_repeater_icon',
  30. 'title' => isset($old_theme_servives['service_title_two']) ? $old_theme_servives['service_title_two'] : '',
  31. 'text' => isset($old_theme_servives['service_text_two']) ? $old_theme_servives['service_text_two'] : '',
  32. 'link' => '',
  33. 'id' => 'customizer_repeater_56d7ea7f40b66',
  34. 'color' => '#a01000',
  35. ),
  36. array(
  37. 'icon_value' => isset($old_theme_servives['service_icon_three']) ? $old_theme_servives['service_icon_three'] : '',
  38. 'image_url' => isset($old_theme_servives['service_image_three']) ? $old_theme_servives['service_image_three'] : '',
  39. 'choice' => 'customizer_repeater_icon',
  40. 'title' => isset($old_theme_servives['service_title_three']) ? $old_theme_servives['service_title_three'] : '',
  41. 'text' => isset($old_theme_servives['service_text_three']) ? $old_theme_servives['service_text_three'] : '',
  42. 'link' => '',
  43. 'id' => 'customizer_repeater_56d7ea7f40b86',
  44. 'color' => '#eded23',
  45. ),
  46. array(
  47. 'icon_value' => isset($old_theme_servives['service_icon_four']) ? $old_theme_servives['service_icon_four'] : '',
  48. 'image_url' => isset($old_theme_servives['service_image_four']) ? $old_theme_servives['service_image_four'] : '',
  49. 'choice' => 'customizer_repeater_icon',
  50. 'title' => isset($old_theme_servives['service_title_four']) ? $old_theme_servives['service_title_four'] : '',
  51. 'text' => isset($old_theme_servives['service_text_four']) ? $old_theme_servives['service_text_four'] : '',
  52. 'link' => '',
  53. 'id' => 'customizer_repeater_56d7ea7f40b96',
  54. 'color' => '#59327a',
  55. ),
  56. ));
  57. }
  58. }
  59. }
  60. $theme = wp_get_theme(); // gets the current theme
  61. $current_options = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  62.  
  63.  
  64. if (isset($current_options['service_effect_layout_setting']) && $theme->name=='vdequator') {
  65. if ($current_options['service_effect_layout_setting'] == 'default') {
  66. busiprof_default_layout($busiprof_service_content); //default Lyout
  67. }
  68. if ($current_options['service_effect_layout_setting'] == 'slide_effect') {
  69. busiprof_slide_layout($busiprof_service_content); //slide layout used in vdequator child
  70. }
  71. }
  72. if (isset($current_options['service_rotate_effect_layout_setting']) && $theme->name=='LazyProf') {
  73. if ($current_options['service_rotate_effect_layout_setting'] == 'default') {
  74. busiprof_default_layout($busiprof_service_content); //default Lyout
  75. }
  76. if ($current_options['service_rotate_effect_layout_setting'] == 'rotate_effect') {
  77. busiprof_rotate_layout($busiprof_service_content); //slide layout used in lazyprof child
  78. }
  79. }
  80. if (isset($current_options['service_blink_effect_layout_setting']) && $theme->name=='vdperanto') {
  81. if ($current_options['service_blink_effect_layout_setting'] == 'default') {
  82. busiprof_default_layout($busiprof_service_content); //default Lyout
  83. }
  84. if ($current_options['service_blink_effect_layout_setting'] == 'blink_effect') {
  85. busiprof_blink_layout($busiprof_service_content); //slide layout used in lazyprof child
  86. }
  87. }
  88.  
  89.  
  90. if($theme->name=='vdequator' && (!isset($current_options['service_effect_layout_setting'])) ) {
  91.  
  92. if(get_option('busiprof_user', 'new') == 'old' && (version_compare(wp_get_theme()->get('Version'), '1.0.9') > 0)){
  93. busiprof_default_layout($busiprof_service_content); //default Lyout
  94. }else{
  95. busiprof_slide_layout($busiprof_service_content); //slide layout used in vdequator child
  96. }
  97. }
  98.  
  99. if ($theme->name=='LazyProf' && !isset($current_options['service_rotate_effect_layout_setting']) ) {
  100. if(get_option('busiprof_user', 'new') == 'old' && (version_compare(wp_get_theme()->get('Version'), '1.2.5') > 0)){
  101. busiprof_default_layout($busiprof_service_content); //default Lyout
  102. }else{
  103. busiprof_rotate_layout($busiprof_service_content); //slide layout used in lazyprof child
  104. }
  105. }
  106. if ($theme->name=='vdperanto' && !isset($current_options['service_blink_effect_layout_setting'])) {
  107.  
  108. if(get_option('busiprof_user', 'new') == 'old' && (version_compare(wp_get_theme()->get('Version'), '2.0', '>='))){
  109. busiprof_default_layout($busiprof_service_content); //default Lyout
  110. }else{
  111. busiprof_blink_layout($busiprof_service_content); //slide layout used in vdequator child
  112. }
  113. }
  114.  
  115. if($theme->name=='Busiprof' || $theme->name=='ARzine'){
  116. busiprof_default_layout($busiprof_service_content); //default Lyout
  117. }
  118.  
  119. if($theme->name == 'Busiprof Agency'){
  120. busiprof_circle_layout($busiprof_service_content); //default Lyout
  121. }
  122. if($theme->name=='Busiprof Child'){
  123. busiprof_default_layout($busiprof_service_content); //default Lyout
  124. }
  125.  
  126. }
  127. }
  128.  
  129.  
  130. function busiprof_rotate_layout($busiprof_service_content){
  131. $current_options = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  132. ?>
  133. <section id="section" class="service5 service">
  134. <div class="container">
  135. <div class="row">
  136. <div class="col-md-12">
  137. <div class="section-title">
  138. <?php if ($current_options['service_heading_one'] != '') { ?>
  139. <h1 class="section-heading"><?php echo wp_kses_post($current_options['service_heading_one']); ?></h1>
  140. <?php } if ($current_options['service_tagline'] != '') { ?>
  141. <p><?php echo esc_html($current_options['service_tagline']); ?></p>
  142. <?php } ?>
  143. </div>
  144. </div>
  145. </div>
  146. <?php busiprof_service_content($busiprof_service_content); ?>
  147. <div class="clearfix"></div>
  148. <div class="col-md-12 col-xs-12">
  149. <div class="btn-wrap">
  150. <div class="services_more_btn">
  151. <?php if ($current_options['service_link_btn'] != '') { ?>
  152. <a href="<?php echo esc_url($current_options['service_link_btn']); ?>">
  153. <?php
  154. } if ($current_options['service_button_value'] != '') {
  155. echo esc_html($current_options['service_button_value']);
  156. ?></a>
  157. <?php } ?>
  158. </div>
  159. </div>
  160. </div>
  161. </div>
  162. </section>
  163. <?php
  164. }
  165.  
  166. function busiprof_slide_layout($busiprof_service_content) {
  167. $current_options = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  168. ?>
  169. <section id="section" class="service2 service">
  170. <div class="container">
  171. <div class="row">
  172. <div class="col-md-12">
  173. <div class="section-title">
  174. <?php if ($current_options['service_heading_one'] != '') { ?>
  175. <h1 class="section-heading"><?php echo wp_kses_post($current_options['service_heading_one']); ?></h1>
  176. <?php } if ($current_options['service_tagline'] != '') { ?>
  177. <p><?php echo esc_html($current_options['service_tagline']); ?></p>
  178. <?php } ?>
  179. </div>
  180. </div>
  181. </div>
  182. <?php busiprof_service_content($busiprof_service_content); ?>
  183. <div class="clearfix"></div>
  184. <div class="col-md-12 col-xs-12">
  185. <div class="btn-wrap">
  186. <div class="services_more_btn">
  187. <?php if ($current_options['service_link_btn'] != '') { ?>
  188. <a href="<?php echo esc_url($current_options['service_link_btn']); ?>">
  189. <?php
  190. } if ($current_options['service_button_value'] != '') {
  191. echo esc_html($current_options['service_button_value']);
  192. ?></a>
  193. <?php } ?>
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </section>
  199. <?php
  200. }
  201.  
  202.  
  203. function busiprof_default_layout($busiprof_service_content) {
  204. $current_options = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  205. ?>
  206. <section id="section" class="service">
  207. <div class="container">
  208. <div class="row">
  209. <div class="col-md-12">
  210. <div class="section-title">
  211. <?php if ($current_options['service_heading_one'] != '') { ?>
  212. <h1 class="section-heading"><?php echo wp_kses_post($current_options['service_heading_one']); ?></h1>
  213. <?php } if ($current_options['service_tagline'] != '') { ?>
  214. <p><?php echo esc_html($current_options['service_tagline']); ?></p>
  215. <?php } ?>
  216. </div>
  217. </div>
  218. </div>
  219. <?php busiprof_service_content($busiprof_service_content); ?>
  220. <div class="clearfix"></div>
  221. <div class="col-md-12 col-xs-12">
  222. <div class="btn-wrap">
  223. <div class="services_more_btn">
  224. <?php if ($current_options['service_link_btn'] != '') { ?>
  225. <a href="<?php echo esc_url($current_options['service_link_btn']); ?>">
  226. <?php
  227. } if ($current_options['service_button_value'] != '') {
  228. echo esc_html($current_options['service_button_value']);
  229. ?></a>
  230. <?php } ?>
  231. </div>
  232. </div>
  233. </div>
  234. </div>
  235. </section>
  236. <?php
  237. }
  238.  
  239. function busiprof_blink_layout($busiprof_service_content) {
  240. $current_options = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  241. ?>
  242. <section id="section" class="service3 service">
  243. <div class="container">
  244. <div class="row">
  245. <div class="col-md-12">
  246. <div class="section-title">
  247. <?php if ($current_options['service_heading_one'] != '') { ?>
  248. <h1 class="section-heading"><?php echo wp_kses_post($current_options['service_heading_one']); ?></h1>
  249. <?php } if ($current_options['service_tagline'] != '') { ?>
  250. <p><?php echo esc_html($current_options['service_tagline']); ?></p>
  251. <?php } ?>
  252. </div>
  253. </div>
  254. </div>
  255. <?php busiprof_service_content($busiprof_service_content); ?>
  256. <div class="clearfix"></div>
  257. <div class="col-md-12 col-xs-12">
  258. <div class="btn-wrap">
  259. <div class="services_more_btn">
  260. <?php if ($current_options['service_link_btn'] != '') { ?>
  261. <a href="<?php echo esc_url($current_options['service_link_btn']); ?>">
  262. <?php
  263. } if ($current_options['service_button_value'] != '') {
  264. echo esc_html($current_options['service_button_value']);
  265. ?></a>
  266. <?php } ?>
  267. </div>
  268. </div>
  269. </div>
  270. </div>
  271. </section>
  272. <?php
  273. }
  274. function busiprof_circle_layout($busiprof_service_content) {
  275. $current_options = wp_parse_args(get_option('busiprof_theme_options', array()), busiprof_theme_setup_data());
  276. ?>
  277. <section id="section" class="service1 service">
  278. <div class="container">
  279. <!-- Section Title -->
  280. <div class="row">
  281. <div class="col-md-12">
  282. <div class="section-title">
  283. <?php if ($current_options['service_heading_one'] != '') { ?>
  284. <h1 class="section-heading"><?php echo wp_kses_post($current_options['service_heading_one']); ?></h1>
  285. <?php } if ($current_options['service_tagline'] != '') { ?>
  286. <p><?php echo esc_html($current_options['service_tagline']); ?></p>
  287. <?php } ?>
  288. </div>
  289. </div>
  290. </div>
  291. <?php busiprof_service_content($busiprof_service_content); ?>
  292. <!-- /Section Title -->
  293. <div class="clearfix"></div>
  294. <div class="col-md-12 col-xs-12">
  295. <div class="btn-wrap">
  296. <div class="services_more_btn">
  297. <?php if ($current_options['service_link_btn'] != '') { ?>
  298. <a href="<?php echo esc_url($current_options['service_link_btn']); ?>">
  299. <?php
  300. } if ($current_options['service_button_value'] != '') {
  301. echo esc_html($current_options['service_button_value']);
  302. ?></a>
  303. <?php } ?>
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. </section>
  309. <?php
  310. }
  311.  
  312. /**
  313. * Get content for features section.
  314. *
  315. * @since 1.1.30
  316. * @access public
  317. * @param string busiprof_service_content Section content in json format.
  318. * @param bool $is_callback Flag to check if it's callback or not.
  319. */
  320. if(!function_exists('busiprof_service_content')){
  321. function busiprof_service_content($busiprof_service_content, $is_callback = false) {
  322. if (!$is_callback) {
  323. ?>
  324. <div class="row busiprof-features-content">
  325. <?php
  326. }
  327. if (!empty($busiprof_service_content)) {
  328. $allowed_html = array(
  329. 'br' => array(),
  330. 'em' => array(),
  331. 'strong' => array(),
  332. 'b' => array(),
  333. 'i' => array(),
  334. );
  335. $busiprof_service_content = json_decode($busiprof_service_content);
  336. foreach ($busiprof_service_content as $features_item) :
  337. $icon = !empty($features_item->icon_value) ? apply_filters('busiprof_translate_single_string', $features_item->icon_value, 'Features section') : '';
  338. $title = !empty($features_item->title) ? apply_filters('busiprof_translate_single_string', $features_item->title, 'Features section') : '';
  339. $text = !empty($features_item->text) ? apply_filters('busiprof_translate_single_string', $features_item->text, 'Features section') : '';
  340. $link = !empty($features_item->link) ? apply_filters('busiprof_translate_single_string', $features_item->link, 'Features section') : '';
  341. $image = !empty($features_item->image_url) ? apply_filters('busiprof_translate_single_string', $features_item->image_url, 'Features section') : '';
  342. $color = !empty($features_item->color) ? apply_filters('busiprof_translate_single_string', $features_item->color, 'Features section') : '';
  343. if (is_customize_preview() && !empty($features_item->color)) {
  344. $color = $features_item->color;
  345. }
  346. ?>
  347. <div class="col-md-3 col-sm-6 col-xs-12 service-box">
  348. <div class="post">
  349. <?php if ($features_item->choice == 'customizer_repeater_image') { ?>
  350. <?php if (!empty($image)) : ?>
  351. <?php if (!empty($link)) : ?>
  352. <a href="<?php echo esc_url($link); ?>">
  353. <?php endif; ?>
  354. <img class="services_cols_mn_icon"
  355. src="<?php echo esc_url($image); ?>" <?php if (!empty($title)) : ?> alt="<?php echo esc_attr($title); ?>" title="<?php echo esc_attr($title); ?>" <?php endif; ?> />
  356. <?php if (!empty($link)) : ?>
  357. </a>
  358. <?php endif; ?>
  359. <?php
  360. endif;
  361. }
  362. ?>
  363.  
  364. <?php if (!empty($link)) : ?>
  365. <a href="<?php echo esc_url($link); ?>">
  366. <?php endif; ?>
  367. <?php if ($features_item->choice == 'customizer_repeater_icon') { ?>
  368. <?php if (!empty($icon)) : ?>
  369. <div class="service-icon" <?php
  370. if (!empty($color)) {
  371. echo 'style="color:' . $color . '"';
  372. }
  373. ?>>
  374. <i class="fa <?php echo esc_attr($icon); ?>"></i>
  375. </div>
  376. <?php endif; ?>
  377. <?php } ?>
  378. <?php if (!empty($title)) : ?>
  379.  
  380. <div class="entry-header">
  381. <h4 class="entry-title"><?php echo esc_html($title); ?></h4>
  382. </div>
  383. <?php endif; ?>
  384. <?php if (!empty($link)) : ?>
  385. </a>
  386. <?php endif; ?>
  387. <?php if (!empty($text)) : ?>
  388.  
  389. <div class="entry-content">
  390. <p><?php echo wp_kses(html_entity_decode($text), $allowed_html); ?></p>
  391. </div>
  392.  
  393.  
  394. <?php endif; ?>
  395. </div>
  396. </div>
  397. <?php
  398. endforeach;
  399. } else {
  400. $colors = array('#e91e63', '#a01000', '#eded23', '#59327a');
  401.  
  402. $title = array(esc_html__('Quis Urna', 'webriti-companion'), esc_html__('Sit Amet Aliquet', 'webriti-companion'), esc_html__('Sed non massa', 'webriti-companion'), esc_html__('Velit Tempus', 'webriti-companion'));
  403. $icon = array('fa fa-laptop', 'fa fa-tasks', 'fa fa-thumbs-o-up', 'fa fa-life-ring');
  404. for ($i = 0; $i <= 3; $i++) {
  405. ?>
  406. <div class="col-md-3 col-sm-6 col-xs-12 service-box">
  407. <div class="post">
  408. <a href="#">
  409. <div class="service-icon" style="color:<?php echo esc_attr($colors[$i]); ?>">
  410. <i class="<?php echo esc_attr($icon[$i]); ?>"></i>
  411. </div>
  412. <div class="entry-header">
  413. <h4 class="entry-title"><?php echo esc_html($title[$i]); ?></h4>
  414. </div>
  415. </a>
  416. <div class="entry-content">
  417. <p><?php esc_html_e('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam volutpat pretium nulla, vitae molestie arcu dignissim in.', 'webriti-companion'); ?></p>
  418. </div>
  419. </div>
  420. </div>
  421. <?php
  422. }
  423. }
  424. if (!$is_callback) {
  425. ?>
  426. </div>
  427. <?php
  428. }
  429. }}
  430.  
  431. if (function_exists('webriti_busiprof_services')) {
  432. $section_priority = apply_filters('busiprof_section_priority', 11, 'webriti_busiprof_services');
  433. add_action('busiprof_home_template_sections', 'webriti_busiprof_services', absint($section_priority));
  434. add_action('after_setup_theme', 'busiprof_features_register_strings', 11);
  435. }
  436.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement