# wpdirectorykit/1.1.0/shortcodes/shortcodes-init.php

WP Directory Kit, version 1.1.0. 53 lines.

- Page: https://pluginprobe.com/plugins/wpdirectorykit/1.1.0/code/shortcodes/shortcodes-init.php
- Raw: https://pluginprobe.com/plugins/wpdirectorykit/1.1.0/raw/shortcodes/shortcodes-init.php
- Modified: 2022-11-24T13:50:28+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wpdirectorykit/1.1.0/code/shortcodes/shortcodes-init.php#L10-L20`.

```php
<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

// Shortcodes
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-latest-listings-list.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value-text.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value-suffix.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-value-prefix.php';
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'shortcodes/shortcode-wdk-listing-field-label.php';

function wdk_shortcodes_view($view_file = '', $element = '', $print = false)
{
    if(empty($view_file)) return false;
    $file = false;
    if(is_child_theme() && file_exists(get_stylesheet_directory().'/wpdirectorykit/elementor-elements/views/'.$view_file.'.php'))
    {
        $file = get_stylesheet_directory().'/wpdirectorykit/elementor-elements/views/'.$view_file.'.php';
    }
    elseif(file_exists(get_template_directory().'/wpdirectorykit/shortcodes/views/'.$view_file.'.php'))
    {
        $file = get_template_directory().'/wpdirectorykit/shortcodes/views/'.$view_file.'.php';
    }
    elseif(file_exists(WPDIRECTORYKIT_PATH.'shortcodes/views/'.$view_file.'.php'))
    {
        $file = WPDIRECTORYKIT_PATH.'shortcodes/views/'.$view_file.'.php';
    }

    if($file)
    {
        extract($element);
        if($print) {
            include $file;
        } else {
            ob_start();
            include $file;
            return ob_get_clean();
        }
    }
    else
    {
        if($print) {
            echo 'View file not found in: '.esc_html($file);
        } else {
            return 'View file not found in: '.$file;
        } 
    }
}

?>
```
