Title: Hard code the button
Last modified: August 20, 2016

---

# Hard code the button

 *  Resolved [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/)
 * Hi!
 * I want to use this plugin, but I need to hardcode the button where I wan’t it
   to appear.
 * Can you help me on this?
 * Also, it does generates some notices, undefined indexes in settings. On a multisite
   with 3.5.1.
 * Thank you!
 * [http://wordpress.org/extend/plugins/join-my-multisite/](http://wordpress.org/extend/plugins/join-my-multisite/)

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

 *  Plugin Author [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437474)
 * *ponder* you can just make a link or any button you want and have it point to
   the join page. Would a Shortcodes help? I could slip that in probably.
 * I have a fix in my test bed for the notices, and I was just being distracted 
   and forgot to upload it. 🙂 thanks for reminding me.
 *  Thread Starter [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437487)
 * Aha, I was thinking about that actually after I’ve checked the widget.php. I 
   don’t need a shortcode for that.
 * So the plugin handles the logged in user id who visits the url and all that? 
   Cause that would be great!
 * And for this I am trying to figure out how to display all the users with a subscription-
   level on a page.
 * Got this now, but it lists all users of the entire network.
 *     ```
       function contributors() {
        global $wpdb;
   
        	$authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name");
   
       	 foreach($authors as $author) {
       	 	$blogs = get_blogs_of_user( $author->ID );
       	 	     if($blogs) {
       	 	     	 foreach ( $blogs as $blog ) {
       	 	         echo '<li><a href="'. $blog->siteurl .'" class="ttip-bottom" data-original-title="'. get_the_author_meta('display_name', $author->ID) .'">';
       	 	         echo get_avatar($author->ID, 64);
       	 	         echo "</a></li>";
       	 			}
       	 	     }
       	 }
        }
       ```
   
 *  Plugin Author [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437569)
 * > So the plugin handles the logged in user id who visits the url and all that?
   > Cause that would be great!
 * I’m not sure what you’re asking. Do you mean does it know the difference between
   a logged in user and a logged out user, and a user who’s a member and one who’s
   not? It should!
 * > And for this I am trying to figure out how to display all the users with a 
   > subscription-level on a page.
 * per site or for the whole network?
 *  Thread Starter [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437577)
 * Sorry for that!
    Yes, I wondered if the plugin handled all the other parts (the
   ifs and elses and all).
 * Yes, as I said, that piece of code I got lists the entire networks users.
 * I want that to output all the users with a subscriber-level registered to a site(
   so the site admin and superadmins don’t appear in it).
 * So what’s needed is the correct get_results arguments so it finds out which site
   it’s on.
 *  Plugin Author [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437597)
 * The plugin should handle all the ifs and elses 🙂 I pushed a new version today
   with fixes for the warnings.
 * You should be able to use get_users for that call: [http://codex.wordpress.org/Function_Reference/get_users](http://codex.wordpress.org/Function_Reference/get_users)
 *  Thread Starter [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437641)
 * get_users worked like a charm!
 * Thank you!
 *  Thread Starter [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437642)
 * It seems I can’t get it to work properly.
 * I’ve network activated the plugin, and visited the settings page on the subsite
   to save the settings. Then I’ve added a user that’s not connected to the subsite.
 * But when I click the following button:
    `<a href="?jmm-join-site" id="join-site"
   class="btn btn-inverse">Phrase here</a>` Nothing happens, did I misunderstand
   the href part?
 *  Plugin Author [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437647)
 * The link should be to your registration page.
 * So if you made it domain.com/register/ then you link to that.
 *  Thread Starter [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437648)
 * Sorry, I am not getting this at all now.
 * So the user will have to sign up using the registration page?
 *  Plugin Author [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437658)
 * Let’s step back 🙂
 * The original question was “I want to use this plugin, but I need to hardcode 
   the button where I wan’t it to appear.”
 * Where are you now with this? How are you trying to get the button to show and
   where?
 *  Thread Starter [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437659)
 * Ok, I will try to explain.
 * 1. I am on this “users” blog. Let’s call it site A.
    2. When viewing this users
   profile, I want to have a button which says “Add me as friend” 3. On the profile
   I want to list a number of recently joined friends (subscribers).
 * So, number 3 works good with the get_users.
 * I thought that when a (logged in of site B) user clicked the button, it would
   a be added to site A as a subscriber, maybe through the query “?jmm-join-site”.
 * I’m using Gravity forms to sign up on the main sites homepage.
 *  Plugin Author [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 3 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437661)
 * Ah, okay. I think I get it.
 * I just tested this:
 *     ```
       <form action="?jmm-join-site" method="post" id="notmember">
           <input type="hidden" name="action" value="jmm-join-site">
           <input type="submit" value="Join This Site" name="join-site" id="join-site" class="button">
           </form>
       ```
   
 * It works as designed.
 * I made that into a shortcode `[join-this-site]` which should be available as 
   the dev version here: [http://wordpress.org/extend/plugins/join-my-multisite/developers/](http://wordpress.org/extend/plugins/join-my-multisite/developers/)(
   it’ll be version 1.4.1)
 * That should let you put the button where you want.
 *  Thread Starter [osby](https://wordpress.org/support/users/osby/)
 * (@osby)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437761)
 * Hi again Ipstenu!
 * Sorry, but I don’t think this is resolved yet. Not in the way I wan’t it at least
   🙂
 * So, here we go:
    I have site A and site B.
 * If site A visits site B (B has the join-setting to automatic) site A gets added
   as a subscriber. Works just like I want it to.
 * However, I wan’t site A to click a button on site B to actually join it as a 
   subscriber.
 * So, the plugin works good, but the button doesn’t work the way I need it to.
 * Thank you!
 *  Plugin Author [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [13 years, 1 month ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437765)
 * I don’t know how I missed this…
 * You want someone to click a button on Site A to add them to Site B? Users aren’t
   sites, but you seem to be using them interchangeably, which is VERY confusing
   to me.
 * > However, I wan’t site A to click a button on site B to actually join it as 
   > a subscriber.
 * Site A is a SITE. It can’t click on anything. If you’re saying you don’t want
   users to be auto-added to a site, but instead to click on a button to join a 
   specific site while visiting, that totally works.
 * If you have the join-setting to automatic, then you don’t get to ALSO have a 
   button. It’s either or.

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

The topic ‘Hard code the button’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/join-my-multisite_e0d5c8.svg)
 * [Join My Multisite](https://wordpress.org/plugins/join-my-multisite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/join-my-multisite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/join-my-multisite/)
 * [Active Topics](https://wordpress.org/support/plugin/join-my-multisite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/join-my-multisite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/join-my-multisite/reviews/)

 * 14 replies
 * 2 participants
 * Last reply from: [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/hard-code-the-button/#post-3437765)
 * Status: resolved