Changeset 2431
- Timestamp:
- 01/29/2016 07:48:45 PM (9 years ago)
- 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
r2374 r2431 4 4 5 5 <?php echo get_deprecated(); ?> 6 7 <?php echo get_private_access_message(); ?> 6 8 7 9 <h1><a href="<?php the_permalink() ?>"><?php echo get_signature(); ?></a></h1> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r2290 r2431 1350 1350 return get_post_field( $field, $explanation, $context ); 1351 1351 } 1352 1353 /** 1354 * Generates a private access message for a private element. 1355 * 1356 * @param int|WP_Post $post Optional. Post object or ID. Default global `$post`. 1357 * @return string Private access message if the given reference is considered "private". 1358 */ 1359 function get_private_access_message( $post = null ) { 1360 if ( ! $post = get_post( $post ) ) { 1361 return ''; 1362 } 1363 1364 // Currently only handling private access messages for functions and hooks. 1365 if ( ! in_array( get_post_type( $post ), array( 'wp-parser-function', 'wp-parser-hook' ) ) ) { 1366 return ''; 1367 } 1368 1369 $tags = get_post_meta( $post->ID, '_wp-parser_tags', true ); 1370 $access_tags = wp_filter_object_list( $tags, array( 1371 'name' => 'access', 1372 'content' => 'private' 1373 ) ); 1374 1375 // Bail if it isn't private. 1376 if ( empty( $access_tags ) ) { 1377 return ''; 1378 } 1379 1380 $referral = array_shift( wp_filter_object_list( $tags, array( 'name' => 'see' ) ) ); 1381 1382 if ( ! empty( $referral['refers'] ) ) { 1383 $refers = sanitize_text_field( $referral['refers'] ); 1384 1385 if ( ! empty( $refers ) ) { 1386 /* translators: 1: Linked internal element name */ 1387 $alternative_string = sprintf( __( ' Use %s instead.', 'wporg' ), \DevHub_Formatting::link_internal_element( $refers ) ); 1388 } 1389 } else { 1390 $alternative_string = ''; 1391 } 1392 1393 /* translators: 1: String for alternative function (if one exists) */ 1394 $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 $alternative_string 1396 ); 1397 1398 // Use the 'alert' callout box if it's available. Otherwise, fall back to a theme-supported div class. 1399 if ( class_exists( 'WPorg_Handbook_Callout_Boxes' ) ) { 1400 $callout = new \WPorg_Handbook_Callout_Boxes(); 1401 $message = $callout->alert_shortcode( array(), $contents ); 1402 } else { 1403 $message = '<div class="private-access">'; 1404 $message .= apply_filters( 'the_content', $contents ); 1405 $message .= '</div>'; 1406 } 1407 1408 return $message; 1409 } 1352 1410 } -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
r2284 r2431 1020 1020 font-style: italic; 1021 1021 } 1022 .private-access { 1023 margin-top: 30px; 1024 padding: 20px 20px 10px; 1025 border: 1px solid #ffb900; 1026 background-color: #fff8e5; 1027 } 1028 .callout { 1029 margin-top: 30px; 1030 } 1022 1031 } 1023 1032 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css
r2284 r2431 1223 1223 font-style: italic; 1224 1224 } 1225 .devhub-wrap .wp-parser-class .private-access, .devhub-wrap .wp-parser-function .private-access, .devhub-wrap .wp-parser-hook .private-access, .devhub-wrap .wp-parser-method .private-access { 1226 margin-top: 30px; 1227 padding: 20px 20px 10px; 1228 border: 1px solid #ffb900; 1229 background-color: #fff8e5; 1230 } 1231 .devhub-wrap .wp-parser-class .callout, .devhub-wrap .wp-parser-function .callout, .devhub-wrap .wp-parser-hook .callout, .devhub-wrap .wp-parser-method .callout { 1232 margin-top: 30px; 1233 } 1225 1234 .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 { 1226 1235 font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
Note: See TracChangeset
for help on using the changeset viewer.