page_css_class WordPress Filter Hook

The page_css_class hook is used to add custom classes to the body element of a page in WordPress. This can be useful for targeting specific pages with CSS styles, or for adding custom classes to the page for use with JavaScript.

apply_filters( 'page_css_class', string[] $css_class, WP_Post $page, int $depth, array $args, int $current_page_id ) #

Filters the list of CSS classes to include with each page item in the list.


Description

Top ↑

See also


Top ↑

Parameters

$css_class

(string[])An array of CSS classes to be applied to each list item.

$page

(WP_Post)Page data object.

$depth

(int)Depth of page, used for padding.

$args

(array)An array of arguments.

$current_page_id

(int)ID of the current page.


Top ↑

Source

File: wp-includes/class-walker-page.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.8.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.