Making WordPress.org

Ticket #449: deprecated.diff

File deprecated.diff, 2.8 KB (added by nicole@…, 11 years ago)

deprecated notice

  • content-reference.php

     
    22
    33<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    44
     5        <?php echo get_deprecated(); ?>
     6
    57        <h1><a href="<?php the_permalink() ?>"><?php echo get_signature(); ?></a></h1>
    68
    79        <section class="description">
  • inc/template-tags.php

     
    698698        }
    699699
    700700        /**
     701         * Retrieve deprecated flag
     702         *
     703         * @param int $post_id
     704         *
     705         * @return string
     706         */
     707        function get_deprecated( $post_id = null ) {
     708                if ( empty( $post_id ) ) {
     709                        $post_id = get_the_ID();
     710                }
     711                $type       = ucwords( array_pop( explode( '-', get_post_type( $post_id ) ) ) );
     712                $tags       = get_post_meta( $post_id, '_wp-parser_tags', true );
     713                $deprecated = wp_filter_object_list( $tags, array( 'name' => 'deprecated' ) );
     714
     715                if ( empty( $deprecated ) ) {
     716                        return '';
     717                } else {
     718                        $deprecated      = array_shift( $deprecated );
     719                        $description = empty( $deprecated['content'] ) ? '' : esc_html( $deprecated['content'] );
     720                        return "<div class='deprecated'>" . wp_kses_post( sprintf( __( 'Warning: This %s has been deprecated. %s</div>', 'wporg' ), $type, $description ) );
     721                }
     722        }
     723
     724        /**
    701725         * Retrieve URL to source file archive.
    702726         *
    703727         * @param string $name
  • scss/main.scss

     
    940940                        border-radius: 5px;
    941941                        padding: 20px;
    942942                }
     943                .deprecated {
     944                        background-color: #be2423;
     945                        border: 1px solid #a4322f;
     946                        padding: 20px;
     947                        color: #ffffff;
     948                }
    943949        }
    944950
    945951        &.archive, &.search {
  • stylesheets/main.css

     
    11451145  border-radius: 5px;
    11461146  padding: 20px;
    11471147}
     1148.devhub-wrap .wp-parser-class .deprecated, .devhub-wrap .wp-parser-function .deprecated, .devhub-wrap .wp-parser-hook .deprecated, .devhub-wrap .wp-parser-method .deprecated {
     1149  background-color: #be2423;
     1150  border: 1px solid #a4322f;
     1151  padding: 20px;
     1152  color: #ffffff;
     1153}
    11481154.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 {
    11491155  font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
    11501156  color: #21759b;