'; $ticker_html .= ''; $ticker_html .= ' '.$ticker1_text; $ticker_html .= ''; $ticker_html .= ''; $ticker_html .= ' '.$ticker2_text; $ticker_html .= ''; $ticker_html .= ''; $ticker_html .= ' '.$ticker3_text; $ticker_html .= ''; if ( $sticky_posts_display == 1 ) { $stickies = get_option( 'sticky_posts' ); if ( !empty($stickies) ) { rsort( $stickies ); foreach ( $stickies as $sticky ) { $post = NULL; $title = NULL; $content = NULL; $post = get_post($sticky); $title = $post->post_title; $content = $this->html_text($post->post_content); $ticker_html .= ''; $ticker_html .= ' '.$title.':'; $ticker_html .= ''; $ticker_html .= ''; $ticker_html .= $content; $ticker_html .= ''; } } } $ticker_html .= ''; return $ticker_html; } /* ================================================== * short code * @param array $atts * @return string $this->read_tickers() */ function simpleticker_func( $atts ) { extract(shortcode_atts(array( 'ticker1_color' => '', 'ticker1_text' => '', 'ticker2_color' => '', 'ticker2_text' => '', 'ticker3_color' => '', 'ticker3_text' => '', 'sticky_posts_display' => '', 'sticky_posts_title_color' => '', 'sticky_posts_content_color' => '' ), $atts)); return $this->read_tickers($ticker1_color, $this->html_text($ticker1_text), $ticker2_color, $this->html_text($ticker2_text), $ticker3_color, $this->html_text($ticker3_text), $sticky_posts_display, $sticky_posts_title_color, $sticky_posts_content_color); } /* * @param string $html * @return string $text * @since 1.0 */ function html_text($html) { $text = strip_tags($html); $text = str_replace(array("\r", "\n"), '', $text); return $text; } } ?>