Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hide button created by premium plugin


  • LaurieDugdale
    Participant

    @lauriedugdale

    Hi

    I have a plugin called BP-WP Profile Reviews it works great however I need to change it slightly so that it doesn’t display the “add review” button when the user is viewing their own profile.

    Is there a way to hide this element with css or is there some simple php that i could put in a file somewhere that would hide the element? My knowledge of php is incredibly limited.

    An example of a profile can be seen here ( http://cultexposure.com/members-site/cultexposure/ )

    Any help would be greatly appreciated!

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

  • shanebp
    Moderator

    @shanebp

    That is a premium plugin – you should ask the plugin author or whoever you paid for support.

    What you want should be simple to do – but unless somebody here has also paid for that plugin, nobody will be able to give you a definitive answer.


    LaurieDugdale
    Participant

    @lauriedugdale

    unfortunately it seems the plugin author isnt a programmer? and was unable to help. I was wondering if there was a simple fix maybe a quick and simple conditional that I can use? something that sets the element to “display: none;” ?


    LaurieDugdale
    Participant

    @lauriedugdale

    After a lot of reading and playing around I turned this code

    
        function prorevs_member_header() {
                if ($GLOBALS['bp']->current_component == "reviews") {
                    return false;
                } else {
                    ?>
                    <div class="generic-button">
                        <a title="Add reviews for this user."
                           href="<?php echo bp_get_displayed_user_link() ?>reviews/">Add Review</a>
                    </div>
                    <?php
                }
            }
        }
    

    into this

    
        function prorevs_member_header() {
            if ( bp_is_my_profile() == 1 ) {
                echo "";
            } else {
                if ($GLOBALS['bp']->current_component == "reviews") {
                    return false;
                } else {
                    ?>
                    <div class="generic-button">
                        <a title="Add reviews for this user."
                           href="<?php echo bp_get_displayed_user_link() ?>reviews/">Add Review</a>
                    </div>
                    <?php
                }
            }
        }
    

    It seems to work well. Is there a better way of doing it?


    shanebp
    Moderator

    @shanebp

    Is there a better way of doing it?

    If we don’t have that plugin, we don’t know if there is a better way.
    If that code is working for you, great.

    bp_is_my_profile() returns a boolean value. So all you need is:

    if ( bp_is_my_profile() ) {


    LaurieDugdale
    Participant

    @lauriedugdale

    Brilliant will remove the extra fluff.

    Thanks for the help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hide button created by premium plugin’ is closed to new replies.
Skip to toolbar