* @license GPL-3.0 * @link https://barn2.co.uk * @copyright 2016-2018 Barn2 Media Ltd */ class Posts_Data_Table_Shortcode { const SHORTCODE = 'posts_data_table'; public static function register_shortcode() { add_shortcode( self::SHORTCODE, array( __CLASS__, 'do_shortcode' ) ); } /** * Handles our posts data table shortcode. * * @param array $atts The shortcode attributes specified by the user. * @param string $content The content between the open and close shortcode tags (not used) * @return string The shortcode output */ public static function do_shortcode( $atts, $content = '' ) { // Parse attributes $atts = shortcode_atts( Posts_Data_Table_Simple::$default_args, $atts, self::SHORTCODE ); // Create table and return output $table = new Posts_Data_Table_Simple(); return $table->get_table( $atts ); } }