PluginProbe
WP Directory Kit / 1.1.0
WP Directory Kit v1.1.0
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / shortcodes / shortcodes-init.php

shortcodes-init.php in WP Directory Kit 1.1.0, at shortcodes/shortcodes-init.php

53 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly.
5 }
6
7 // Shortcodes
8 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-latest-listings-list.php';
9 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value.php';
10 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value-text.php';
11 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value-suffix.php';
12 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value-prefix.php';
13 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-label.php';
14
15 function wdk_shortcodes_view($view_file = '', $element = '', $print = false)
16 {
17 if(empty($view_file)) return false;
18 $file = false;
19 if(is_child_theme() && file_exists(get_stylesheet_directory().'/wpdirectorykit/elementor-elements/views/'.$view_file.'.php'))
20 {
21 $file = get_stylesheet_directory().'/wpdirectorykit/elementor-elements/views/'.$view_file.'.php';
22 }
23 elseif(file_exists(get_template_directory().'/wpdirectorykit/shortcodes/views/'.$view_file.'.php'))
24 {
25 $file = get_template_directory().'/wpdirectorykit/shortcodes/views/'.$view_file.'.php';
26 }
27 elseif(file_exists(WPDIRECTORYKIT_PATH.'shortcodes/views/'.$view_file.'.php'))
28 {
29 $file = WPDIRECTORYKIT_PATH.'shortcodes/views/'.$view_file.'.php';
30 }
31
32 if($file)
33 {
34 extract($element);
35 if($print) {
36 include $file;
37 } else {
38 ob_start();
39 include $file;
40 return ob_get_clean();
41 }
42 }
43 else
44 {
45 if($print) {
46 echo 'View file not found in: '.esc_html($file);
47 } else {
48 return 'View file not found in: '.$file;
49 }
50 }
51 }
52
53 ?>