Update Wordpress function for custom Gravity Forms field population

กำลังดำเนินการ โพสต์แล้ว 5 ปีที่ผ่านมา ชำระเงินเมื่อจัดส่ง
กำลังดำเนินการ

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

หมายเลขโปรเจค: #17607357

เกี่ยวกับโปรเจกต์

31 ข้อเสนอ โปรเจกต์ระยะไกล ใช้งาน %project.latestActivity_relativeTime|แทนที่%

freelancer freelancer 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