Support » Plugin: Membership 2 » show_moretag_protection on single posts only

  • Resolved Chris Van Patten


    I’m using Membership Lite (latest version as of this post), and specifically the ability to hide content after a “more tag” to non-members.

    I’ve set up the text I want to show to non-members in the “Options > Content Protection > No access message” area, and that works fine.

    My problem is that this “No access message” displays on archive pages and my site’s front page. I’d prefer that archive pages and blog pages look completely identical for registered and non-registered users, but Single posts display the message as appropriate.

    I’ve hacked this into place myself, in the file membership/membershipincludes/classes/membershippublic.php. Line 135 originally read:

    add_filter('the_content_more_link', array(&$this, 'show_moretag_protection'), 99, 2);

    I’ve just added a conditional around that:

    if ( is_single() ) {
    add_filter('the_content_more_link', array(&$this, 'show_moretag_protection'), 99, 2);

    This fix makes the “more tag” capability work as desired.

    Obviously though, editing the plugin directly is (to put it mildly) not ideal. So my question, I suppose, is this: is there a hook I can use to override the show_moretag_protection function, or is this a feature that could be added to the plugin? There could be a checkbox option that says “Show ‘No access message’ on single posts only”, or something to that effect.

    Thanks in advance for the help!

Viewing 1 replies (of 1 total)
  • Mike


    WPMU DEV Support Staff

    Hi @chris Van Patten

    This isn’t something that is configurable but I’ll mention it to the developer.

    Instead of modifying the plugin files, how about adding a remove_filter and re-declaring it in your functions.php, this means that you won’t lose the change when updating.

Viewing 1 replies (of 1 total)
  • The topic ‘show_moretag_protection on single posts only’ is closed to new replies.