Changeset 2618809
- Timestamp:
- 10/23/2021 03:14:40 PM (4 years ago)
- Location:
- get-acf-field-label-from-name/trunk
- Files:
-
- 2 edited
-
acf-field-label-from-name.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
get-acf-field-label-from-name/trunk/acf-field-label-from-name.php
r2610660 r2618809 22 22 23 23 24 // avoid fun tcion naming collisions24 // avoid function naming collisions 25 25 26 26 if (!function_exists('getAcfLabelByName')) { … … 49 49 $tableName = "{$wpdb->prefix}posts"; 50 50 51 $labelReturned = $wpdb->get_ results( $wpdb->prepare( "SELECT `post_title` FROM `$tableName`52 WHERE `post_type` = %s AND `post_excerpt` = %s", 'acf-field', $fieldName ) , ARRAY_A);51 $labelReturned = $wpdb->get_var( $wpdb->prepare( "SELECT `post_title` FROM `$tableName` 52 WHERE `post_type` = %s AND `post_excerpt` = %s", 'acf-field', $fieldName )); 53 53 54 54 // grab the post_title from the result 55 55 56 $fieldLabel = isset($labelReturned[0]['post_title']) ? $labelReturned[0]['post_title']: 'Not Found';56 $fieldLabel = !empty($labelReturned) ? $labelReturned : 'Not Found'; 57 57 58 58 -
get-acf-field-label-from-name/trunk/readme.txt
r2610660 r2618809 4 4 Requires at least: 4.3 5 5 Tested up to: 5.8.1 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 License: GPLv2 or later 8 8 … … 24 24 == Changelog == 25 25 26 = 1.0.1 = 27 *Release Date - 23 October 2021* 28 * Updated function used to query the posts table 29 26 30 = 1.0.0 = 27 31 *Release Date - 07 October 2021*
Note: See TracChangeset
for help on using the changeset viewer.