Title: Adding a function as a new item
Last modified: August 30, 2016

---

# Adding a function as a new item

 *  Resolved [kalawebs](https://wordpress.org/support/users/kalawebs/)
 * (@kalawebs)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/adding-a-function-as-a-new-item/)
 * Thanks for this great piece of work. I read [here](https://wordpress.org/plugins/speed-contact-bar/other_notes/)
   about adding a new item. However, i will like the new item to be a function such
   as `<?php cml_show_flags() ?>` (from [ceceppa plugin](https://wordpress.org/plugins/ceceppa-multilingua/faq/))
   which should add a language filter in the top bar. Can you please help?
 * [https://wordpress.org/plugins/speed-contact-bar/](https://wordpress.org/plugins/speed-contact-bar/)

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

 *  Plugin Contributor [Martin Stehle](https://wordpress.org/support/users/hinjiriyo/)
 * (@hinjiriyo)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/adding-a-function-as-a-new-item/#post-6617618)
 * Try that code. Please append it in the functions.php of the theme:
 *     ```
       // Passed parameter: an array of social media icons as list items
       function kalawebs_add_flags_in_bar ( $list_items ) {
   
           // Add flag list as last item in the list, via $array[]
           // The content has to be surrounded by the LI element
           $list_items[] = '<li>^' . cml_show_flags( array( 'echo' => false ) ) . '</li>';
   
           // Returns changed list
           return $list_items;
   
       }
   
       // Let the function work
       add_filter( 'speed_contact_bar_icons', 'kalawebs_add_flags_in_bar' );
       ```
   
 * That will print out a UL list with the flags. If you want to style the UL you
   can use CSS.
 *  Thread Starter [kalawebs](https://wordpress.org/support/users/kalawebs/)
 * (@kalawebs)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/adding-a-function-as-a-new-item/#post-6617624)
 * Thanks! Worked like a champ!

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

The topic ‘Adding a function as a new item’ is closed to new replies.

 * ![](https://ps.w.org/speed-contact-bar/assets/icon-256x256.png?rev=2478516)
 * [Speed Contact Bar](https://wordpress.org/plugins/speed-contact-bar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/speed-contact-bar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/speed-contact-bar/)
 * [Active Topics](https://wordpress.org/support/plugin/speed-contact-bar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/speed-contact-bar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/speed-contact-bar/reviews/)

## Tags

 * [bar](https://wordpress.org/support/topic-tag/bar/)
 * [language](https://wordpress.org/support/topic-tag/language/)
 * [top](https://wordpress.org/support/topic-tag/top/)

 * 2 replies
 * 2 participants
 * Last reply from: [kalawebs](https://wordpress.org/support/users/kalawebs/)
 * Last activity: [10 years, 8 months ago](https://wordpress.org/support/topic/adding-a-function-as-a-new-item/#post-6617624)
 * Status: resolved