From: laury Date: Mon, 6 Jun 2016 20:28:23 +0000 (-0400) Subject: Added helper function, fixed class reference in req.page creation X-Git-Tag: v2.0.6^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a33f341a33768c0b41100727539e3f805cfb092c;p=WP-Plugins%2Fglm-member-db.git Added helper function, fixed class reference in req.page creation --- diff --git a/index.php b/index.php index 565e7daa..7cae71d2 100644 --- 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 + * @author Gaslight Media * @license http://www.gaslightmedia.com Gaslightmedia - * @version 2.0.2 + * @version 2.0.6 */ /* diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 61da0334..ce68039c 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -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 'after' => '', // after each link @@ -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 diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 7c97e41d..9f9438eb 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -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,