summaryrefslogtreecommitdiffstats
path: root/includes/giglogadmin-shortcodes.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2023-01-19 20:17:55 +0100
committerHarald Eilertsen <haraldei@anduin.net>2023-01-19 20:17:55 +0100
commitf499d9e657fe79e4413eec9e20ae13d616fac6f5 (patch)
tree616588346d0dc9337b2cd096cf2af7320dcc060f /includes/giglogadmin-shortcodes.php
parenta5a9bb640306a69ec8f9a3c3701c49f34d3e7ebc (diff)
downloadgigologadmin-f499d9e657fe79e4413eec9e20ae13d616fac6f5.tar.gz
gigologadmin-f499d9e657fe79e4413eec9e20ae13d616fac6f5.tar.bz2
gigologadmin-f499d9e657fe79e4413eec9e20ae13d616fac6f5.zip
Rename and restructure source files to conform to common namin schemes.
- Source files containing a class should only contain _one_ class. - Source files containing a class should be names class-[name of the class].php - Use dashes instead of underscores in file names. - Fix source file comments - Some nitpicking...
Diffstat (limited to 'includes/giglogadmin-shortcodes.php')
-rw-r--r--includes/giglogadmin-shortcodes.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/includes/giglogadmin-shortcodes.php b/includes/giglogadmin-shortcodes.php
new file mode 100644
index 0000000..5070a3e
--- /dev/null
+++ b/includes/giglogadmin-shortcodes.php
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Shortcodes for GiglogAdmin.
+ *
+ * @package giglogadmin
+ *
+ * SPDX-FileCopyrightText: 2022 Andrea Chirulescu <andrea.chirulescu@gmail.com>
+ * SPDX-FileCopyrightText: 2022 Harald Eilertsen <haraldei@anduin.net>
+ *
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+declare(strict_types=1);
+
+if ( ! function_exists( 'giglogadmin_shortcode_public' ) ) {
+
+ /**
+ * Shortcode that displays the public concert list.
+ *
+ * Usage: `[getconcerts]`
+ *
+ * This shortcode does not have any attributes.
+ */
+ function giglogadmin_shortcode_public() : string {
+ $c = new GiglogAdmin_ConcertsTable();
+ return $c->render();
+ }
+
+ add_shortcode( 'getconcerts', 'giglogadmin_shortcode_public' );
+}