Ticket #1551: 1551.diff
File 1551.diff, 3.9 KB (added by , 9 years ago) |
---|
-
inc/template-tags.php
833 833 $types = explode( '-', get_post_type( $post_id ) ); 834 834 $type = array_pop( $types ); 835 835 $tags = get_post_meta( $post_id, '_wp-parser_tags', true ); 836 $ all_deprecated = wp_filter_object_list( $tags, array( 'name' => 'deprecated' ) );836 $deprecated = wp_filter_object_list( $tags, array( 'name' => 'deprecated' ) ); 837 837 838 if ( empty( $ all_deprecated ) ) {838 if ( empty( $deprecated ) ) { 839 839 return ''; 840 840 } 841 841 842 $deprecated = array_shift( $all_deprecated ); 843 // Multi-@deprecated may have been defined, with the second actually having the deprecation text. 844 if ( empty( $deprecated['content'] ) ) { 845 $deprecated = array_shift( $all_deprecated ); 842 $referral = array_shift( wp_filter_object_list( $tags, array( 'name' => 'see' ) ) ); 843 844 if ( ! empty( $referral['refers'] ) ) { 845 $refers = sanitize_text_field( $referral['refers'] ); 846 847 if ( ! empty( $refers ) ) { 848 /* translators: 1: Linked internal element name */ 849 $alternative_string = sprintf( __( ' Use %s instead.', 'wporg' ), \DevHub_Formatting::link_internal_element( $refers ) ); 850 } 851 } else { 852 $alternative_string = ''; 846 853 } 847 $description = empty( $deprecated['content'] ) ? '' : esc_html( $deprecated['content'] );848 854 849 return "<div class='deprecated'>" 850 . wp_kses_post( sprintf( __( 'Warning: This %s has been deprecated. %s', 'wporg' ), $type, $description ) ) 851 . '</div>'; 855 /* translators: 1: String for alternative function (if one exists) */ 856 $contents = sprintf( __( 'This %1$s has been deprecated.%2$s', 'wporg' ), 857 $type, 858 $alternative_string 859 ); 860 861 // Use the 'warning' callout box if it's available. Otherwise, fall back to a theme-supported div class. 862 if ( class_exists( 'WPorg_Handbook_Callout_Boxes' ) ) { 863 $callout = new \WPorg_Handbook_Callout_Boxes(); 864 $message = $callout->warning_shortcode( array(), $contents ); 865 } else { 866 $message = '<div class="deprecated">'; 867 $message .= '<p>' . $contents . '</p>'; 868 $message .= '</div>'; 869 } 870 871 return $message; 852 872 } 853 873 854 874 /** … … 1392 1412 1393 1413 /* translators: 1: String for alternative function (if one exists) */ 1394 1414 $contents = sprintf( __( 'This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.%s', 'wporg' ), 1395 1415 $alternative_string 1396 1416 ); 1397 1417 1398 1418 // Use the 'alert' callout box if it's available. Otherwise, fall back to a theme-supported div class. -
scss/main.scss
1010 1010 padding: 20px; 1011 1011 } 1012 1012 .deprecated { 1013 background-color: # be2423;1014 border: 1px solid # a4322f;1013 background-color: #fbeaea; 1014 border: 1px solid #dc3232; 1015 1015 padding: 20px; 1016 color: #ffffff;1017 1016 } 1018 1017 .deprecated-method { 1019 1018 color: #be2423; -
stylesheets/main.css
1213 1213 padding: 20px; 1214 1214 } 1215 1215 .devhub-wrap .wp-parser-class .deprecated, .devhub-wrap .wp-parser-function .deprecated, .devhub-wrap .wp-parser-hook .deprecated, .devhub-wrap .wp-parser-method .deprecated { 1216 background-color: # be2423;1217 border: 1px solid # a4322f;1216 background-color: #fbeaea; 1217 border: 1px solid #dc3232; 1218 1218 padding: 20px; 1219 color: #ffffff;1220 1219 } 1221 1220 .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 { 1222 1221 color: #be2423;