Making WordPress.org

Changeset 832


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

Code Reference: make wporg_filter_archive_title() more versatile

  • Don't apply in admin
  • Don't apply if post isn't passed in
File:
1 edited

Legend:

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

    r810 r832  
    111111 *
    112112 * @param  string      $title The title.
    113  * @param  int|WP_Post $post  The post ID or post object.
     113 * @param  int|WP_Post $post  Optional. The post ID or post object.
    114114 * @return string
    115115 */
    116 function wporg_filter_archive_title( $title, $post ) {
    117     if ( ( ! is_single() || doing_filter( 'single_post_title' ) ) && in_array( get_post_type( $post ), array( 'wp-parser-function', 'wp-parser-method' ) ) ) {
     116function wporg_filter_archive_title( $title, $post = null ) {
     117    if ( ! is_admin() && $post && ( ! is_single() || doing_filter( 'single_post_title' ) ) && in_array( get_post_type( $post ), array( 'wp-parser-function', 'wp-parser-method' ) ) ) {
    118118        $title .= '()';
    119119    }
Note: See TracChangeset for help on using the changeset viewer.