Making WordPress.org

Changeset 1269


Ignore:
Timestamp:
02/17/2015 07:37:27 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Denote deprecated methods as such in a class's listing of its methods. Fixes #791

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
4 edited

Legend:

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

    r1196 r1269  
    116116                <?php if ( $excerpt = apply_filters( 'get_the_excerpt', $child->post_excerpt ) ) {
    117117                    echo '&mdash; ' . sanitize_text_field( $excerpt );
     118                } ?>
     119                <?php if ( is_deprecated( $child->ID ) ) {
     120                    echo '&mdash; <span class="deprecated-method">' . __( 'deprecated', 'wporg' ) . '</span>';
    118121                } ?>
    119122                </li>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r1196 r1269  
    784784
    785785    /**
     786     * Indicates if a post is deprecated.
     787     *
     788     * @param int $post_id
     789     *
     790     * @return bool
     791     */
     792    function is_deprecated( $post_id = null ) {
     793        if ( empty( $post_id ) ) {
     794            $post_id = get_the_ID();
     795        }
     796
     797        $tags           = get_post_meta( $post_id, '_wp-parser_tags', true );
     798        $all_deprecated = wp_filter_object_list( $tags, array( 'name' => 'deprecated' ) );
     799
     800        return !! $all_deprecated;
     801    }
     802
     803    /**
    786804     * Retrieve deprecated flag
    787805     *
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss

    r1244 r1269  
    995995            color: #ffffff;
    996996        }
     997        .deprecated-method {
     998            color: #be2423;
     999            font-style: italic;
     1000        }
    9971001    }
    9981002
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css

    r1244 r1269  
    11991199  color: #ffffff;
    12001200}
     1201.devhub-wrap .wp-parser-class .deprecated-method, .devhub-wrap .wp-parser-function .deprecated-method, .devhub-wrap .wp-parser-hook .deprecated-method, .devhub-wrap .wp-parser-method .deprecated-method {
     1202  color: #be2423;
     1203  font-style: italic;
     1204}
    12011205.devhub-wrap.archive .wp-parser-class h1 a, .devhub-wrap.archive .wp-parser-function h1 a, .devhub-wrap.archive .wp-parser-hook h1 a, .devhub-wrap.archive .wp-parser-method h1 a, .devhub-wrap.search .wp-parser-class h1 a, .devhub-wrap.search .wp-parser-function h1 a, .devhub-wrap.search .wp-parser-hook h1 a, .devhub-wrap.search .wp-parser-method h1 a {
    12021206  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
Note: See TracChangeset for help on using the changeset viewer.