Welcome, please login or register

Adding onto the Tabbed Content Widget

Because we can’t anticipate every single way that you might want to use the tabbed content widget, we have made it extremely extensible with the option of User Function as a tab’s content type. By choosing this type, you can enter the name of a callback function you wish to use to determine the content for that tab in the widget.

Setting up the callback function for custom output in the tabbed content widget is quite simple. First, make sure you choose a unique function that will not create any conflicts. When working in OnePress, I always prefix a function name with “op_” to be on the safe side. After creating, fill the function with the functionality you wish, returning an array consisting of both name and content as keys.

function op_extra_tab(){
$content = 'The content I want to display as a string';
return array(
'name' => 'My extra tab',
'content'=> $content
);
}

Leave a Reply

You must be logged in to post a comment.