diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2023-01-29 13:35:44 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2023-01-29 13:35:44 +0100 |
commit | 3aa6c640bbdcd0fa7e3a396721d4170e797eb765 (patch) | |
tree | 92cd3289233870a816de083552e00dbb3c9cebbb /includes/giglogadmin-shortcodes.php | |
parent | c2354e7397f44998691dfe8241e49c5a65f66dcc (diff) | |
download | gigologadmin-3aa6c640bbdcd0fa7e3a396721d4170e797eb765.tar.gz gigologadmin-3aa6c640bbdcd0fa7e3a396721d4170e797eb765.tar.bz2 gigologadmin-3aa6c640bbdcd0fa7e3a396721d4170e797eb765.zip |
Make the shortcode to display concerts nicer.
Does not currently have the filtering options that the old code had, but
the presentation is much nicer. Also the code is way simpler.
Should be able to reuse this for the concert listing in the backend, but
I'm leaving that alone for now.
Diffstat (limited to 'includes/giglogadmin-shortcodes.php')
-rw-r--r-- | includes/giglogadmin-shortcodes.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/includes/giglogadmin-shortcodes.php b/includes/giglogadmin-shortcodes.php index 5070a3e..69f46c4 100644 --- a/includes/giglogadmin-shortcodes.php +++ b/includes/giglogadmin-shortcodes.php @@ -22,8 +22,16 @@ if ( ! function_exists( 'giglogadmin_shortcode_public' ) ) { * This shortcode does not have any attributes. */ function giglogadmin_shortcode_public() : string { - $c = new GiglogAdmin_ConcertsTable(); - return $c->render(); + $opts = array( + 'offset' => 0, + 'recperpage' => 15, + ); + $concerts = GiglogAdmin_Concert::find_concerts( $opts ); + + ob_start(); + include __DIR__ . '/templates/giglogadmin-concerts-table.php'; + + return ob_get_clean(); } add_shortcode( 'getconcerts', 'giglogadmin_shortcode_public' ); |