Skip to content

Instantly share code, notes, and snippets.

@cartpauj
Last active January 20, 2026 22:48
Show Gist options
  • Select an option

  • Save cartpauj/26c89ee92965817eaa10 to your computer and use it in GitHub Desktop.

Select an option

Save cartpauj/26c89ee92965817eaa10 to your computer and use it in GitHub Desktop.

Revisions

  1. cartpauj revised this gist Jul 31, 2017. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions mepr-account-nav-example.php
    Original file line number Diff line number Diff line change
    @@ -12,8 +12,9 @@
    //COPY FROM THE LINE BELOW TO THE END, IF YOU PLAN TO PASTE THIS CODE INTO A THEME'S functions.php FILE OR INTO A PLUGIN LIKE My Custom Functions
    //ADD A SUPPORT TAB TO THE NAV MENU
    function mepr_add_some_tabs($user) {
    $support_active = (isset($_GET['action']) && $_GET['action'] == 'premium-support')?'mepr-active-nav-tab':'';
    ?>
    <span class="mepr-nav-item prem-support">
    <span class="mepr-nav-item premium-support <?php echo $support_active; ?>">
    <a href="/account/?action=premium-support">Premium Support</a>
    </span>
    <?php
    @@ -22,7 +23,6 @@ function mepr_add_some_tabs($user) {

    //YOU CAN DELETE EVERYTHING BELOW THIS LINE -- IF YOU PLAN TO REDIRECT
    //THE USER TO A DIFFERENT PAGE INSTEAD OF KEEPING THEM ON THE SAME PAGE

    //ADD THE CONTENT FOR THE NEW SUPPORT TAB ABOVE
    function mepr_add_tabs_content($action) {
    if($action == 'premium-support'): //Update this 'premium-support' to match what you put above (?action=premium-support)
  2. cartpauj revised this gist Jun 7, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions mepr-account-nav-example.php
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@
    Copyright: 2004-2013, Caseproof, LLC
    */

    //COPY FROM THE LINE BELOW TO THE END, IF YOU PLAN TO PASTE THIS CODE INTO A THEME'S functions.php FILE OR INTO A PLUGIN LIKE My Custom Functions
    //ADD A SUPPORT TAB TO THE NAV MENU
    function mepr_add_some_tabs($user) {
    ?>
  3. cartpauj revised this gist May 23, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions mepr-account-nav-example.php
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,9 @@ function mepr_add_some_tabs($user) {
    }
    add_action('mepr_account_nav', 'mepr_add_some_tabs');

    //YOU CAN DELETE EVERYTHING BELOW THIS LINE -- IF YOU PLAN TO REDIRECT
    //THE USER TO A DIFFERENT PAGE INSTEAD OF KEEPING THEM ON THE SAME PAGE

    //ADD THE CONTENT FOR THE NEW SUPPORT TAB ABOVE
    function mepr_add_tabs_content($action) {
    if($action == 'premium-support'): //Update this 'premium-support' to match what you put above (?action=premium-support)
  4. cartpauj revised this gist Mar 12, 2015. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions mepr-account-nav-example.php
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ function mepr_add_some_tabs($user) {

    //ADD THE CONTENT FOR THE NEW SUPPORT TAB ABOVE
    function mepr_add_tabs_content($action) {
    if($action == 'premium-support'):
    if($action == 'premium-support'): //Update this 'premium-support' to match what you put above (?action=premium-support)
    ?>
    <div id="custom-support-form">
    <form action="" method="post">
    @@ -40,4 +40,5 @@ function mepr_add_tabs_content($action) {
    </div>
    <?php
    endif;
    }
    }
    add_action('mepr_account_nav_content', 'mepr_add_tabs_content');
  5. Paul created this gist Feb 17, 2014.
    43 changes: 43 additions & 0 deletions mepr-account-nav-example.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    <?php
    /*
    Plugin Name: MemberPress Account Page Nav
    Plugin URI: http://www.memberpress.com/
    Description: Allows developers to add more nav menu links/pages to their members account page
    Version: 1.0.0
    Author: Caseproof, LLC
    Author URI: http://caseproof.com/
    Copyright: 2004-2013, Caseproof, LLC
    */

    //ADD A SUPPORT TAB TO THE NAV MENU
    function mepr_add_some_tabs($user) {
    ?>
    <span class="mepr-nav-item prem-support">
    <a href="/account/?action=premium-support">Premium Support</a>
    </span>
    <?php
    }
    add_action('mepr_account_nav', 'mepr_add_some_tabs');

    //ADD THE CONTENT FOR THE NEW SUPPORT TAB ABOVE
    function mepr_add_tabs_content($action) {
    if($action == 'premium-support'):
    ?>
    <div id="custom-support-form">
    <form action="" method="post">
    <label for="subject">Enter Subject:</label><br/>
    <input type="text" name="subject" id="subject" />

    <br/><br/>

    <label for="content">Enter Content:</label><br/>
    <input type="text" name="content" id="content" />

    <br/><br/>

    <input type="submit" name="premium-support-submit" value="Submit" />
    </form>
    </div>
    <?php
    endif;
    }