boot(); }, 20 ); /** * Shortcut to the plugin instance. * * @return Bylt_Plugin */ function bylt() { return Bylt_Plugin::instance(); } /** * A price as plain text ("$50.00", "€12,00") for emails, notices, notes and anything escaped later. * wp_strip_all_tags( wc_price() ) keeps entities like $, which then show literally once escaped. * * @param float|string $amount Amount. * @param array $args wc_price() arguments. */ function bylt_price_text( $amount, $args = array() ) { return html_entity_decode( wp_strip_all_tags( wc_price( $amount, $args ) ), ENT_QUOTES, 'UTF-8' ); } /** * array_filter() callback: keep values that aren't empty strings ("0" stays). * Used instead of 'strlen', which warns on null cells in PHP 8.1+. * * @param mixed $value Value. * @return bool */ function bylt_filled( $value ) { return null !== $value && '' !== (string) $value; }