jdoubleya
Forum Replies Created
-
Forum: Plugins
In reply to: [Advanced Custom Fields: Font Awesome Field] ACF FA Field only returns jsonHere’s a minified version of the code setup.
$options = wp_load_alloptions(); // load all wp options $buttons = $options['options_header_button_group_buttons']; // loop through header button group for ($i = 0; $i < $buttons; $i++) { // get icon class $icon = isset($options['options_header_button_group_buttons_' . $i . '_button_icon']) ? '<i class="' . $options['options_header_button_group_buttons_' . $i . '_button_icon'] . '"></i>' : ''; // format button and add to array $buttons[] = '<a href="' . $url . '" class="btn ' . $style . '" title="' . $title . '"' . $target . ' role="button">' . $icon . '<span class="text d-none d-xxl-inline-block">' . $title . '</span></a>'; }I did create a new test field and used
$icon = get_field('icon', 'options');
which returns the icon class correctly “fa-solid fa-phone-xmark”, so it seems to be an issue with pulling the values from the wp_options.Forum: Plugins
In reply to: [Advanced Custom Fields: Font Awesome Field] ACF FA Field only returns jsonHey @mattkeys,
Thanks for the quick reply. The field is in a repeater which is in an options page. The following code used to return the classes before updating the plugin and FA 6.
$icon = isset($options['options_header_button_group_buttons_' . $i . '_button_icon']) ? '<i class="' . $options['options_header_button_group_buttons_' . $i . '_button_icon'] . '"></i>' : '';I wrote the following temporary fix which works for the time being.
$iconArr = isset($options['options_header_button_group_buttons_' . $i . '_button_icon']) ? json_decode($options['options_header_button_group_buttons_' . $i . '_button_icon']) : ''; $iconStyle = !empty($iconArr) ? $iconArr->style : ''; $iconId = !empty($iconArr) ? $iconArr->id : ''; $icon = !empty($iconArr) ? '<i class="fa-'.$iconStyle.' fa-'.$iconId.'"></i>' : '';Forum: Fixing WordPress
In reply to: Cant login to Admin area, Tried all login troubleshooting stepsno luck, currently using wordpress 2.8.4
Forum: Fixing WordPress
In reply to: Cant login to Admin area, Tried all login troubleshooting stepsoops and the domain is http://www.worldofonlinepoker.com