Add instructions for shortcodes
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 12 Nov 2015 19:50:58 +0000 (14:50 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 12 Nov 2015 19:50:58 +0000 (14:50 -0500)
controllers/admin.php

index b005903..e19840d 100644 (file)
@@ -17,6 +17,38 @@ class glm_coupon_admin
         $this->pluginDirName = $path;
         $this->wpdb = $wpdb;
         $coupons = new glm_coupons_coupon($path);
+        add_action('admin_menu', array($this, 'add_coupon_menus'));
+    }
+
+    public function add_coupon_menus()
+    {
+        add_submenu_page(
+            'edit.php?post_type=' . GLM_COUPON_POST_TYPE,
+            'shortcodes',
+            'Shortcodes',
+            'edit_posts',
+            'shortcodes',
+            array($this, 'get_shortcode_inst')
+        );
+    }
+
+    public function get_shortcode_inst()
+    {
+        echo '<div class="wrap">';
+        echo '<h1>Coupons</h1>';
+        echo '<h2>Shortcodes Reference</h2>';
+        echo '<p>Listed below are the shortcodes that may be used in a page within the website.</p>';
+        echo '<table width="600">
+                <tr>
+                    <th>Shortcode</th>
+                    <th>Description</th>
+                </tr>
+                <tr>
+                    <td align="center">[glmcoupons]</td>
+                    <td align="center">Display a search form and the coupons.</td>
+                </tr>
+                </table>';
+        echo '</div>';
     }
 
     /**