how to get meta name for onclick event
-
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’;”>All Groups</button>
<button onclick=”location.href=’https://abc.com/groups/create/step/group-details/’;”>Create Group</button>
<button onclick=”location.href=’https://abc.com/members’;”>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/’ + 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.