Join our new community forum for support & discussion

Join Now

Home Support Extensions Memberships Question about: Membership extension hiding attributes

Question about: Membership extension hiding attributes

  • Author
    Posts
  • Peter John

    @ihor, I recently purchased the Membership extension for our HivePress Theme and I am working on getting it set up. I am able to hide the attribute perfectly fine. Is there a way to associate every account by default with a plan, without the user manually subscribing to it?

    What I am looking to achieve is that no public visitor can see this specific field, but once logged in with an account they can see the field(without the need to select a plan first).

    Thank you!

    ihor developer

    Thanks for purchasing! There’s no such option yet, but you can use this code snippet as a temporary fix:

    add_action(
    	'init',
    	function() {
    		if ( is_user_logged_in() && hivepress()->get_version( 'memberships' ) ) {
    			remove_filter( 'hivepress/v1/models/listing/fields', [ hivepress()->membership, 'hide_listing_fields' ], 150, 2 );
    			remove_filter( 'hivepress/v1/models/vendor/fields', [ hivepress()->membership, 'hide_vendor_fields' ], 150, 2 );
    		}
    	}
    );

    It will display hidden attributes if the user is logged in, it doesn’t require selecting a membership.

    Peter John

    It works! Many thanks.

    One last question about this topic. How can I change revealed into ”View Code”. I already tried to change it with Loco Translate but it doesn’t working.

    ihor developer

    Please make sure that the language you added matches the WordPress language on your site, changing the “Reveal” word via Loco Translate/Plugins/HivePress Memberships should work.

    Peter John

    Perfect! It works now.

Viewing 5 posts - 1 through 5 (of 5 total)

New Reply

This forum has been archived and is no longer accepting new posts or replies. Please join our new community forum for support & discussion.