Hooks reference
Generated from the theme and LanternWP Companion with every release; do not edit it by hand.
Examples: Hooks.
lanternwp_back_in_stock_batch
Filter · Companion · since 0.5.0
How many back-in-stock emails a job sends before it schedules the next batch.
$size(int): 50 by default.$id(int): The product's or variation's id.
lanternwp_back_in_stock_delay
Filter · Companion · since 0.5.0
How long after a product is back in stock its back-in-stock emails start, in seconds.
$delay(int): A minute by default.$id(int): The product's or variation's id.
lanternwp_contact_demo
Filter · Companion · since 0.1.2
Whether the store is a public demo, which takes a message and keeps and sends nothing.
$demo(bool): False by default; LanternWP's demo stores return true.
lanternwp_contact_message
Action · Companion · since 0.1.2
A contact message was kept, for an integration (a helpdesk, a chat channel).
$message(int): The message's post id (Messages::POST_TYPE).
lanternwp_demo_server
Filter · Companion · since 0.1.0
Filters the lanternwp.com the plugin asks: the demo store the Demos screen lists and imports demos from.
Return the address of another store that serves the same API, such as a copy of lanternwp.com for development. wp lanternwp demo import does not use it; it takes --server instead.
$server(string): The store's address, https://lanternwp.com by default.
lanternwp_notify_demo
Filter · Companion · since 0.5.0
Whether the store is a public demo, which takes back-in-stock requests and keeps nothing.
$demo(bool): False by default; LanternWP's demo stores return true.
lanternwp_product_posts_template
Filter · Companion · since 0.7.0
Filters the cards of the Posts with this Product block on a product page: a serialized Post Template block, core's featured image, title and date by default. Its class must hold $className, by which the block gives the Query its posts; without it the Query lists the latest posts.
$template(string): The Post Template's markup.$count(int): How many posts it shows, 1 to 3.$className(string): The class the Post Template must carry.
lanternwp_set_tile
Filter · Theme · since 0.7.0
Filters the markup of a product set's tile in a department's tiles panel and in the landing listing's grid: its photo, its name and what it holds. LanternWP Companion draws it, linking to the set on a product page; empty for no tile.
$html(string): The tile's markup, empty by default.$set(int): The set's post id, as the department's settings chose it.
lanternwp_set_tile
Filter · Theme · since 0.7.0
Filters the markup of a product set's tile in a department's tiles panel and in the landing listing's grid: its photo, its name and what it holds. LanternWP Companion draws it, linking to the set on a product page; empty for no tile.
$html(string): The tile's markup, empty by default.$set(int): The set's post id, as the department's settings chose it.
lanternwp_shipping_methods
Filter · Theme · since 0.7.0
Filters the shipping methods the home page's delivery section and the configure product page show, in the zone's order.
$zone(WC_Shipping_Zone): The customer's zone.
lanternwp_store_demo
Filter · Theme · since 0.5.0
Filters the demo the store started from, which Appearance → LanternWP names in its state line and look.
Return an array with the demo's id (such as base, its look's id too) and name (such as Common Goods), or null when the store has no demo. False, the default, means nothing on the site knows, and the screen says nothing of a demo; LanternWP Companion returns the demo its last import brought.
$demo(array|null|false): The store's demo,idandname; null without one; false by default.
lanternwp_store_page
Filter · Theme · since 0.5.0
Filters the page a store page's links lead to: the header's Help link and Contact us (contact), the product page's delivery details and the help links (returns).
$pageId(int): The page's id; 0 for none.$role(string): contact or returns.
lanternwp_store_phone
Filter · Theme · since 0.5.0
Filters the store's phone, as customers should dial it, such as (720) 555-0148; '' for none.
$phone(string):
lanternwp_story_products
Filter · Theme · since 0.7.0
Filters the products a post sells, which its end shows in Shop the story panels, and a journal card with a panel shows the first of (the home page's Featured post and latest posts). An empty list sells none.
$productIds(list<int>): The products' ids, in order; at most four are shown.$postId(int): The post.
lanternwp_term_tiles
Filter · Theme · since 0.7.0
Filters the tiles of an attribute's values in the home page's materials section.
$taxonomy(string): The attribute's taxonomy, such as pa_fabric.
lanternwp_welcome_status
Filter · Theme · since 0.5.0
Filters the line of the store's state under the name of Appearance → LanternWP.
Each part is a short string, such as "21 products"; the screen joins them with dots. A part that is not a string, or is empty, is left out, so a mistake leaves the line as it was.
$parts(list<string>): The parts, in order.
lanternwp_welcome_steps
Filter · Theme · since 0.2.1
Filters the steps of Appearance → LanternWP, the theme's screen of the store.
Each step is an array with a title (string), a text (string), whether it is done (bool) and its actions, each an array with a label and a URL (strings) and primary (bool, for the step's main button). Its section (since 0.5.0) is setup, Finish setting up, where a step is done or not and shows one button, or Change once done; or yours, Make it yours, where a place is never done, the whole row links to its first action, whose label stands at the row's end, and the others are links under its text. A step without a section, or with another, is in setup. Its icon (since 0.5.0), shown in Make it yours, is a Dashicon's name without dashicons-, such as admin-home; without one, or with another value, the row shows admin-generic. A step or an action without that shape is left out, so a mistake leaves the screen as it was.
lanternwp_welcome_tabs
Filter · Theme · since 0.5.0
Filters the tabs of Appearance → LanternWP, after Overview, the theme's.
Each tab, under its id (lowercase letters, digits, - and _; its address is &tab=<id>), is an array: label, its name; render, a callable printing its body under the screen's name, state line and tabs, which the theme prints; and, optionally, capability, which a user needs to see the tab (edit_theme_options by default); count, a number shown beside the name, such as the features that need setup (0 shows none), with count_label, its words for screen readers; and enqueue, a callable run on admin_enqueue_scripts when the tab is open. Overview stays the theme's and first; a tab in another shape is left out. The tabs show as a bar under the state line once there are two.