Skip to content

Instantly share code, notes, and snippets.

View SamuelHadsall's full-sized avatar

Samuel Hadsall SamuelHadsall

View GitHub Profile
@SamuelHadsall
SamuelHadsall / Permilinks and rewrites
Created May 1, 2024 19:37
Post type and redirects
@SamuelHadsall
SamuelHadsall / list-field
Created September 28, 2024 19:17
Populate list field with php and acf repeater
function populate_company_list_field_with_array($value) {
if (current_user_can('employer_admin')) {
// Get the current user's company ID
$company_id = get_user_meta(get_current_user_id(), 'company_id', true);
$list_field_values = array();
// Get the ACF repeater field data
$business_locations = get_field('business_locations', $company_id); // Replace with your ACF repeater field name
// Check if repeater field has data
<?php
/**
* Gravity Forms Multi-Select Dropdown field
*/
class GF_Field_MultiSelect_Dropdown extends GF_Field {
public $type = 'ms_dropdown';