FedericoMP
unread,Feb 16, 2012, 12:17:30 PM2/16/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to habari-users
I'm doing some modifications for K2 and I'm trying to create a new
default block. This block should be installed in the sidebar as soon
as the theme is activated.
How can I can know if the block is already in use the specific area?
I've found this:
$blocks = $this->get_blocks( 'nav', 0, $this );
if( count( $blocks ) == 0 ) {
$block = new Block( array(
'title' => _t( 'Charcoal Menu' ),
'type' => 'charcoal_menu',
) );
$block->add_to_area( 'nav' );
Session::notice( _t( 'Added Charcoal Menu block to Nav area.' ) );
}
But it just test if there are any other blocks in the area, not what
block are used.