How to Use Old PHP Code in Redux Framework
I've asked this a year or two ago, but I gave up and am now back at looking at ways to get this to work. I'd like to build a foreach loop that pulls the usergroup from a forum (external from WordPress) that allows a dropdown of the WordPress user roles.
Below is the old code, before changing over to Redux Framework.
$UGModel = $XF->getModelFromCache( 'XenForo_Model_UserGroup' );
$usergroups = $UGModel->getAllUserGroups();
foreach ($usergroups as $usergroup) {
$id = $usergroup['user_group_id'];
$title = $usergroup['title'];
echo '<table><tr><td width="75%">';
echo '<label for="xf_user_role_' . $id . '">';
echo $title . ' has role ';
echo '</td><td>';
echo '<select name="xf_user_role_' . $id . '" id="xf_user_role_' . $id . '">';
wp_dropdown_roles( $xf_options['xf_user_role'][ $id ] );
My PHP skills are weak, as I learn more and more each day, but would like some direction. I've looked at building an extension to Redux but with the new config am not totally sure on the steps.
You have a method render() in the custom field example extension. Is this where I'd begin to get the foreach loop to show in the Options Panel built by Redux Framework?
Sorry, but something this extensive falls under premium support. You could try posting to Stack Overflow or WordPress Stack Exchange if you're looking for free help.
To put in in another way, this extends beyond the scope of our project. We're willing to help related to our project. Outside of that, you will need to get help elsewhere or hire us to help find you a solution. ;)
After all, Redux is a labor of love and not a full-time job.
Hi
Maybe you missed it, but I paid for premium support ;)
I can dig up the PayPal payment if you need it. And yes - absolutely - would LOVE for the two of you to help on my project (for money!). Mine is also a labor of love but my knowledge only grows slowly ...
Strike that. This happened just as I became sick and see that the metabox purchase went through -- but the premium did NOT.
Egg on my face. OK. I'm taking care of it right now because the two of you deserve to be supported.
FYI, I'm all booked up until after xmas, mostly with not-work stuff. Busy time. :)
No problem. Just sent $200 and will gladly wait for when you are available. If you want, I can email you the plugin code so that you can take your time AFTER you enjoy your holidays, etc.
After all, the plugin development stalled for months while I got better :+1:
Yeah, go ahead and send it to [email protected]. Include a as descriptive as possible idea of what you want to accomplish. What about this 'other forum', is that something that needs to be installed as well, or can we assume the code that pulls those names works already?
Thank you !
The code provided in the original post definitely pulls from forum, used it before Redux Framework.
The key is for the structure to be set up for me so that I can go from there.
Email in a bit -- after I zip up the latest version.