Changeset 591 for sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
- Timestamp:
- 05/02/2014 09:43:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r569 r591 280 280 case 'reference': 281 281 return 'Code Reference'; 282 case 'theme-handbook': 283 return 'Theme Handbook'; 284 case 'plugin-handbook': 285 return 'Plugin Handbook'; 282 286 default: 283 287 return 'Developer Resources'; 284 288 } 285 }286 /**287 * Get template part name288 *289 * @return string290 */291 function get_template_part_name( $post_type = null ) {292 if ( empty( $post_type ) ) {293 $post_type = get_post_type();294 }295 296 $reference = array( 'wp-parser-class', 'wp-parser-function', 'wp-parser-method' );297 if ( in_array( $post_type, $reference ) ) {298 $part = 'reference';299 } else {300 $part = $post_type;301 }302 303 return $part;304 289 } 305 290 … … 374 359 if ( $args ) { 375 360 foreach ( $args as $arg ) { 376 $arg_string = ''; 361 $arg_string = ''; 377 362 if ( ! empty( $arg['name'] ) && ! empty( $types[ $arg['name'] ] ) ) { 378 363 $arg_string .= ' <span class="arg-type">' . $types[ $arg['name'] ] . '</span>'; 379 364 } 380 365 381 366 if ( ! empty( $arg['name'] ) ) { 382 367 $arg_string .= ' <span class="arg-name">' . $arg['name'] . '</span> '; 383 368 } 384 369 385 370 if ( is_array( $arg ) && array_key_exists( 'default', $arg ) ) { 386 371 387 372 if ( is_null( $arg['default'] ) ) { 388 373 $arg['default'] = 'null'; 389 374 } 390 375 391 376 $arg_string .= '= <span class="arg-default">' . $arg['default'] . "</span>"; 392 377 } 393 378 394 379 $args_strings[] = $arg_string; 395 380 } … … 420 405 $args = get_post_meta( $post_id, '_wp-parser_args', true ); 421 406 $tags = get_post_meta( $post_id, '_wp-parser_tags', true ); 422 407 423 408 if ( $tags ) { 424 409 foreach ( $tags as $tag ) { … … 438 423 } 439 424 } 440 425 441 426 if ( $args ) { 442 427 foreach ( $args as $arg ) { … … 444 429 $params[ $arg['name'] ]['default'] = $arg['default']; 445 430 } 446 447 } 448 } 449 431 432 } 433 } 434 450 435 return $params; 451 436 } … … 465 450 $arguments = array(); 466 451 $args = get_post_meta( $post_id, '_wp-parser_args', true ); 467 452 468 453 if ( $args ) { 469 454 foreach ( $args as $arg ) { … … 473 458 } 474 459 } 475 460 476 461 return $arguments; 477 462 } … … 562 547 563 548 /** 564 * Compare two objects by name for sorting.549 * Compare two objects by name for sorting. 565 550 * 566 551 * @param WP_Post $a Post A
Note: See TracChangeset
for help on using the changeset viewer.