PluginProbe
Posts Table with Search & Sort / 1.1.1
Posts Table with Search & Sort v1.1.1
1.4.13 trunk 1.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2 1.3 1.3.1 1.3.1-v2 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 All 40 releases
posts-data-table / includes / class-posts-data-table-shortcode.php

class-posts-data-table-shortcode.php in Posts Table with Search & Sort 1.1.1, at includes/class-posts-data-table-shortcode.php

42 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * This class handles the posts table shortcode registration.
5 *
6 * @package Posts_Data_Table
7 * @author Barn2 Media <info@barn2.co.uk>
8 * @license GPL-3.0
9 * @link https://barn2.co.uk
10 * @copyright 2016-2017 Barn2 Media Ltd
11 */
12 // Prevent direct file access
13 if ( !defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 class Posts_Data_Table_Shortcode {
18
19 private $shortcode = 'posts_data_table';
20
21 public function __construct() {
22 // Register shortcode
23 add_shortcode( $this->shortcode, array( $this, 'shortcode' ) );
24 }
25
26 /**
27 * Handles our posts data table shortcode.
28 *
29 * @param array $atts The shortcode attributes specified by the user.
30 * @param string $content The content between the open and close shortcode tags (not used)
31 * @return string The shortcode output
32 */
33 public function shortcode( $atts, $content = '' ) {
34 // Parse attributes
35 $atts = shortcode_atts( Posts_Data_Table_Simple::$default_args, $atts, $this->shortcode );
36
37 // Create table and return output
38 $table = new Posts_Data_Table_Simple();
39 return $table->get_table( $atts );
40 }
41
42 }