Update Wordpress function for custom Gravity Forms field population

Në Vazhdim Postuar 5 vite mё parё Paguhet në dorëzim
Në Vazhdim

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 Projekti: #17607357

Rreth projektit

31 propozimet Projekti në distancë Aktiv 5 vite mё parё

31 profesionistë freelancer dërguan një ofertë mesatare prej $13/orë për këtë punë

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 Më shumë

$14 USD / orë
(269 Përshtypje)
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 Më shumë

$16 USD / orë
(255 Përshtypje)
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 Më shumë

$12 USD / orë
(259 Përshtypje)
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. Më shumë

$12 USD / orë
(32 Përshtypje)
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 / orë
(99 Përshtypje)
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 Më shumë

$12 USD / orë
(36 Përshtypje)
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 Më shumë

$8 USD / orë
(63 Përshtypje)
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 Më shumë

$8 USD / orë
(18 Përshtypje)
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 Më shumë

$8 USD / orë
(5 Përshtypje)
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 Më shumë

$12 USD / orë
(5 Përshtypje)
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 Më shumë

$10 USD / orë
(4 Përshtypje)
3.0