Skip to:
Content
Pages
Categories
Search
Top
Bottom

how to get meta name for onclick event


  • kt206
    Participant

    @kt206

    I am currently trying to add a button that redirects to ‘https://abc.com/members/metaname/widgets/’, I have made this edit in ~/wp-content/plugins/youzify/includes/public/templates/members/single/activity.php

    I currently made the edit at the top of this page like so

    <div >
    <body>
    <button id=”to_showroom” onclick=”showroom()”>Edit Showroom

    </button>
    <button onclick=”location.href=’https://abc.com/groups&#8217;;”>All Groups

    </button>
    <button onclick=”location.href=’https://abc.com/groups/create/step/group-details/&#8217;;”>Create Group

    </button>

    <button onclick=”location.href=’https://abc.com/members&#8217;;”>All Members

    </button>
    <script>
    function showroom() {
    var meta_name = <?php echo youzify_get_md_user_meta( bp_get_member_user_id() ); ?>;

    location.href=’https://abc.com/members/&#8217; + meta_name + ‘/widgets/about_me’;
    }

    </script>
    </body>

    </div>

    after updating this file and clicking the ‘Edit Showroom’ button on the page I get the following error ‘Uncaught ReferenceError: showroom is not defined at HTMLButtonElement.onclick ((index):686)’.

    I would like to know what is the proper way of handling this, if one exists.
    Thank you

  • You must be logged in to reply to this topic.
Skip to toolbar