Changeset 2435
- Timestamp:
- 01/30/2016 09:37:19 PM (9 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r2431 r2435 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' ) );837 838 if ( empty( $ all_deprecated ) ) {836 $deprecated = wp_filter_object_list( $tags, array( 'name' => 'deprecated' ) ); 837 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 ); 846 } 847 $description = empty( $deprecated['content'] ) ? '' : esc_html( $deprecated['content'] ); 848 849 return "<div class='deprecated'>" 850 . wp_kses_post( sprintf( __( 'Warning: This %s has been deprecated. %s', 'wporg' ), $type, $description ) ) 851 . '</div>'; 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 = ''; 853 } 854 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 /** This filter is documented in wp-includes/post-template.php */ 868 $message .= apply_filters( 'the_content', $contents ); 869 $message .= '</div>'; 870 } 871 872 return $message; 852 873 } 853 874 … … 1393 1414 /* translators: 1: String for alternative function (if one exists) */ 1394 1415 $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 1416 $alternative_string 1396 1417 ); 1397 1418 … … 1402 1423 } else { 1403 1424 $message = '<div class="private-access">'; 1425 /** This filter is documented in wp-includes/post-template.php */ 1404 1426 $message .= apply_filters( 'the_content', $contents ); 1405 1427 $message .= '</div>'; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
r2431 r2435 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 { -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css
r2431 r2435 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 {
Note: See TracChangeset
for help on using the changeset viewer.