1. Home
  2. Docs
  3. Flexi Gallery
  4. Developers
  5. Hook: flexi_common_toolbar

Hook: flexi_common_toolbar

Hook name: flexi_common_toolbar
Shortcode related:


Hook type: filter
Parameter: array
Uses:<?php add_filter( 'flexi_common_toolbar', 'flexi_function_name','10','1'); ?>
Sources: includes\user_dashboard\class-flexi-user-dashboard.php (flexi_common_toolbar function)

Example to add external link to http://yahoo.com:

public function flexi_function_name($icon)
    {
        $extra_icon = array();

        $link       = "http://www.yahoo.com/";
        $button_label = "Yahoo";


        $extra_icon = array(
            array(
                "link", //css icon
                $button_label, //Label of button
                $link, //Link URL
                'flexi_css_button' //Link css class name
            ),

        );

        // combine the two arrays
        if (is_array($extra_icon) && is_array($icon)) {
            $icon = array_merge($extra_icon, $icon);
        }


        return $icon;
    }

HTML code generated

<a href="http://www.yahoo.com/" class="flexi_css_button">
  <span class="flexi_css_button-icon">
      <span class="flexi_icon_link"></span>
  </span>
  <span class="flexi_css_button-text">Yahoo</span>
</a>
Generated yahoo button with link

Leave a Reply