
外掛標籤
開發者團隊
原文外掛簡介
Tubaksin – Ticker Anything turns almost anything into a ticker: breaking news, a strip of client logos, a “free shipping” announcement, your latest posts or headlines from another site in your multisite network.
Build a ticker once, then show it wherever you like: as a block, as an Elementor widget, with a shortcode, in a theme template, or as a bar at the top or bottom of every page.
What a ticker can show
Your own items: short messages with optional links, bold or highlighted words and an image.
Posts: the latest posts, pages or any public custom post type, filtered by category, tag or any public taxonomy, ordered as you like, with optional featured image, date and excerpt.
Images and logos: pick images from the media library for a logo strip.
A shared ticker from another site (multisite): show a ticker that another site in the network shares.
How it moves
Scroll: a seamless loop to the left or right, at a speed you set in pixels per second, so it reads the same on every screen size.
Vertical: a list that moves up or down, with the number of visible rows you choose.
Fade and Slide: one item at a time, with previous and next buttons.
How it looks
Eight ready-made styles (Breaking news, Minimal, Pills, Dark bar, Logo strip, Cards, Sidebar list and Announcement), a label such as “Breaking”, separators between items, your own colours and font size, edge fading and grey-until-hover logos. Everything follows the text direction of your site, including right-to-left languages.
Where it goes
Ticker block for the block editor and the site editor, with four variations (News ticker, Logo strip, Announcement bar and Vertical headlines) and matching patterns. Use a saved ticker, or build one right in the block settings.
Elementor widget, with the same settings in the Elementor panel, when Elementor is active.
Shortcode: [tubaksin_ticker id="12"]. Most settings work as attributes, for example [tubaksin_ticker source="posts" count="5" display="vertical"].
Theme templates: .
Site-wide bar at the top or bottom of every page, or only the front page, posts or pages, optionally sticky, hidden on small screens, or closable by visitors.
Switch off any of these in Manage Tickers › Settings › Modules: a module that is off loads no code.
Multisite: share content across the network
On a multisite network, a ticker on one site can show posts from another site, or a ticker that another site shares. A network admin decides which sites may be read (by default, every site can read the main site) in Network Admin › Settings › Ticker Sharing. Each site decides which of its tickers it shares.
Only published posts of public post types are read. Private, draft and password-protected posts never leave their site. Content from another site is cached; it is refreshed as soon as that site changes a post or a ticker when Tubaksin is active there, and within 10 minutes otherwise.
Accessible by default
A pause button, on by default, for moving tickers (see WCAG success criterion 2.2.2), plus pause on hover and while an item has keyboard focus.
With “reduce motion” switched on in the system, scrolling tickers become static lists that can be scrolled by hand, and rotating tickers wait for the play button.
The copies used for a seamless loop are hidden from screen readers and keyboards.
Motion stops while the ticker is off screen or the browser tab is hidden.
The builder warns about low colour contrast and missing pause buttons.
Light
The front-end script is plain JavaScript with no jQuery or other libraries, and it only loads on pages that show a ticker.
For developers
Every part goes through hooks, so you can extend the plugin from your own code:
tubaksin_schema: add or change ticker settings. New settings appear in the builder, the block, the Elementor widget and the shortcode.
tubaksin_sources: add a content source (an object implementing Tubaksin\Sources\SourceInterface).
tubaksin_displays and tubaksinTicker.registerDisplay() in JavaScript: add a motion type.
tubaksin_presets: add a style preset.
tubaksin_modules: add a module.
tubaksin_items, tubaksin_item_html, tubaksin_wrapper_attributes, tubaksin_style_vars, tubaksin_should_render, tubaksin_posts_query_args, tubaksin_image_size: change what renders.
tubaksin_network_allowed_sites, tubaksin_network_cache_ttl: change network reading.
tubaksin_capability: change who may manage tickers (default edit_pages).
JavaScript filters tubaksin.controls.field and tubaksin.controls.panel (wp.hooks): add controls to the builder and the block.
The action tubaksin_loaded fires once the plugin is ready.
Source code
All JavaScript and CSS ship in readable, unminified form, with no build step: what you see in the plugin folder is the source.
