diff --git a/acf-export.php b/acf-export.php index a8bce2b..9806066 100644 --- a/acf-export.php +++ b/acf-export.php @@ -306,6 +306,22 @@ if(function_exists("register_field_group")) 'formatting' => 'html', 'maxlength' => '', ), + array ( + 'key' => 'field_url', + 'label' => 'URL', + 'name' => 'url', + 'type' => 'url', + 'instructions' => '', + 'required' => 0, + 'conditional_logic' => 0, + 'wrapper' => array ( + 'width' => '', + 'class' => '', + 'id' => '', + ), + 'default_value' => '', + 'placeholder' => '', + ), ), 'location' => array ( array ( diff --git a/uc-people-widget.php b/uc-people-widget.php index 8e265cc..2efc742 100644 --- a/uc-people-widget.php +++ b/uc-people-widget.php @@ -7,6 +7,40 @@ Class UC_People_Widget extends WP_Widget { parent::__construct( 'uc_people_widget', 'UC People', array( 'classname' => __CLASS__, 'description' => 'A widget to display People' ) ); } + private static function sort_by_last_then_first($a,$b) { + setlocale(LC_CTYPE, 'en_US.UTF8'); // Using setlocale and iconv incase a name has an accent or other similar characters in them + $r = strnatcasecmp( iconv('UTF-8', 'ASCII//TRANSLIT', get_field('last_name', $a)), iconv('UTF-8', 'ASCII//TRANSLIT', get_field('last_name', $b)) ); + if( $r === 0 ){ + $r = strnatcasecmp( iconv('UTF-8', 'ASCII//TRANSLIT', get_field('first_name', $a)), iconv('UTF-8', 'ASCII//TRANSLIT', get_field('first_name', $b)) ); + } + return $r; + } + + private static function sort_group_by_order( $a, $b ){ + // Getting the order for groups $a and $b + $groupA = get_term_by('slug', $a, 'group')->term_id; + $array_orderGroupA = get_option( "taxonomy_{$groupA}" ); + $orderGroupA = $array_orderGroupA['group_order']; + + $groupB = get_term_by('slug', $b, 'group')->term_id; + $array_orderGroupB = get_option( "taxonomy_{$groupB}" ); + $orderGroupB = $array_orderGroupB['group_order']; + + $r = strnatcasecmp( $orderGroupA, $orderGroupB ); + if( $r === 0 ){ + $r = strnatcasecmp( $a, $b ); // If groups have the same order, group them by name alphabetically + } + return $r; + } + + private function createTextCell( $field, $information_to_display, $id ){ + $cell = ''; + if (in_array($field, $information_to_display)) { + $cell .= '
Enter a value for this field or leave it blank
+Enter a value for this field or leave it blank
+