add optional shortcode support for tick content (#18) (#19)
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
If the new option is enabled, tick content will be piped through do_shortcode() to parse nested shortcode content. Disabled by default as it is not necessary in most cases.
This commit is contained in:
@ -418,11 +418,12 @@ class SCLiveticker {
|
||||
*/
|
||||
protected static function default_options() {
|
||||
return array(
|
||||
'enable_ajax' => 1,
|
||||
'poll_interval' => 60,
|
||||
'enable_css' => 1,
|
||||
'show_feed' => 0,
|
||||
'reset_settings' => 0,
|
||||
'enable_ajax' => 1,
|
||||
'poll_interval' => 60,
|
||||
'enable_css' => 1,
|
||||
'show_feed' => 0,
|
||||
'enable_shortcode' => 0,
|
||||
'reset_settings' => 0,
|
||||
);
|
||||
}
|
||||
|
||||
@ -437,6 +438,10 @@ class SCLiveticker {
|
||||
* @return string HTML code of tick.
|
||||
*/
|
||||
private static function tick_html( $time, $title, $content, $id ) {
|
||||
if ( self::$options['enable_shortcode'] ) {
|
||||
$content = do_shortcode( $content );
|
||||
}
|
||||
|
||||
return '<li class="sclt-tick" data-sclt-tick-id="' . esc_attr( $id ) . '">'
|
||||
. '<span class="sclt-tick-time">' . esc_html( $time ) . '</span>'
|
||||
. '<span class="sclt-tick-title">' . esc_html( $title ) . '</span>'
|
||||
|
Reference in New Issue
Block a user