Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter jdoubleya

    (@jdoubleya)

    Here’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.

    Thread Starter jdoubleya

    (@jdoubleya)

    Hey @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>' : '';
    Thread Starter jdoubleya

    (@jdoubleya)

    no luck, currently using wordpress 2.8.4

    Thread Starter jdoubleya

    (@jdoubleya)

    oops and the domain is http://www.worldofonlinepoker.com

Viewing 4 replies - 1 through 4 (of 4 total)