Making WordPress.org


Ignore:
Timestamp:
05/02/2014 09:43:28 PM (12 years ago)
Author:
coffee2code
Message:

Code Reference: Various template and style improvements. props nicolealleyinteractivecom

  • Add plugin and theme handbook templates
  • Refactor templates
  • Refactor SCSS/CSS
  • SCSS/CSS cleanups
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  
    280280            case 'reference':
    281281                return 'Code Reference';
     282            case 'theme-handbook':
     283                return 'Theme Handbook';
     284            case 'plugin-handbook':
     285                return 'Plugin Handbook';
    282286            default:
    283287                return 'Developer Resources';
    284288        }
    285     }
    286     /**
    287      * Get template part name
    288      *
    289      * @return string
    290      */
    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;
    304289    }
    305290
     
    374359        if ( $args ) {
    375360            foreach ( $args as $arg ) {
    376                 $arg_string = '';   
     361                $arg_string = '';
    377362                if ( ! empty( $arg['name'] ) && ! empty( $types[ $arg['name'] ] ) ) {
    378363                    $arg_string .= ' <span class="arg-type">' . $types[ $arg['name'] ] . '</span>';
    379364                }
    380    
     365
    381366                if ( ! empty( $arg['name'] ) ) {
    382367                    $arg_string .= '&nbsp;<span class="arg-name">' . $arg['name'] . '</span>&nbsp;';
    383368                }
    384    
     369
    385370                if ( is_array( $arg ) && array_key_exists( 'default', $arg ) ) {
    386    
     371
    387372                    if ( is_null( $arg['default'] ) ) {
    388373                        $arg['default'] = 'null';
    389374                    }
    390    
     375
    391376                    $arg_string .= '=&nbsp;<span class="arg-default">' . $arg['default'] . "</span>";
    392377                }
    393    
     378
    394379                $args_strings[] = $arg_string;
    395380            }
     
    420405        $args = get_post_meta( $post_id, '_wp-parser_args', true );
    421406        $tags = get_post_meta( $post_id, '_wp-parser_tags', true );
    422        
     407
    423408        if ( $tags ) {
    424409            foreach ( $tags as $tag ) {
     
    438423            }
    439424        }
    440        
     425
    441426        if ( $args ) {
    442427            foreach ( $args as $arg ) {
     
    444429                    $params[ $arg['name'] ]['default'] = $arg['default'];
    445430                }
    446    
    447             }
    448         }
    449        
     431
     432            }
     433        }
     434
    450435        return $params;
    451436    }
     
    465450        $arguments = array();
    466451        $args = get_post_meta( $post_id, '_wp-parser_args', true );
    467        
     452
    468453        if ( $args ) {
    469454            foreach ( $args as $arg ) {
     
    473458            }
    474459        }
    475        
     460
    476461        return $arguments;
    477462    }
     
    562547
    563548    /**
    564      * Compare two objects by name for sorting.
     549     * Compare two objects by name for sorting.
    565550     *
    566551     * @param WP_Post $a Post A
Note: See TracChangeset for help on using the changeset viewer.