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-return-post-id.php

shortcode-wdk-return-post-id.php in WP Directory Kit 1.3.1, at shortcodes/shortcode-wdk-return-post-id.php

36 lines 750 B
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-return-post-id], show latest listings in list view
9 * atts list:
10 *
11 */
12
13 add_shortcode('wdk-return-post-id', 'shortcode_wdk_return_post_id');
14 function shortcode_wdk_return_post_id($atts, $content){
15 $atts = shortcode_atts(array(
16 'id'=>NULL,
17 ), $atts);
18 $data = array();
19
20 /* settings from atts */
21 $data['settings'] = $atts;
22 $data['id_element'] = '';
23
24 global $wdk_listing_result_id;
25 if(!empty($wdk_listing_result_id))
26 return $wdk_listing_result_id;
27
28 global $wdk_listing_id;
29 if(!empty($wdk_listing_id))
30 return $wdk_listing_id;
31
32 return get_the_ID();
33
34 }
35
36 ?>