WordPress hook directory
post_class

Description

Applied to the classes of the outermost HTML element for a post. Called in the get_post_class function. Filter function arguments: an array of class names, an array of additional class names that were added to the first array, and the post ID.

This description was scraped automatically from the WordPress filter reference or action reference. If it looks like this is the wrong description, please tell me so I can fix my code.

WordPress version history for post_class

This database has information for all major versions from WP 1.2.1 through 5.1.

Version File Line Type
2.7 wp-includes/post-template.php 338 View in context filter
2.8 wp-includes/post-template.php 345 View in context filter
2.9 wp-includes/post-template.php 342 View in context filter
3.0 wp-includes/post-template.php 349 View in context filter
3.1 wp-includes/post-template.php 378 View in context filter
3.2 wp-includes/post-template.php 378 View in context filter
3.3 wp-includes/post-template.php 378 View in context filter
3.4 wp-includes/post-template.php 375 View in context filter
3.5 wp-includes/post-template.php 377 View in context filter
3.6 wp-includes/post-template.php 382 View in context filter
3.7 wp-includes/post-template.php 382 View in context filter
3.8 wp-includes/post-template.php 382 View in context filter
3.9 wp-includes/post-template.php 466 View in context filter
4.0 wp-includes/post-template.php 485 View in context filter
4.1 wp-includes/post-template.php 484 View in context filter
4.2 wp-includes/post-template.php 502 View in context filter
4.3 wp-includes/post-template.php 508 View in context filter
4.4 wp-includes/post-template.php 518 View in context filter
4.5 wp-includes/post-template.php 532 View in context filter
4.6 wp-includes/post-template.php 543 View in context filter
4.7 wp-includes/post-template.php 543 View in context filter
4.8 wp-includes/post-template.php 543 View in context filter
4.9 wp-includes/post-template.php 543 View in context filter
5.0 wp-includes/post-template.php 547 View in context filter
5.1 wp-includes/post-template.php 564 View in context filter

Related Hooks

We find related hooks using word stems. post_class has 2 significant word stem(s): post, class. Note that some of the hooks below may not appear in all versions of WP.