PluginProbe
WP Directory Kit / 1.3.1
WP Directory Kit v1.3.1
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 / shortcode-wdk-listing-field-label.php

shortcode-wdk-listing-field-label.php in WP Directory Kit 1.3.1, at shortcodes/shortcode-wdk-listing-field-label.php

48 lines 1.2 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 /*
8 * Widget [wdk-listing-field-label], show latest listings in list view
9 * atts list:
10 *
11 * field_id (int) - field id
12 * post_id (int) - post_id
13 *
14 * Layout path :
15 * get_template_directory().'/wpdirectorykit/shortcodes/views/shortcode-latest-listings-list.php'
16 * WPDIRECTORYKIT_PATH.'shortcodes/views/shortcode-latest-listings-list.php'
17 */
18
19 add_shortcode('wdk-listing-field-label', 'shortcode_wdk_listing_field_label');
20 function shortcode_wdk_listing_field_label($atts, $content){
21 $atts = shortcode_atts(array(
22 'id'=>NULL,
23 'field_id'=>'',
24 'post_id'=>'',
25 'enable_html'=>'',
26 ), $atts);
27 $data = array();
28
29 /* settings from atts */
30 $data['settings'] = $atts;
31 $data['id_element'] = '';
32
33 /* load css/js */
34
35 $WMVC = &wdk_get_instance();
36 $WMVC->model('listingfield_m');
37 $WMVC->model('listing_m');
38 $WMVC->load_helper('listing');
39
40 $data['field_label'] = '';
41 if(!empty($data['settings']['field_id'])) {
42 $data['field_label'] = wdk_field_label($data['settings']['field_id']);
43 }
44
45 return wdk_shortcodes_view('shortcode-wdk-listing-field-label', $data);
46 }
47
48 ?>