apply_filters
just calls any methods hooked to the filter, in this case woocommerce_attribute
, and returns the output. You could do a couple of things to style this, here’s one way:
$filtered = apply_filters(
'woocommerce_attribute',
wpautop( wptexturize( implode( ', ', $values ) ) ),
$attribute,
$values
);
echo '<span class="attribute-' . esc_attr( $attribute ) . ">' . $filtered . '</span>';
This will create something like:
<span class="attribute-color">RSV</span>
Now, you can style this in CSS with a rule such as:
span.attribute-color {
font-weight: bold;
/* etc */
}
This is assuming the attribute’s name is “color”, but whatever it is you should now be able to target that particular bit of text and apply custom CSS to it.
Related Posts:
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- How To Change The Html of Products filtration sidebar in Woocommerce?
- Woocommerce filter cart and category specific quantity [closed]
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- WooCommerce Related Products by Attribute
- Show prices with tax in Woocommerce Mini Cart [closed]
- How to sort WooCommerce products page by latest in-stock items first?
- Variation prices breakdown only for single product page
- Remove span tags from WooCommerce Downloads page
- Woocommerce Price Text
- How to add custom checkout field in user details mail template
- Add text below WooCommerce short description if metabox value is true
- Add data attribute to each li in menu
- Ajax category filtering products default show all
- Add a specific part of current category page url to shortcode
- Woocommerce product variation backorder
- Status 400 for AJAX POST Request with admin-ajax.php
- Problem with custom plugin using AJAX to pull info from php file
- Woocommerce hook run after an Order been created through REST API
- How can I apply_filters from inside a function?
- Why does my callback function not work with this custom filter hook?
- Get and insert order email address to the PHP template inside HTML text
- Modify HTML structure of fields in woocommerce checkout form
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Auto-update products after they were published – Woocommerce
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Reload part of checkout on changed shipping method
- How to get all shipping rates and costs without session in woocommerce?
- Display a specific category of products in shop page and disable code for specific actions
- If no products are on sale – hide ID or class
- Woocommerce related product text
- Woocommerce api: create product with images – bad request
- Trying to build simple deposit code that hooks into woocommerce
- WooCommerce Webhooks not firing because of error in wp-includes/meta.php
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Removing “wpautop” (auto tags) only on certain pages?
- Different Minimum Order Amounts based on Shipping Zone [closed]
- do search in two site and show the result in first site
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Add a product to checkout via form
- Trying to place a custom field after the total section in the checkout page in woocommerce
- WordPress default Search function inconsistent in WooCommerce Product Titles
- Which field should I edit to make the checkbox marked by default?
- Add filter when image is uploaded?
- Displaying Woocommerce Product Category in WordPress
- Remove the first 5 characters of the_title and orderby that
- Remove a div from RSS feed
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Print last modified date only on posts
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- How to add an arrow to menu items has submenus
- WordPress Gravatar filter is removing my custom attributes
- wordpress + woocommerce display product with additional information [closed]
- how to fix error “called incorrectly, should not be accessed directly”?
- Function works when I don’t login to WordPress but when I login then it doesn’t work
- How to auto fetch customer details in Woocommerce in checkout page
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Displaying custom taxonomy on WooCommerce product page
- Sum the total amount of a specific product purchased per user and display in table
- Change “add to cart” button color based on Woocommerce product category [closed]
- How can I get the values of my WordPress $wpdb query in Jquery?
- How can I pass a custom/dynamic product to the Woocommerce cart?
- Add to cart function not working for first product when cart is empty [closed]
- I want to add custom add to cart link [closed]
- How to make products with no cost in WooCommerce
- Unique icons next to each WordPress menu item
- Woocommerce : Can’t get product info in loop
- WooCommerce custom product dimensions
- Trouble checking if custom woocommerce checkout field is empty or not
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Validation algorithm in checkout field
- How do I remove the product thumbnail link from a specific div in Woocommerce? [closed]
- My new button is in the wrong place
- WordPress Woocommerce – Product Type [closed]
- Change tinyMCE editor to allow marked content when pasting from Word
- Problem with login form
- Pagination for custom shop loop woocommerce
- Redirect to another page using contact form 7? [closed]
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- Alter required message using comment form api
- How to debug this search & replace strings snippet?
- Hide Featured Image Meta Box on Editor Screen
- Add item to top of menu using a filter in functions.php
- How to remove woocommerce_breadcrumb() from do_action( ‘woocommerce_before_main_content’ ); [closed]
- Woocommerce change prices for a certain country [closed]
- How to get private property in parent class into extended class?
- Add filter multiple times using only one master function
- How to edit php code in WordPress Post file?
- Change page title from page using php via php executed from page/post itself
- How to make modifications only to certain elements of an HTML string on the server-side?
- Override a function defined in wp-includes/comment-template.php
- echo something inside a shortcode
- Replace Woocommerce “add to cart” to be “Download” button [closed]
- Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?
- get taxonomy thumbnail and use it as a variable in code
- Woocommerce Email attachments not working – file not being attached
- Function returns text instead of html [closed]
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Single Quotes in .php file doesn’t load website
- Add post with approval by the admin