Making WordPress.org

Changeset 797


Ignore:
Timestamp:
08/14/2014 08:07:04 PM (11 years ago)
Author:
coffee2code
Message:

Code Reference: fix archive title filtering to use specified post

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/extras.php

    r783 r797  
    105105 * Appends parentheses to titles in archive view for functions and methods.
    106106 *
    107  * @param  string $title The title.
     107 * @param  string      $title The title.
     108 * @param  int|WP_Post $post  The post ID or post object.
    108109 * @return string
    109110 */
    110 function wporg_filter_archive_title( $title ) {
    111     if ( ( ! is_single() || doing_filter( 'single_post_title' ) ) && in_array( get_post_type(), array( 'wp-parser-function', 'wp-parser-method' ) ) ) {
     111function wporg_filter_archive_title( $title, $post ) {
     112    if ( ( ! is_single() || doing_filter( 'single_post_title' ) ) && in_array( get_post_type( $post ), array( 'wp-parser-function', 'wp-parser-method' ) ) ) {
    112113        $title .= '()';
    113114    }
     
    115116    return $title;
    116117}
    117 add_filter( 'the_title', 'wporg_filter_archive_title' );
    118 add_filter( 'single_post_title', 'wporg_filter_archive_title' );
     118add_filter( 'the_title',         'wporg_filter_archive_title', 10, 2 );
     119add_filter( 'single_post_title', 'wporg_filter_archive_title', 10, 2 );
Note: See TracChangeset for help on using the changeset viewer.