Actions & Filters

Several actions and filters are available IN THE PREMIUM edition to allow customization of a number of features as described in the following paragraphs.

mstw_bb_home_formats

The plugin provides a list of home indicators,
None, *, †, ‡. Only “None” is translatable. This list is probably all one would ever need, but the list can be expanded or changed via this filter. The skeleton of the required code is:

add_filter( 'mstw_bb_home_formats', 'my_home_formats', 10, 1 );

function my_home_formats( $home_formats ) {

   // This adds 'H' and 'ΒΆ'(¶) to the list
   $home_formats['H'] = 'H';
   // Note that HTML entities and special characters require some special treatment
   $home_formats[html_entity_decode( '¶' )] = html_entity_decode( '¶' );

   return $home_formats;
	
}

mstw_bb_date_formats

The plugin provides a list of date formats, admittedly geared toward American formats. The list can be expanded or changed via this filter. The skeleton of the required code is:

add_filter( 'mstw_bb_date_formats', 'my_date_formats', 10, 1 );

function my_date_formats( $date_formats ) {

   // This format is just an example. Any valid PHP date format should work.
   $date_formats['Tuesday, 2013-04-07'] = 'l, Y-m-d',	

   return $date_formats;
	
}

Note that the array uses the readable (displayed) name as the key and the PHP date format string as the value. Any valid PHP date format should work.

mstw_bb_time_formats

The plugin provides a list of time formats, admittedly geared toward American formats. The list can be expanded or changed via this filter. The skeleton of the required code is basically the same as shown for the mstw_bb_date_formats filter shown above.