Skip to content

Instantly share code, notes, and snippets.

@bekarice
Last active February 5, 2022 21:52
Show Gist options
  • Select an option

  • Save bekarice/62cc848397fdedb02cfe to your computer and use it in GitHub Desktop.

Select an option

Save bekarice/62cc848397fdedb02cfe to your computer and use it in GitHub Desktop.

Revisions

  1. bekarice revised this gist Jan 20, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion wc-memberships-remove-my-memberships.php
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@
    */
    function sv_remove_my_memberships_table() {
    if ( function_exists( 'wc_memberships' ) && ! is_admin() ) {
    remove_action( 'woocommerce_before_my_account', array( wc_memberships()->get_frontend_instance()->get_member_area_instance(), 'my_account_memberships' ) );
    remove_action( 'woocommerce_before_my_account', array( wc_memberships()->get_frontend_instance()->get_members_area_instance(), 'my_account_memberships' ) );
    }
    }
    add_action( 'init', 'sv_remove_my_memberships_table', 50 );
  2. bekarice revised this gist Jun 8, 2016. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions wc-memberships-remove-my-memberships.php
    Original file line number Diff line number Diff line change
    @@ -1,11 +1,11 @@
    <?php
    <?php // Only copy this line if needed

    /**
    * Only copy the opening php tag if needed
    * Removes the "My Memberships" table from my account area
    */
    function sv_remove_my_memberships_table() {
    if ( function_exists( 'wc_memberships' ) ) {
    remove_action( 'woocommerce_before_my_account', array( wc_memberships()->frontend, 'my_account_memberships' ) );
    if ( function_exists( 'wc_memberships' ) && ! is_admin() ) {
    remove_action( 'woocommerce_before_my_account', array( wc_memberships()->get_frontend_instance()->get_member_area_instance(), 'my_account_memberships' ) );
    }
    }
    add_action( 'init', 'sv_remove_my_memberships_table' );
    add_action( 'init', 'sv_remove_my_memberships_table', 50 );
  3. bekarice created this gist Aug 26, 2015.
    11 changes: 11 additions & 0 deletions wc-memberships-remove-my-memberships.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?php
    /**
    * Only copy the opening php tag if needed
    * Removes the "My Memberships" table from my account area
    */
    function sv_remove_my_memberships_table() {
    if ( function_exists( 'wc_memberships' ) ) {
    remove_action( 'woocommerce_before_my_account', array( wc_memberships()->frontend, 'my_account_memberships' ) );
    }
    }
    add_action( 'init', 'sv_remove_my_memberships_table' );