* 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
*
* @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
*/
/*
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>
));
}
}
-
-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
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,