-
Notifications
You must be signed in to change notification settings - Fork 0
Actions & Filters
Action fires after slideshow is fully enqueued, before rendering.
Allows modification of available positions. Passes array of current options.
// default
$caption_positions = array(
'Top Right' => 'caption-top-right',
'Top Center' => 'caption-top-center',
'Top Left' => 'caption-top-left',
'Middle Center' => 'caption-center-center',
'Bottom Right' => 'caption-bottom-right',
'Bottom Center' => 'caption-bottom-center',
'Bottom Left' => 'caption-bottom-left'
);
Allows modification of available templates. Passes array of current template IDs. Array of template details must (minimally) include a label
value. Additional attributes can be added to the array & will be returned with the bu_slideshow_slide_html
filter.
add_filter('bu_slideshow_slide_templates', 'slideshow_add_templates' );
function slideshow_add_templates( $templates ){
$templates['test-template'] = array( 'name' => 'testing 1234' );
$templates['test-template1'] = array( 'name' => 'testing1 1234' );
$templates['haz-fields'] = array(
'name' => 'Template Haz Fields',
'custom_fields' => array(
'ticket_url' => array(
'type' => 'text',
'label' => 'Ticket URL',
),
'special_message' => array(
'type' => 'text',
'label' => 'Special Message',
),
)
);
return $templates;
}
Allows customization of output slide HTML. Use in combination with bu_slideshow_slide_templates
for a full-featured templating system.
add_filter( 'bu_slideshow_slide_html', 'slideshow_slide_apply_template', 10, 2 );
function slideshow_slide_apply_template( $html, $slide ){
return $html;
}
BU_Slide Object
(
[additional_styles] => ''
[caption] => Array
(
[html] => '<div class="bu-slide-caption caption-bottom-right"><p class="bu-slide-caption-title"><a href="http://www.bu.edu/tech/services/support/desktop/repair/">Desktop Repair Services</a></p><p class="bu-slide-caption-text">Expert, manufacturer-authorized installation, configuration, or repair services on your personal or University-owned computers. <a href="http://www.bu.edu/tech/services/support/desktop/repair/">Learn more »</a></p></div>'
[link] => 'http://www.bu.edu/tech/services/support/desktop/repair/'
[title] => 'Desktop Repair Services'
[text] => 'Expert, manufacturer-authorized installation, configuration, or repair services on your personal or University-owned computers. <a href="http://www.bu.edu/tech/services/support/desktop/repair/">Learn more »</a>'
[position] => 'caption-bottom-right'
)
[image_id] => 79452
[image_html] => '<a href="http://www.bu.edu/tech/services/support/desktop/repair/"><img src="/tech/files/2014/05/desktop-repair-slide1.jpg" alt="desktop-repair-slide1" /></a>'
[image_size] => 'full'
[template_id] => 'test-template'
[template_options] => Array
(
[name] => 'testing 1234'
)
[order] => 5
[view] => 'public'
)
Controls visibility of the "Add Slideshow" button on the post edit screen. Passes array of supported post types.
// default
$supported_post_types = array('page', 'post');
Example:
add_filter('bu_slideshow_supported_post_types', 'THEMENAME_bu_slideshow_supported_post_types');
function THEMENAME_bu_slideshow_supported_post_types() {
$supported_post_types = array('page', 'post','CUSTOM-POST-TYPE-NAME');
return $supported_post_types;
}
Note: This filter is called with a priority of 99 in the plugin. If you're having trouble getting this to work, try setting this to a priority higher than that.
Allows the "Add Slideshow" button to be placed on other editor screens. Passes an array of screen_id
values, as pulled from $current_screen->id
.
// default
$editor_screens = array();