Added helper function, fixed class reference in req.page creation
authorlaury <laury@gaslightmedia.com>
Mon, 6 Jun 2016 20:28:23 +0000 (16:28 -0400)
committerlaury <laury@gaslightmedia.com>
Mon, 6 Jun 2016 20:28:23 +0000 (16:28 -0400)
index.php
setup/adminHooks.php
setup/frontHooks.php

index 565e7da..7cae71d 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Database
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Gaslight Media Members Database.
- * Version: 2.0.5
+ * Version: 2.0.6
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -17,9 +17,9 @@
  *
  * @category glmWordPressPlugin
  * @package glmMembersDatabase
- * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @author Gaslight Media <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 2.0.2
+ * @version 2.0.6
  */
 
 /*
index 61da033..ce68039 100644 (file)
@@ -91,9 +91,9 @@ if ( ! function_exists( 'glm_theme_members_only_menu' ) && function_exists('Glm_
     function glm_theme_members_only_menu() {
         wp_nav_menu(array(
             'container' => false,                           // remove nav container
-            'container_class' => 'members-only1',                        // class of container
+            'container_class' => 'members-only',                        // class of container
             'menu' => '',                                   // menu name
-            'menu_class' => 'members-only2',                             // adding custom nav class
+            'menu_class' => 'members-only',                             // adding custom nav class
             'theme_location' => 'members-only',             // where it's located in the theme
             'before' => '',                                 // before each link <a>
             'after' => '',                                  // after each link </a>
@@ -105,16 +105,5 @@ if ( ! function_exists( 'glm_theme_members_only_menu' ) && function_exists('Glm_
         ));
     }
 }
-
-add_filter( 'login_redirect', 'dashboard_redirect' );
-function dashboard_redirect( $url ) {
-    if ( current_user_can( 'glm_members_member' ) ) {
-         $url = esc_url( admin_url( 'admin.php?page=glm-members-admin-menu-member' ) );
-    } else {
-        $url = 'http://www.google.com';
-    }
-
-    return $url;
-}    
-
 ?>
\ No newline at end of file
index 7c97e41..9f9438e 100644 (file)
@@ -106,13 +106,28 @@ if (!function_exists('get_id_by_slug')) {
     function get_id_by_slug($page_slug) {
        $page = get_page_by_path($page_slug);
        if ($page) {
-               return $page->ID;
+            return $page->ID;
        } else {
-               return null;
+            return null;
        }
     }
 }
 
+/*
+ * This function makes it easier to grab page content of any page by using the 
+ * page ID, which WP does not natively do.
+ */
+if (!function_exists('get_post_page_content')) {
+    function get_post_page_content( $id ) {
+        $the_query = new WP_Query( 'page_id='.$id );
+        while ( $the_query->have_posts() ) {
+            $the_query->the_post();
+            the_content();
+        }
+        wp_reset_postdata();
+    }
+}
+
 /*
  * This function will make any page that is under the Members Only page
  *  (derived from an option) use the members only template when displaying,