Support » Plugin: Paid Memberships Pro » How you can add custom HTML?

  • Resolved kingteamdunet

    (@kingteamdunet)


    Hi,

    How you can add custom HTML code to add our markup for the pop-up window.
    How you can use our HTML code in the message for disconnected users ?

    https://img4.hostingpics.net/pics/976520201711111919.png

    Actually, there should be allowed this attribute data-reveal-id with this value login_panel

    Also provide an example of HTML that you want to render there but it’s stripped

    <ul class="button-group radius right">
    							
    								<li class="header-login-button">
    									<a href="#" data-reveal-id="login_panel" class="tiny secondary button radius">
    										<i class="icon-user hide-for-medium-down"></i>
    										LOG IN									</a>
    								</li>
    								
    																	<li class="header-register-button">
    										<a href="#" data-reveal-id="register_panel" class="tiny button radius">
    											<i class="icon-group hide-for-medium-down"></i>
    											Sign-up										</a>
    									</li>
    															
    													</ul>

    We installed the PMPro Customizations plugin
    and integrate our html code on it.
    This does not work because there is your plugin that will strip the tags needed for the pop-up to work.

    pmpro-customizations/pmpro-customizations.php

    <?php
    /*
    Plugin Name: PMPro Customizations
    Plugin URI: https://www.paidmembershipspro.com/wp/pmpro-customizations/
    Description: Customizations for my Paid Memberships Pro Setup
    Version: .1
    Author: Paid Memberships Pro
    Author URI: https://www.paidmembershipspro.com
    */
     
    //Now start placing your customization code below this line
    function my_pmpro_not_logged_in_text_filter($text) {
        global $post;
    
        $access = pmpro_has_membership_access($post->ID, NULL, true);
        $level_ids = $access[1];
    
        if(is_array($level_ids) && in_array(2, $level_ids))
        {
            $text = '<ul class="button-group radius right">
    
    <li class="header-login-button">
        <a href="#">
            <i class="icon-user hide-for-medium-down"></i> LOG IN </a>
    </li>
    
    <li class="header-register-button">
        <a href="#">
            <i class="icon-group hide-for-medium-down"></i> SIGN UP </a>
    </li>
    
    </ul>';
        }
        elseif(is_array($level_ids) && in_array(4, $level_ids) && !in_array(3, $level_ids) )
        {
            $text = '<ul class="button-group radius right">
    
    <li class="header-login-button">
        <a href="#">
            <i class="icon-user hide-for-medium-down"></i> LOG IN </a>
    </li>
    
    <li class="header-register-button">
        <a href="#">
            <i class="icon-group hide-for-medium-down"></i> SIGN UP </a>
    </li>
    
    </ul>';
        }
        else
        {
            $text = '<ul class="button-group radius right">
    
    <li class="header-login-button">
        <a href="#">
            <i class="icon-user hide-for-medium-down"></i> LOG IN </a>
    </li>
    
    <li class="header-register-button">
        <a href="#">
            <i class="icon-group hide-for-medium-down"></i> SIGN UP </a>
    </li>
    
    </ul>';
        }
    
        return $text;
    }
    add_filter("pmpro_not_logged_in_text_filter", "my_pmpro_not_logged_in_text_filter", 5);

    Thank you

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Andrew

    (@andrewza)

    Hi there,

    Thank you for using Paid Memberships Pro.

    We have removed some HTML code from being displayed in this for security reasons, I have implemented your code onto my local environment and it’s working as intended.

    For clarification, the messages for non-members replace restricted content/excerpts with text and signup buttons. These do not display in a pop-up on a post/page that is restricted.

    Here is the source code from my local environment, here is an image – https://s17.postimg.org/u0lg2k4u7/Screen_Shot_2017-11-16_at_08.37.59.png

    I hope this clears things up, please let me know what HTML is being stripped from your custom code above.

    • This reply was modified 4 weeks, 1 day ago by  Andrew.

    Hi,

    On our site the code here does not work, no popup and open when I click on it to connect to see the contents etc ….
    The code on the page pmpro-customizations.php is correct?

    The text and registration buttons in a pop-up window on an article or page with restricted access. Does not work?

    Thank you

    Plugin Author Andrew

    (@andrewza)

    Is your website using a page builder?

    If so your page builder may be overwriting the restriction check Paid Memberships Pro uses, here is documentation that may help – https://www.paidmembershipspro.com/filter-members-only-content-later-for-page-builders-and/

    The restriction message does not show in a pop-up form but replaces content, the code you have sent through looks correct as I tested it on my site.

    Are you saying that restricted content is not being restricted?

    • This reply was modified 4 weeks, 1 day ago by  Andrew.

    Yes page generator
    We tested with and without page generator

    The text and record buttons in a pop-up window do not work
    No pop-up window and open when I click “connect” to see the restricted content.

    Plugin Author Andrew

    (@andrewza)

    Please can you share your website URL with me here to a page in question.

    The restricted post message does not pop-up but rather replaces the excerpt/page content with the message.

    Are you trying to make this message for non-members to show in a pop-up? If so are you trying to use JavaScript to show this message in a pop-up (if so, you may need to add your JavaScript to your site’s header/footer in order for this to work).

    • This reply was modified 4 weeks, 1 day ago by  Andrew.

    Send me your email

    Plugin Author Andrew

    (@andrewza)

    Please can you open a support thread or send an email (via our contact form) on https://www.paidmembershipspro.com and include as much detail as possible as to what the issue is and what you are trying to achieve as pop-up functionality will require quite a bit of custom code to achieve.

    • This reply was modified 4 weeks, 1 day ago by  Andrew.

    send me the custom code.

    Plugin Author Travis

    (@travislima)

    Hi @kingteamdunet,

    Please get in touch with us via our contact form here: https://www.paidmembershipspro.com/contact/

    We will see what we can do to help you solve this.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.