Update Wordpress function for custom Gravity Forms field population

В роботі Опубліковано %project.relative_time Оплачується при отриманні
В роботі

At the moment t we have a Gravity Form where a dropdown is dynamically populated with the values in a User Profile custom field - in this case the Coach’s expert area.

We have now changed the way we organize the expert areas and they are now a proper taxonomy ‘Expertise’ in the User type.

Task:

I’d like the code to look at the taxonomy ‘Expertise’ and list all the terms that are being used at least once in the dropdown.

Each term should be listed only once, even if used by multiple coaches.

The dropdown list should be sorted alphabetically.

Existing Code:

function populate_coaches( $form ) {

if ( $form['title'] != "Coaching" ) return $form;

foreach ( $form['fields'] as &$field ) {

if ( $field->type != 'select' || strpos( $field->cssClass, 'coaches-dropdown' ) === false ) {

continue;

}

// Instruction: Change this to look for all terms in user taxonomy Expertise instead

$args = array (

'role' => 'coach',

'meta_key' => 'expertise',

'orderby' => 'meta_key',

'order' => 'ASC'

);

// Create the WP_User_Query object

$wp_user_query = new WP_User_Query($args);

// Get the results

$coaches = $wp_user_query->get_results();

//$choices = array(array('text' => 'Please choose:', 'value' => 0 ));

$i = 1;

foreach( $coaches as $coach ) {

// Load the userinfo

$coach_info = get_userdata($coach->ID);

$coachname = $coach->display_name;

$coachexpertise = $coach->expertise;

$choices[] = array( 'text' => $coachexpertise, 'value' => $i++, 'isSelected' => false );

}

$field['choices'] = $choices;

}

return $form;

}

I'd be expecting this to take no more then 15 minutes or so. FTP access can be arranged.

PHP WordPress

ID Проекту: #17607357

Про проект

31 заявок(-ки) Дистанційний проект Остання активність 5 роки(ів) тому

31 фрілансерів(-и) готові виконати цю роботу у середньому за $13/годину

ukroficer

Hello! My name is Yana. I am a manager of Webcapitan team. We are the group of web-developers. We've been successfully working on developing websites for more than 5 years. By this time our creative company has made a Більше

$14 USD / година
(269 відгуків(и))
8.7
narmadatech

Hello, I will integrate the specified functions into your website. I will update your website as per your requirements and expectations. I would like to have a discussion for further details. Can we discuss over Більше

$16 USD / година
(255 відгуків(и))
8.4
ambientinfotech

Hello, I have been engaged in website development and design. I hope my work, reviews & rating will comfort you to to discuss this project with me. I analyze your requirements those you mention in your project descript Більше

$12 USD / година
(259 відгуків(и))
7.1
ambyt

Hello There, Greeting of the day! As per your project requirement, would be able to work gravity form and implement the dropdown code. Please share me more info. I have been working as developer last 9 yrs. Більше

$12 USD / година
(32 відгуків(и))
6.3
joomd

Hello sir, i am interested in your project ready to start work as per your requirement waiting for your response Thanks

$12 USD / година
(99 відгуків(и))
6.0
abhishekkoundal6

HI, As per your job description, I am the senior developer I am skilled in both the front end and back end technologies. I am having 6+ years experience in this field so I can assure you to provide you quality work Більше

$12 USD / година
(36 відгуків(и))
5.7
dhavalschotaliya

Hello, I have read your requirement and i am interested in your job. I have 5+ year experience of Wordpress and PHP. I can start work now. I know you will get lots of low ball bids. Waiting for your positive reply Більше

$8 USD / година
(63 відгуків(и))
5.2
delostyle

Hi , I have gone through the job details carefully and I am excited to start working on this project. I am confident that I can exceed your expectations by my quality of delivery. I have an extensive knowledge Більше

$8 USD / година
(18 відгуків(и))
4.7
coolanita

Hello Sir, As a self-motivated, solutions-oriented and passionate individual, I have been actively involved in implementing WordPress security and have considerable knowledge of PHP and MySQL Injection. With over 8 Більше

$8 USD / година
(5 відгуків(и))
3.5
doyze

Hi, I have experience with Gravity forms and can do this very well. I am available on chat to answer and questions that you may have and can start immediately. Thanks for taking out time to read my proposal. I am Більше

$12 USD / година
(5 відгуків(и))
3.1
poonamrkaushik

Hello sir, I am Wordpress expert with 6 years experience. completed over 100 projects. I have understood the requirements. I can complete your work within time with quality and big smile promise. I believe in Більше

$10 USD / година
(4 відгуків(и))
3.0