WordPress filter hook

portfolio-project-post-class

Fired by 3 WordPress plugins, running on 3M+ sites between them.

“Filter the class applied to project div in the portfolio”

How to use portfolio-project-post-class

It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'portfolio-project-post-class', function( $implode, $portfolio_index_number, $columns ) {
	// Change $implode here.
	return $implode;
}, 10, 3 );

Argument names come from Jetpack's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

3 plugins that fire portfolio-project-post-class

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Jetpack icon Jetpack3+ million installs apply_filters( 'portfolio-project-post-class', implode( ' ', $class ), $portfolio_index_number, $columns ) jetpack_vendor/automattic/jetpack-classic-theme-helper/src/custom-post-types/class-jetpack-portfolio.php:1081
  2. Pixelgrade Assistant icon Pixelgrade Assistant2,000+ installs apply_filters( 'portfolio-project-post-class', implode( " ", $class ), $portfolio_index_number, $columns ) includes/theme-helpers/jetpack-fallbacks/portfolio-shortcode/class-jetpack-portfolio-shortcode.php:247
  3. MAS Elementor icon MAS Elementor800+ installs apply_filters( 'portfolio-project-post-class', implode( ' ', $class ), $portfolio_index_number, $columns ) portfolio/modules/classes/class-mas-jetpack-portfolio.php:924

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.