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.
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/habari-users