Plugin Directory

Changeset 3217047


Ignore:
Timestamp:
01/05/2025 01:54:21 AM (12 months ago)
Author:
bhubbard
Message:

Updating to 1.0.4

Location:
wp-lawyer/trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • wp-lawyer/trunk

    • Property svn:ignore set to
      vendor
  • wp-lawyer/trunk/assets/css/main.css

    r924045 r3217047  
    11.facebook-icon, .twitter-icon, .linkedin-icon, .youtube-icon{
    2     background: url('../images/social-icons.png') no-repeat;
     2    background: url('../images/social-icons.png') no-repeat;
    33}
    44
    55.facebook-icon{
    6     background-position: 0 0;
    7     width: 40px;
    8     height: 40px;
    9     list-style: none;
     6    background-position: 0 0;
     7    width: 40px;
     8    height: 40px;
     9    list-style: none;
    1010}
    1111
    1212.twitter-icon{
    13     background-position: -50px 0;
    14     width: 40px;
    15     height: 40px;
    16     list-style: none;
     13    background-position: -50px 0;
     14    width: 40px;
     15    height: 40px;
     16    list-style: none;
    1717}
    1818
    1919.linkedin-icon{
    20     background-position: -100px 0;
    21     width: 40px;
    22     height: 40px;
    23     list-style: none;
     20    background-position: -100px 0;
     21    width: 40px;
     22    height: 40px;
     23    list-style: none;
    2424}
    2525
    2626.youtube-icon{
    27     background-position: -150px 0;
    28     width: 40px;
    29     height: 40px;
    30     list-style: none;
     27    background-position: -150px 0;
     28    width: 40px;
     29    height: 40px;
     30    list-style: none;
    3131}
    3232
    3333.wplawyer-case-container {
    34     width: 33%;
    35     padding: 20px;
    36     display: inline-block;
     34    width: 33%;
     35    padding: 20px;
     36    display: inline-block;
    3737}
    3838
    3939.attorney-social {
    40     list-style: none;
     40    list-style: none;
    4141}
    4242
    4343ul.attorney-social {
    44     padding: 0;
     44    padding: 0;
    4545}
    4646
    4747ul.attorney-social li {
    48     display: inline-block;
    49     margin: 0 2px;
     48    display: inline-block;
     49    margin: 0 2px;
    5050}
    5151
    5252.wplawyer-attorney-container {
    53     display: inline-block;
    54     margin: 15px;
     53    display: inline-block;
     54    margin: 15px;
    5555}
    5656
    5757.wplawyer-attorney-thumb-single {
    58     float: left;
    59     padding: 15px;
    60     margin-right: 15px;
     58    float: left;
     59    padding: 15px;
     60    margin-right: 15px;
    6161}
    6262
  • wp-lawyer/trunk/modules/attorneys.php

    r1121518 r3217047  
    11<?php
    22
    3 ###########################################################
     3//
    44// Add Image Size for Single Case
    5 ###########################################################
    6 
    7     add_image_size( 'wplawyer-attorney', 200, 400, true ); // 200 x 400, for the attorney archive & single
    8 
    9 ###########################################################
     5//
     6
     7    add_image_size('wplawyer-attorney', 200, 400, true); // 200 x 400, for the attorney archive & single
     8
     9//
    1010// Register Attorneys Custom Post Type
    11 ###########################################################
    12 if ( ! function_exists('wp_lawyer_attorneys_cpt') ) {
    13 
    14 // Register Custom Post Type
    15 function wp_lawyer_attorneys_cpt() {
    16 
    17     $labels = array(
    18         'name'                => _x( 'Attorneys', 'Post Type General Name', 'wp-lawyer' ),
    19         'singular_name'       => _x( 'attorney', 'Post Type Singular Name', 'wp-lawyer' ),
    20         'menu_name'           => __( 'Attorneys', 'wp-lawyer' ),
    21         'parent_item_colon'   => __( 'Parent Attorney:', 'wp-lawyer' ),
    22         'all_items'           => __( 'All Attorneys', 'wp-lawyer' ),
    23         'view_item'           => __( 'View Attorney', 'wp-lawyer' ),
    24         'add_new_item'        => __( 'Add New Attorney', 'wp-lawyer' ),
    25         'add_new'             => __( 'Add Attorney', 'wp-lawyer' ),
    26         'edit_item'           => __( 'Edit Attorney', 'wp-lawyer' ),
    27         'update_item'         => __( 'Update Attorney', 'wp-lawyer' ),
    28         'search_items'        => __( 'Search Attorneys', 'wp-lawyer' ),
    29         'not_found'           => __( 'No Attorney Found', 'wp-lawyer' ),
    30         'not_found_in_trash'  => __( 'No Attorney Found in Trash', 'wp-lawyer' ),
    31     );
    32     $args = array(
    33         'label'               => __( 'attorney', 'wp-lawyer' ),
    34         'description'         => __( 'Attorney', 'wp-lawyer' ),
    35         'labels'              => $labels,
    36         'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'publicize', 'wpcom-markdown', 'custom-fields'  ),
    37         'taxonomies'          => array( 'practice-type' ),
    38         'hierarchical'        => false,
    39         'public'              => true,
    40         'show_ui'             => true,
    41         'show_in_menu'        => true,
    42         'show_in_nav_menus'   => true,
    43         'show_in_admin_bar'   => true,
    44         'menu_position'       => 5,
    45         'menu_icon'           => plugins_url( '../assets/images/attorney-icon.png' , __FILE__ ),
    46         //'register_meta_box_cb' => 'wplawyer_add_attorney_metaboxes',
    47         'can_export'          => true,
    48         'has_archive'         => true,
    49         'exclude_from_search' => false,
    50         'publicly_queryable'  => true,
    51         'capability_type'     => 'page',
    52         'rewrite' => array('slug'=>'attorney', 'with_front' => false)
    53     );
    54     register_post_type( 'wplawyer-attorney', $args );
    55 
    56 }
    57 
    58 // Hook into the 'init' action
    59 add_action( 'init', 'wp_lawyer_attorneys_cpt', 0 );
    60 
    61 }
    62 
    63 
    64 
    65 ###########################################################
     11//
     12if (! function_exists('wp_lawyer_attorneys_cpt') ) {
     13
     14    // Register Custom Post Type
     15    function wp_lawyer_attorneys_cpt()
     16    {
     17
     18        $labels = array(
     19        'name'                => _x('Attorneys', 'Post Type General Name', 'wp-lawyer'),
     20        'singular_name'       => _x('attorney', 'Post Type Singular Name', 'wp-lawyer'),
     21        'menu_name'           => __('Attorneys', 'wp-lawyer'),
     22        'parent_item_colon'   => __('Parent Attorney:', 'wp-lawyer'),
     23        'all_items'           => __('All Attorneys', 'wp-lawyer'),
     24        'view_item'           => __('View Attorney', 'wp-lawyer'),
     25        'add_new_item'        => __('Add New Attorney', 'wp-lawyer'),
     26        'add_new'             => __('Add Attorney', 'wp-lawyer'),
     27        'edit_item'           => __('Edit Attorney', 'wp-lawyer'),
     28        'update_item'         => __('Update Attorney', 'wp-lawyer'),
     29        'search_items'        => __('Search Attorneys', 'wp-lawyer'),
     30        'not_found'           => __('No Attorney Found', 'wp-lawyer'),
     31        'not_found_in_trash'  => __('No Attorney Found in Trash', 'wp-lawyer'),
     32        );
     33        $args = array(
     34        'label'               => __('attorney', 'wp-lawyer'),
     35        'description'         => __('Attorney', 'wp-lawyer'),
     36        'labels'              => $labels,
     37        'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'publicize', 'wpcom-markdown', 'custom-fields'  ),
     38        'taxonomies'          => array( 'practice-type' ),
     39        'hierarchical'        => false,
     40        'public'              => true,
     41        'show_ui'             => true,
     42        'show_in_menu'        => true,
     43        'show_in_nav_menus'   => true,
     44        'show_in_admin_bar'   => true,
     45        'menu_position'       => 5,
     46        'menu_icon'           => plugins_url('../assets/images/attorney-icon.png', __FILE__),
     47        //'register_meta_box_cb' => 'wplawyer_add_attorney_metaboxes',
     48        'can_export'          => true,
     49        'has_archive'         => true,
     50        'exclude_from_search' => false,
     51        'publicly_queryable'  => true,
     52        'capability_type'     => 'page',
     53        'rewrite' => array('slug'=>'attorney', 'with_front' => false)
     54        );
     55        register_post_type('wplawyer-attorney', $args);
     56
     57    }
     58
     59    // Hook into the 'init' action
     60    add_action('init', 'wp_lawyer_attorneys_cpt', 0);
     61
     62}
     63
     64
     65
     66//
    6667// Areas of Practice - Taxonomy
    67 ###########################################################
    68 if ( ! function_exists( 'wp_lawyer_attorneys_practicearea' ) ) {
    69 
    70 // Register Custom Taxonomy
    71 function wp_lawyer_attorneys_practicearea() {
    72 
    73     $labels = array(
    74         'name'                       => _x( 'Areas of Practice', 'Taxonomy General Name', 'wp-lawyer' ),
    75         'singular_name'              => _x( 'Area of Practice', 'Taxonomy Singular Name', 'wp-lawyer' ),
    76         'menu_name'                  => __( 'Areas of Practice', 'wp-lawyer' ),
    77         'all_items'                  => __( 'All Practices', 'wp-lawyer' ),
    78         'parent_item'                => __( 'Parent Practice', 'wp-lawyer' ),
    79         'parent_item_colon'          => __( 'Parent Practice:', 'wp-lawyer' ),
    80         'new_item_name'              => __( 'New Practice', 'wp-lawyer' ),
    81         'add_new_item'               => __( 'Add New Practice', 'wp-lawyer' ),
    82         'edit_item'                  => __( 'Edit Practice', 'wp-lawyer' ),
    83         'update_item'                => __( 'Update Practice', 'wp-lawyer' ),
    84         'separate_items_with_commas' => __( 'Separate Practices with commas', 'wp-lawyer' ),
    85         'search_items'               => __( 'Search Practices', 'wp-lawyer' ),
    86         'add_or_remove_items'        => __( 'Add or remove Practices', 'wp-lawyer' ),
    87         'choose_from_most_used'      => __( 'Choose from the most used Practice', 'wp-lawyer' ),
    88         'not_found'                  => __( 'No Practice Found', 'wp-lawyer' ),
    89     );
    90     $args = array(
    91         'labels'                     => $labels,
    92         'hierarchical'               => true,
    93         'public'                     => true,
    94         'show_ui'                    => true,
    95         'show_admin_column'          => true,
    96         'show_in_nav_menus'          => true,
    97         'show_tagcloud'              => true,
    98         'rewrite' => array('slug'=>'attorneys/area-of-practice', 'with_front' => false)
    99     );
    100     register_taxonomy( 'wplawyer-practice-area', array( 'wplawyer-attorney' ), $args );
    101 
    102 }
    103 
    104 // Hook into the 'init' action
    105 add_action( 'init', 'wp_lawyer_attorneys_practicearea', 0 );
    106 
    107 }
    108 
    109 
    110 ###########################################################
     68//
     69if (! function_exists('wp_lawyer_attorneys_practicearea') ) {
     70
     71    // Register Custom Taxonomy
     72    function wp_lawyer_attorneys_practicearea()
     73    {
     74
     75        $labels = array(
     76        'name'                       => _x('Areas of Practice', 'Taxonomy General Name', 'wp-lawyer'),
     77        'singular_name'              => _x('Area of Practice', 'Taxonomy Singular Name', 'wp-lawyer'),
     78        'menu_name'                  => __('Areas of Practice', 'wp-lawyer'),
     79        'all_items'                  => __('All Practices', 'wp-lawyer'),
     80        'parent_item'                => __('Parent Practice', 'wp-lawyer'),
     81        'parent_item_colon'          => __('Parent Practice:', 'wp-lawyer'),
     82        'new_item_name'              => __('New Practice', 'wp-lawyer'),
     83        'add_new_item'               => __('Add New Practice', 'wp-lawyer'),
     84        'edit_item'                  => __('Edit Practice', 'wp-lawyer'),
     85        'update_item'                => __('Update Practice', 'wp-lawyer'),
     86        'separate_items_with_commas' => __('Separate Practices with commas', 'wp-lawyer'),
     87        'search_items'               => __('Search Practices', 'wp-lawyer'),
     88        'add_or_remove_items'        => __('Add or remove Practices', 'wp-lawyer'),
     89        'choose_from_most_used'      => __('Choose from the most used Practice', 'wp-lawyer'),
     90        'not_found'                  => __('No Practice Found', 'wp-lawyer'),
     91        );
     92        $args = array(
     93        'labels'                     => $labels,
     94        'hierarchical'               => true,
     95        'public'                     => true,
     96        'show_ui'                    => true,
     97        'show_admin_column'          => true,
     98        'show_in_nav_menus'          => true,
     99        'show_tagcloud'              => true,
     100        'rewrite' => array('slug'=>'attorneys/area-of-practice', 'with_front' => false)
     101        );
     102        register_taxonomy('wplawyer-practice-area', array( 'wplawyer-attorney' ), $args);
     103
     104    }
     105
     106    // Hook into the 'init' action
     107    add_action('init', 'wp_lawyer_attorneys_practicearea', 0);
     108
     109}
     110
     111
     112//
    111113// Cities of Practice - Taxonomy
    112 ###########################################################
    113 if ( ! function_exists( 'wplawyer_attorney_city' ) ) {
    114 
    115 // Register Custom Taxonomy
    116 function wplawyer_attorney_city() {
    117 
    118     $labels = array(
    119         'name'                       => _x( 'Cities of Practice', 'Taxonomy General Name', 'wp-lawyer' ),
    120         'singular_name'              => _x( 'City', 'Taxonomy Singular Name', 'wp-lawyer' ),
    121         'menu_name'                  => __( 'Cities of Practice', 'wp-lawyer' ),
    122         'all_items'                  => __( 'All Cities', 'wp-lawyer' ),
    123         'parent_item'                => __( 'Parent City', 'wp-lawyer' ),
    124         'parent_item_colon'          => __( 'Parent City:', 'wp-lawyer' ),
    125         'new_item_name'              => __( 'New City', 'wp-lawyer' ),
    126         'add_new_item'               => __( 'Add New City', 'wp-lawyer' ),
    127         'edit_item'                  => __( 'Edit City', 'wp-lawyer' ),
    128         'update_item'                => __( 'Update City', 'wp-lawyer' ),
    129         'separate_items_with_commas' => __( 'Separate Cities with commas', 'wp-lawyer' ),
    130         'search_items'               => __( 'Search Cities', 'wp-lawyer' ),
    131         'add_or_remove_items'        => __( 'Add or remove Cities', 'wp-lawyer' ),
    132         'choose_from_most_used'      => __( 'Choose from the most used Cities', 'wp-lawyer' ),
    133         'not_found'                  => __( 'No City Found', 'wp-lawyer' ),
    134     );
    135     $args = array(
    136         'labels'                     => $labels,
    137         'hierarchical'               => false,
    138         'public'                     => true,
    139         'show_ui'                    => true,
    140         'show_admin_column'          => true,
    141         'show_in_nav_menus'          => true,
    142         'show_tagcloud'              => true,
    143     );
    144     register_taxonomy( 'wplawyer-attorney-city', array( 'wplawyer-attorney' ), $args );
    145 
    146 }
    147 
    148 // Hook into the 'init' action
    149 add_action( 'init', 'wplawyer_attorney_city', 0 );
    150 
    151 }
    152 
    153 
    154 ###########################################################
     114//
     115if (! function_exists('wplawyer_attorney_city') ) {
     116
     117    // Register Custom Taxonomy
     118    function wplawyer_attorney_city()
     119    {
     120
     121        $labels = array(
     122        'name'                       => _x('Cities of Practice', 'Taxonomy General Name', 'wp-lawyer'),
     123        'singular_name'              => _x('City', 'Taxonomy Singular Name', 'wp-lawyer'),
     124        'menu_name'                  => __('Cities of Practice', 'wp-lawyer'),
     125        'all_items'                  => __('All Cities', 'wp-lawyer'),
     126        'parent_item'                => __('Parent City', 'wp-lawyer'),
     127        'parent_item_colon'          => __('Parent City:', 'wp-lawyer'),
     128        'new_item_name'              => __('New City', 'wp-lawyer'),
     129        'add_new_item'               => __('Add New City', 'wp-lawyer'),
     130        'edit_item'                  => __('Edit City', 'wp-lawyer'),
     131        'update_item'                => __('Update City', 'wp-lawyer'),
     132        'separate_items_with_commas' => __('Separate Cities with commas', 'wp-lawyer'),
     133        'search_items'               => __('Search Cities', 'wp-lawyer'),
     134        'add_or_remove_items'        => __('Add or remove Cities', 'wp-lawyer'),
     135        'choose_from_most_used'      => __('Choose from the most used Cities', 'wp-lawyer'),
     136        'not_found'                  => __('No City Found', 'wp-lawyer'),
     137        );
     138        $args = array(
     139        'labels'                     => $labels,
     140        'hierarchical'               => false,
     141        'public'                     => true,
     142        'show_ui'                    => true,
     143        'show_admin_column'          => true,
     144        'show_in_nav_menus'          => true,
     145        'show_tagcloud'              => true,
     146        );
     147        register_taxonomy('wplawyer-attorney-city', array( 'wplawyer-attorney' ), $args);
     148
     149    }
     150
     151    // Hook into the 'init' action
     152    add_action('init', 'wplawyer_attorney_city', 0);
     153
     154}
     155
     156
     157//
    155158// Counties of Practice - Taxonomy
    156 ###########################################################
    157 if ( ! function_exists( 'wplawyer_attorney_county' ) ) {
    158 
    159 // Register Custom Taxonomy
    160 function wplawyer_attorney_county() {
    161 
    162     $labels = array(
    163         'name'                       => _x( 'Counties of Practice', 'Taxonomy General Name', 'wp-lawyer' ),
    164         'singular_name'              => _x( 'County', 'Taxonomy Singular Name', 'wp-lawyer' ),
    165         'menu_name'                  => __( 'Counties of Practice', 'wp-lawyer' ),
    166         'all_items'                  => __( 'All Counties', 'wp-lawyer' ),
    167         'parent_item'                => __( 'Parent County', 'wp-lawyer' ),
    168         'parent_item_colon'          => __( 'Parent County:', 'wp-lawyer' ),
    169         'new_item_name'              => __( 'New County Name', 'wp-lawyer' ),
    170         'add_new_item'               => __( 'Add New County', 'wp-lawyer' ),
    171         'edit_item'                  => __( 'Edit County', 'wp-lawyer' ),
    172         'update_item'                => __( 'Update County', 'wp-lawyer' ),
    173         'separate_items_with_commas' => __( 'Separate Counties with commas', 'wp-lawyer' ),
    174         'search_items'               => __( 'Search Counties', 'wp-lawyer' ),
    175         'add_or_remove_items'        => __( 'Add or remove Counties', 'wp-lawyer' ),
    176         'choose_from_most_used'      => __( 'Choose from the most used Counties', 'wp-lawyer' ),
    177         'not_found'                  => __( 'No County Found', 'wp-lawyer' ),
    178     );
    179     $args = array(
    180         'labels'                     => $labels,
    181         'hierarchical'               => false,
    182         'public'                     => true,
    183         'show_ui'                    => true,
    184         'show_admin_column'          => true,
    185         'show_in_nav_menus'          => true,
    186         'show_tagcloud'              => true,
    187     );
    188     register_taxonomy( 'wplawyer-attorney-county', array( 'wplawyer-attorney' ), $args );
    189 
    190 }
    191 
    192 // Hook into the 'init' action
    193 add_action( 'init', 'wplawyer_attorney_county', 0 );
    194 
    195 }
    196 
    197 ###########################################################
     159//
     160if (! function_exists('wplawyer_attorney_county') ) {
     161
     162    // Register Custom Taxonomy
     163    function wplawyer_attorney_county()
     164    {
     165
     166        $labels = array(
     167        'name'                       => _x('Counties of Practice', 'Taxonomy General Name', 'wp-lawyer'),
     168        'singular_name'              => _x('County', 'Taxonomy Singular Name', 'wp-lawyer'),
     169        'menu_name'                  => __('Counties of Practice', 'wp-lawyer'),
     170        'all_items'                  => __('All Counties', 'wp-lawyer'),
     171        'parent_item'                => __('Parent County', 'wp-lawyer'),
     172        'parent_item_colon'          => __('Parent County:', 'wp-lawyer'),
     173        'new_item_name'              => __('New County Name', 'wp-lawyer'),
     174        'add_new_item'               => __('Add New County', 'wp-lawyer'),
     175        'edit_item'                  => __('Edit County', 'wp-lawyer'),
     176        'update_item'                => __('Update County', 'wp-lawyer'),
     177        'separate_items_with_commas' => __('Separate Counties with commas', 'wp-lawyer'),
     178        'search_items'               => __('Search Counties', 'wp-lawyer'),
     179        'add_or_remove_items'        => __('Add or remove Counties', 'wp-lawyer'),
     180        'choose_from_most_used'      => __('Choose from the most used Counties', 'wp-lawyer'),
     181        'not_found'                  => __('No County Found', 'wp-lawyer'),
     182        );
     183        $args = array(
     184        'labels'                     => $labels,
     185        'hierarchical'               => false,
     186        'public'                     => true,
     187        'show_ui'                    => true,
     188        'show_admin_column'          => true,
     189        'show_in_nav_menus'          => true,
     190        'show_tagcloud'              => true,
     191        );
     192        register_taxonomy('wplawyer-attorney-county', array( 'wplawyer-attorney' ), $args);
     193
     194    }
     195
     196    // Hook into the 'init' action
     197    add_action('init', 'wplawyer_attorney_county', 0);
     198
     199}
     200
     201//
    198202// States of Practice - Taxonomy
    199 ###########################################################
    200 if ( ! function_exists( 'wplawyer_attorney_state' ) ) {
    201 
    202 // Register Custom Taxonomy
    203 function wplawyer_attorney_state() {
    204 
    205     $labels = array(
    206         'name'                       => _x( 'States of Practice', 'Taxonomy General Name', 'wp-lawyer' ),
    207         'singular_name'              => _x( 'State', 'Taxonomy Singular Name', 'wp-lawyer' ),
    208         'menu_name'                  => __( 'States of Practice', 'wp-lawyer' ),
    209         'all_items'                  => __( 'All States', 'wp-lawyer' ),
    210         'parent_item'                => __( 'Parent State', 'wp-lawyer' ),
    211         'parent_item_colon'          => __( 'Parent State:', 'wp-lawyer' ),
    212         'new_item_name'              => __( 'New State', 'wp-lawyer' ),
    213         'add_new_item'               => __( 'Add New State', 'wp-lawyer' ),
    214         'edit_item'                  => __( 'Edit State', 'wp-lawyer' ),
    215         'update_item'                => __( 'Update State', 'wp-lawyer' ),
    216         'separate_items_with_commas' => __( 'Separate States with commas', 'wp-lawyer' ),
    217         'search_items'               => __( 'Search States', 'wp-lawyer' ),
    218         'add_or_remove_items'        => __( 'Add or remove States', 'wp-lawyer' ),
    219         'choose_from_most_used'      => __( 'Choose from the most used States', 'wp-lawyer' ),
    220         'not_found'                  => __( 'No State Found', 'wp-lawyer' ),
    221     );
    222     $args = array(
    223         'labels'                     => $labels,
    224         'hierarchical'               => false,
    225         'public'                     => true,
    226         'show_ui'                    => true,
    227         'show_admin_column'          => true,
    228         'show_in_nav_menus'          => true,
    229         'show_tagcloud'              => true,
    230     );
    231     register_taxonomy( 'wplawyer-attorney-state', array( 'wplawyer-attorney' ), $args );
    232 
    233 }
    234 
    235 // Hook into the 'init' action
    236 add_action( 'init', 'wplawyer_attorney_state', 0 );
    237 
    238 }
    239 
    240 
    241 
    242 ###########################################################
     203//
     204if (! function_exists('wplawyer_attorney_state') ) {
     205
     206    // Register Custom Taxonomy
     207    function wplawyer_attorney_state()
     208    {
     209
     210        $labels = array(
     211        'name'                       => _x('States of Practice', 'Taxonomy General Name', 'wp-lawyer'),
     212        'singular_name'              => _x('State', 'Taxonomy Singular Name', 'wp-lawyer'),
     213        'menu_name'                  => __('States of Practice', 'wp-lawyer'),
     214        'all_items'                  => __('All States', 'wp-lawyer'),
     215        'parent_item'                => __('Parent State', 'wp-lawyer'),
     216        'parent_item_colon'          => __('Parent State:', 'wp-lawyer'),
     217        'new_item_name'              => __('New State', 'wp-lawyer'),
     218        'add_new_item'               => __('Add New State', 'wp-lawyer'),
     219        'edit_item'                  => __('Edit State', 'wp-lawyer'),
     220        'update_item'                => __('Update State', 'wp-lawyer'),
     221        'separate_items_with_commas' => __('Separate States with commas', 'wp-lawyer'),
     222        'search_items'               => __('Search States', 'wp-lawyer'),
     223        'add_or_remove_items'        => __('Add or remove States', 'wp-lawyer'),
     224        'choose_from_most_used'      => __('Choose from the most used States', 'wp-lawyer'),
     225        'not_found'                  => __('No State Found', 'wp-lawyer'),
     226        );
     227        $args = array(
     228        'labels'                     => $labels,
     229        'hierarchical'               => false,
     230        'public'                     => true,
     231        'show_ui'                    => true,
     232        'show_admin_column'          => true,
     233        'show_in_nav_menus'          => true,
     234        'show_tagcloud'              => true,
     235        );
     236        register_taxonomy('wplawyer-attorney-state', array( 'wplawyer-attorney' ), $args);
     237
     238    }
     239
     240    // Hook into the 'init' action
     241    add_action('init', 'wplawyer_attorney_state', 0);
     242
     243}
     244
     245
     246
     247//
    243248// Attorney District - Taxonomy
    244 ###########################################################
    245 if ( ! function_exists( 'wplawyer_attorney_district' ) ) {
    246 
    247 // Register Custom Taxonomy
    248 function wplawyer_attorney_district() {
    249 
    250     $labels = array(
    251         'name'                       => _x( 'Districts', 'Taxonomy General Name', 'wp-lawyer' ),
    252         'singular_name'              => _x( 'district', 'Taxonomy Singular Name', 'wp-lawyer' ),
    253         'menu_name'                  => __( 'Districts', 'wp-lawyer' ),
    254         'all_items'                  => __( 'All Districts', 'wp-lawyer' ),
    255         'parent_item'                => __( 'Parent district', 'wp-lawyer' ),
    256         'parent_item_colon'          => __( 'Parent district:', 'wp-lawyer' ),
    257         'new_item_name'              => __( 'New district Name', 'wp-lawyer' ),
    258         'add_new_item'               => __( 'Add New district', 'wp-lawyer' ),
    259         'edit_item'                  => __( 'Edit district', 'wp-lawyer' ),
    260         'update_item'                => __( 'Update district', 'wp-lawyer' ),
    261         'separate_items_with_commas' => __( 'Separate Districts with commas', 'wp-lawyer' ),
    262         'search_items'               => __( 'Search Districts', 'wp-lawyer' ),
    263         'add_or_remove_items'        => __( 'Add or remove Districts', 'wp-lawyer' ),
    264         'choose_from_most_used'      => __( 'Choose from the most used Districts', 'wp-lawyer' ),
    265         'not_found'                  => __( 'No District Found', 'wp-lawyer' ),
    266     );
    267     $args = array(
    268         'labels'                     => $labels,
    269         'hierarchical'               => false,
    270         'public'                     => true,
    271         'show_ui'                    => true,
    272         'show_admin_column'          => true,
    273         'show_in_nav_menus'          => true,
    274         'show_tagcloud'              => true,
    275     );
    276     register_taxonomy( 'wplawyer-attorney-district', array( 'wplawyer-attorney' ), $args );
    277 
    278 }
    279 
    280 // Hook into the 'init' action
    281 add_action( 'init', 'wplawyer_attorney_district', 0 );
    282 
    283 }
    284 
    285 
    286 ################################################################################
     249//
     250if (! function_exists('wplawyer_attorney_district') ) {
     251
     252    // Register Custom Taxonomy
     253    function wplawyer_attorney_district()
     254    {
     255
     256        $labels = array(
     257        'name'                       => _x('Districts', 'Taxonomy General Name', 'wp-lawyer'),
     258        'singular_name'              => _x('district', 'Taxonomy Singular Name', 'wp-lawyer'),
     259        'menu_name'                  => __('Districts', 'wp-lawyer'),
     260        'all_items'                  => __('All Districts', 'wp-lawyer'),
     261        'parent_item'                => __('Parent district', 'wp-lawyer'),
     262        'parent_item_colon'          => __('Parent district:', 'wp-lawyer'),
     263        'new_item_name'              => __('New district Name', 'wp-lawyer'),
     264        'add_new_item'               => __('Add New district', 'wp-lawyer'),
     265        'edit_item'                  => __('Edit district', 'wp-lawyer'),
     266        'update_item'                => __('Update district', 'wp-lawyer'),
     267        'separate_items_with_commas' => __('Separate Districts with commas', 'wp-lawyer'),
     268        'search_items'               => __('Search Districts', 'wp-lawyer'),
     269        'add_or_remove_items'        => __('Add or remove Districts', 'wp-lawyer'),
     270        'choose_from_most_used'      => __('Choose from the most used Districts', 'wp-lawyer'),
     271        'not_found'                  => __('No District Found', 'wp-lawyer'),
     272        );
     273        $args = array(
     274        'labels'                     => $labels,
     275        'hierarchical'               => false,
     276        'public'                     => true,
     277        'show_ui'                    => true,
     278        'show_admin_column'          => true,
     279        'show_in_nav_menus'          => true,
     280        'show_tagcloud'              => true,
     281        );
     282        register_taxonomy('wplawyer-attorney-district', array( 'wplawyer-attorney' ), $args);
     283
     284    }
     285
     286    // Hook into the 'init' action
     287    add_action('init', 'wplawyer_attorney_district', 0);
     288
     289}
     290
     291
     292//
    287293// Law School - Taxonomy
    288 ################################################################################
    289 if ( ! function_exists( 'wplawyer_attorney_lawschool' ) ) {
    290 
    291 // Register Custom Taxonomy
    292 function wplawyer_attorney_lawschool() {
    293 
    294     $labels = array(
    295         'name'                       => _x( 'Law Schools', 'Taxonomy General Name', 'wp-lawyer' ),
    296         'singular_name'              => _x( 'Law School', 'Taxonomy Singular Name', 'wp-lawyer' ),
    297         'menu_name'                  => __( 'Law Schools', 'wp-lawyer' ),
    298         'all_items'                  => __( 'All Law Schools', 'wp-lawyer' ),
    299         'parent_item'                => __( 'Parent Law School', 'wp-lawyer' ),
    300         'parent_item_colon'          => __( 'Parent Law School:', 'wp-lawyer' ),
    301         'new_item_name'              => __( 'New Law School', 'wp-lawyer' ),
    302         'add_new_item'               => __( 'Add New Law School', 'wp-lawyer' ),
    303         'edit_item'                  => __( 'Edit Law School', 'wp-lawyer' ),
    304         'update_item'                => __( 'Update Law School', 'wp-lawyer' ),
    305         'separate_items_with_commas' => __( 'Separate Law Schools with commas', 'wp-lawyer' ),
    306         'search_items'               => __( 'Search Law School', 'wp-lawyer' ),
    307         'add_or_remove_items'        => __( 'Add or remove Law Schools', 'wp-lawyer' ),
    308         'choose_from_most_used'      => __( 'Choose from the most used Law Schools', 'wp-lawyer' ),
    309         'not_found'                  => __( 'No Law Schools Found', 'wp-lawyer' ),
    310     );
    311     $args = array(
    312         'labels'                     => $labels,
    313         'hierarchical'               => false,
    314         'public'                     => true,
    315         'show_ui'                    => true,
    316         'show_admin_column'          => true,
    317         'show_in_nav_menus'          => true,
    318         'show_tagcloud'              => true,
    319     );
    320     register_taxonomy( 'wplawyer-attorney-lawschool', array( 'wplawyer-attorney' ), $args );
    321 
    322 }
    323 
    324 // Hook into the 'init' action
    325 add_action( 'init', 'wplawyer_attorney_lawschool', 0 );
    326 
    327 }
    328 
    329 
    330 ################################################################################
     294//
     295if (! function_exists('wplawyer_attorney_lawschool') ) {
     296
     297    // Register Custom Taxonomy
     298    function wplawyer_attorney_lawschool()
     299    {
     300
     301        $labels = array(
     302        'name'                       => _x('Law Schools', 'Taxonomy General Name', 'wp-lawyer'),
     303        'singular_name'              => _x('Law School', 'Taxonomy Singular Name', 'wp-lawyer'),
     304        'menu_name'                  => __('Law Schools', 'wp-lawyer'),
     305        'all_items'                  => __('All Law Schools', 'wp-lawyer'),
     306        'parent_item'                => __('Parent Law School', 'wp-lawyer'),
     307        'parent_item_colon'          => __('Parent Law School:', 'wp-lawyer'),
     308        'new_item_name'              => __('New Law School', 'wp-lawyer'),
     309        'add_new_item'               => __('Add New Law School', 'wp-lawyer'),
     310        'edit_item'                  => __('Edit Law School', 'wp-lawyer'),
     311        'update_item'                => __('Update Law School', 'wp-lawyer'),
     312        'separate_items_with_commas' => __('Separate Law Schools with commas', 'wp-lawyer'),
     313        'search_items'               => __('Search Law School', 'wp-lawyer'),
     314        'add_or_remove_items'        => __('Add or remove Law Schools', 'wp-lawyer'),
     315        'choose_from_most_used'      => __('Choose from the most used Law Schools', 'wp-lawyer'),
     316        'not_found'                  => __('No Law Schools Found', 'wp-lawyer'),
     317        );
     318        $args = array(
     319        'labels'                     => $labels,
     320        'hierarchical'               => false,
     321        'public'                     => true,
     322        'show_ui'                    => true,
     323        'show_admin_column'          => true,
     324        'show_in_nav_menus'          => true,
     325        'show_tagcloud'              => true,
     326        );
     327        register_taxonomy('wplawyer-attorney-lawschool', array( 'wplawyer-attorney' ), $args);
     328
     329    }
     330
     331    // Hook into the 'init' action
     332    add_action('init', 'wplawyer_attorney_lawschool', 0);
     333
     334}
     335
     336
     337//
    331338// Undergraduate Schools - Taxonomy
    332 ################################################################################
    333 if ( ! function_exists( 'wplawyer_attorney_undergraduateschool' ) ) {
    334 
    335 // Register Custom Taxonomy
    336 function wplawyer_attorney_undergraduateschool() {
    337 
    338     $labels = array(
    339         'name'                       => _x( 'Undergraduate Schools', 'Taxonomy General Name', 'wp-lawyer' ),
    340         'singular_name'              => _x( 'Undergraduate School', 'Taxonomy Singular Name', 'wp-lawyer' ),
    341         'menu_name'                  => __( 'Undergraduate Schools', 'wp-lawyer' ),
    342         'all_items'                  => __( 'All Undergraduate Schools', 'wp-lawyer' ),
    343         'parent_item'                => __( 'Parent Undergraduate School', 'wp-lawyer' ),
    344         'parent_item_colon'          => __( 'Parent Undergraduate School:', 'wp-lawyer' ),
    345         'new_item_name'              => __( 'New Undergraduate School', 'wp-lawyer' ),
    346         'add_new_item'               => __( 'Add New Undergraduate School', 'wp-lawyer' ),
    347         'edit_item'                  => __( 'Edit Undergraduate School', 'wp-lawyer' ),
    348         'update_item'                => __( 'Update Undergraduate School', 'wp-lawyer' ),
    349         'separate_items_with_commas' => __( 'Separate Undergraduate Schools with commas', 'wp-lawyer' ),
    350         'search_items'               => __( 'Search Undergraduate School', 'wp-lawyer' ),
    351         'add_or_remove_items'        => __( 'Add or remove Undergraduate Schools', 'wp-lawyer' ),
    352         'choose_from_most_used'      => __( 'Choose from the most used Undergraduate Schools', 'wp-lawyer' ),
    353         'not_found'                  => __( 'No Undergraduate Schools Found', 'wp-lawyer' ),
    354     );
    355     $args = array(
    356         'labels'                     => $labels,
    357         'hierarchical'               => false,
    358         'public'                     => true,
    359         'show_ui'                    => true,
    360         'show_admin_column'          => true,
    361         'show_in_nav_menus'          => true,
    362         'show_tagcloud'              => true,
    363     );
    364     register_taxonomy( 'wplawyer-attorney-undergrad', array( 'wplawyer-attorney' ), $args );
    365 
    366 }
    367 
    368 // Hook into the 'init' action
    369 add_action( 'init', 'wplawyer_attorney_undergraduateschool', 0 );
    370 
    371 }
    372 
    373 ################################################################################
     339//
     340if (! function_exists('wplawyer_attorney_undergraduateschool') ) {
     341
     342    // Register Custom Taxonomy
     343    function wplawyer_attorney_undergraduateschool()
     344    {
     345
     346        $labels = array(
     347        'name'                       => _x('Undergraduate Schools', 'Taxonomy General Name', 'wp-lawyer'),
     348        'singular_name'              => _x('Undergraduate School', 'Taxonomy Singular Name', 'wp-lawyer'),
     349        'menu_name'                  => __('Undergraduate Schools', 'wp-lawyer'),
     350        'all_items'                  => __('All Undergraduate Schools', 'wp-lawyer'),
     351        'parent_item'                => __('Parent Undergraduate School', 'wp-lawyer'),
     352        'parent_item_colon'          => __('Parent Undergraduate School:', 'wp-lawyer'),
     353        'new_item_name'              => __('New Undergraduate School', 'wp-lawyer'),
     354        'add_new_item'               => __('Add New Undergraduate School', 'wp-lawyer'),
     355        'edit_item'                  => __('Edit Undergraduate School', 'wp-lawyer'),
     356        'update_item'                => __('Update Undergraduate School', 'wp-lawyer'),
     357        'separate_items_with_commas' => __('Separate Undergraduate Schools with commas', 'wp-lawyer'),
     358        'search_items'               => __('Search Undergraduate School', 'wp-lawyer'),
     359        'add_or_remove_items'        => __('Add or remove Undergraduate Schools', 'wp-lawyer'),
     360        'choose_from_most_used'      => __('Choose from the most used Undergraduate Schools', 'wp-lawyer'),
     361        'not_found'                  => __('No Undergraduate Schools Found', 'wp-lawyer'),
     362        );
     363        $args = array(
     364        'labels'                     => $labels,
     365        'hierarchical'               => false,
     366        'public'                     => true,
     367        'show_ui'                    => true,
     368        'show_admin_column'          => true,
     369        'show_in_nav_menus'          => true,
     370        'show_tagcloud'              => true,
     371        );
     372        register_taxonomy('wplawyer-attorney-undergrad', array( 'wplawyer-attorney' ), $args);
     373
     374    }
     375
     376    // Hook into the 'init' action
     377    add_action('init', 'wplawyer_attorney_undergraduateschool', 0);
     378
     379}
     380
     381//
    374382// Languages - Taxonomy
    375 ################################################################################
    376 if ( ! function_exists( 'wplawyer_attorney_languages' ) ) {
    377 
    378 // Register Custom Taxonomy
    379 function wplawyer_attorney_languages() {
    380 
    381     $labels = array(
    382         'name'                       => _x( 'Languages', 'Taxonomy General Name', 'wp-lawyer' ),
    383         'singular_name'              => _x( 'Language', 'Taxonomy Singular Name', 'wp-lawyer' ),
    384         'menu_name'                  => __( 'Languages', 'wp-lawyer' ),
    385         'all_items'                  => __( 'All Languages', 'wp-lawyer' ),
    386         'parent_item'                => __( 'Parent Language', 'wp-lawyer' ),
    387         'parent_item_colon'          => __( 'Parent Language:', 'wp-lawyer' ),
    388         'new_item_name'              => __( 'New Language', 'wp-lawyer' ),
    389         'add_new_item'               => __( 'Add Language', 'wp-lawyer' ),
    390         'edit_item'                  => __( 'Edit Language', 'wp-lawyer' ),
    391         'update_item'                => __( 'Update Language', 'wp-lawyer' ),
    392         'separate_items_with_commas' => __( 'Separate Languages with commas', 'wp-lawyer' ),
    393         'search_items'               => __( 'Search Languages', 'wp-lawyer' ),
    394         'add_or_remove_items'        => __( 'Add or remove Languages', 'wp-lawyer' ),
    395         'choose_from_most_used'      => __( 'Choose from the most used Languages', 'wp-lawyer' ),
    396         'not_found'                  => __( 'No Languages Found', 'wp-lawyer' ),
    397     );
    398     $args = array(
    399         'labels'                     => $labels,
    400         'hierarchical'               => false,
    401         'public'                     => true,
    402         'show_ui'                    => true,
    403         'show_admin_column'          => true,
    404         'show_in_nav_menus'          => true,
    405         'show_tagcloud'              => true,
    406     );
    407     register_taxonomy( 'wplawyer-attorney-languages', array( 'wplawyer-attorney' ), $args );
    408 
    409 }
    410 
    411 // Hook into the 'init' action
    412 add_action( 'init', 'wplawyer_attorney_languages', 0 );
    413 
    414 }
    415 
    416 
    417 ################################################################################
     383//
     384if (! function_exists('wplawyer_attorney_languages') ) {
     385
     386    // Register Custom Taxonomy
     387    function wplawyer_attorney_languages()
     388    {
     389
     390        $labels = array(
     391        'name'                       => _x('Languages', 'Taxonomy General Name', 'wp-lawyer'),
     392        'singular_name'              => _x('Language', 'Taxonomy Singular Name', 'wp-lawyer'),
     393        'menu_name'                  => __('Languages', 'wp-lawyer'),
     394        'all_items'                  => __('All Languages', 'wp-lawyer'),
     395        'parent_item'                => __('Parent Language', 'wp-lawyer'),
     396        'parent_item_colon'          => __('Parent Language:', 'wp-lawyer'),
     397        'new_item_name'              => __('New Language', 'wp-lawyer'),
     398        'add_new_item'               => __('Add Language', 'wp-lawyer'),
     399        'edit_item'                  => __('Edit Language', 'wp-lawyer'),
     400        'update_item'                => __('Update Language', 'wp-lawyer'),
     401        'separate_items_with_commas' => __('Separate Languages with commas', 'wp-lawyer'),
     402        'search_items'               => __('Search Languages', 'wp-lawyer'),
     403        'add_or_remove_items'        => __('Add or remove Languages', 'wp-lawyer'),
     404        'choose_from_most_used'      => __('Choose from the most used Languages', 'wp-lawyer'),
     405        'not_found'                  => __('No Languages Found', 'wp-lawyer'),
     406        );
     407        $args = array(
     408        'labels'                     => $labels,
     409        'hierarchical'               => false,
     410        'public'                     => true,
     411        'show_ui'                    => true,
     412        'show_admin_column'          => true,
     413        'show_in_nav_menus'          => true,
     414        'show_tagcloud'              => true,
     415        );
     416        register_taxonomy('wplawyer-attorney-languages', array( 'wplawyer-attorney' ), $args);
     417
     418    }
     419
     420    // Hook into the 'init' action
     421    add_action('init', 'wplawyer_attorney_languages', 0);
     422
     423}
     424
     425
     426//
    418427// Associations - Taxonomy
    419 ################################################################################
    420 if ( ! function_exists( 'wplawyer_attorney_associations' ) ) {
    421 
    422 // Register Custom Taxonomy
    423 function wplawyer_attorney_associations() {
    424 
    425     $labels = array(
    426         'name'                       => _x( 'Associations', 'Taxonomy General Name', 'wp-lawyer' ),
    427         'singular_name'              => _x( 'Association', 'Taxonomy Singular Name', 'wp-lawyer' ),
    428         'menu_name'                  => __( 'Associations', 'wp-lawyer' ),
    429         'all_items'                  => __( 'All Associations', 'wp-lawyer' ),
    430         'parent_item'                => __( 'Parent Association', 'wp-lawyer' ),
    431         'parent_item_colon'          => __( 'Parent Association:', 'wp-lawyer' ),
    432         'new_item_name'              => __( 'New Association', 'wp-lawyer' ),
    433         'add_new_item'               => __( 'Add Association', 'wp-lawyer' ),
    434         'edit_item'                  => __( 'Edit Association', 'wp-lawyer' ),
    435         'update_item'                => __( 'Update Association', 'wp-lawyer' ),
    436         'separate_items_with_commas' => __( 'Separate Associations with commas', 'wp-lawyer' ),
    437         'search_items'               => __( 'Search Associations', 'wp-lawyer' ),
    438         'add_or_remove_items'        => __( 'Add or remove Associations', 'wp-lawyer' ),
    439         'choose_from_most_used'      => __( 'Choose from the most used Associations', 'wp-lawyer' ),
    440         'not_found'                  => __( 'No Associations Found', 'wp-lawyer' ),
    441     );
    442     $args = array(
    443         'labels'                     => $labels,
    444         'hierarchical'               => false,
    445         'public'                     => true,
    446         'show_ui'                    => true,
    447         'show_admin_column'          => true,
    448         'show_in_nav_menus'          => true,
    449         'show_tagcloud'              => true,
    450     );
    451     register_taxonomy( 'wplawyer-attorney-associations', array( 'wplawyer-attorney' ), $args );
    452 
    453 }
    454 
    455 // Hook into the 'init' action
    456 add_action( 'init', 'wplawyer_attorney_associations', 0 );
    457 
    458 }
    459 
    460 
    461 ################################################################################
     428//
     429if (! function_exists('wplawyer_attorney_associations') ) {
     430
     431    // Register Custom Taxonomy
     432    function wplawyer_attorney_associations()
     433    {
     434
     435        $labels = array(
     436        'name'                       => _x('Associations', 'Taxonomy General Name', 'wp-lawyer'),
     437        'singular_name'              => _x('Association', 'Taxonomy Singular Name', 'wp-lawyer'),
     438        'menu_name'                  => __('Associations', 'wp-lawyer'),
     439        'all_items'                  => __('All Associations', 'wp-lawyer'),
     440        'parent_item'                => __('Parent Association', 'wp-lawyer'),
     441        'parent_item_colon'          => __('Parent Association:', 'wp-lawyer'),
     442        'new_item_name'              => __('New Association', 'wp-lawyer'),
     443        'add_new_item'               => __('Add Association', 'wp-lawyer'),
     444        'edit_item'                  => __('Edit Association', 'wp-lawyer'),
     445        'update_item'                => __('Update Association', 'wp-lawyer'),
     446        'separate_items_with_commas' => __('Separate Associations with commas', 'wp-lawyer'),
     447        'search_items'               => __('Search Associations', 'wp-lawyer'),
     448        'add_or_remove_items'        => __('Add or remove Associations', 'wp-lawyer'),
     449        'choose_from_most_used'      => __('Choose from the most used Associations', 'wp-lawyer'),
     450        'not_found'                  => __('No Associations Found', 'wp-lawyer'),
     451        );
     452        $args = array(
     453        'labels'                     => $labels,
     454        'hierarchical'               => false,
     455        'public'                     => true,
     456        'show_ui'                    => true,
     457        'show_admin_column'          => true,
     458        'show_in_nav_menus'          => true,
     459        'show_tagcloud'              => true,
     460        );
     461        register_taxonomy('wplawyer-attorney-associations', array( 'wplawyer-attorney' ), $args);
     462
     463    }
     464
     465    // Hook into the 'init' action
     466    add_action('init', 'wplawyer_attorney_associations', 0);
     467
     468}
     469
     470
     471//
    462472// Setup Meta Boxes
    463 ################################################################################
     473//
    464474
    465475$wplawyer_attorney_prefix = 'wplawyer_';
     
    484494            'std' => ''
    485495        ),
    486         array(
     496        array(
    487497            'name' => 'Address',
    488498            'id' => $wplawyer_attorney_prefix . 'attorney_address',
     
    549559
    550560
    551 ################################################################################
     561//
    552562// Add Meta Box
    553 ################################################################################
    554 function wplawyer_add_attorney_metaboxes() {
     563//
     564function wplawyer_add_attorney_metaboxes()
     565{
    555566    global $wplawyer_attorney_meta_box;
    556567    add_meta_box($wplawyer_attorney_meta_box['id'], $wplawyer_attorney_meta_box['title'], 'wplawyer_attorney_show_box', $wplawyer_attorney_meta_box['page'], $wplawyer_attorney_meta_box['context'], $wplawyer_attorney_meta_box['priority']);
     
    558569
    559570// Callback function to show fields in meta box
    560 function wplawyer_attorney_show_box() {
     571function wplawyer_attorney_show_box()
     572{
    561573    global $wplawyer_attorney_meta_box, $post;
    562574
     
    566578    echo '<table class="form-table" style="overflow:hidden;">';
    567579
    568     foreach ($wplawyer_attorney_meta_box['fields'] as $field) {
    569         // get current post meta data
    570         $wplawyer_attorney_meta = get_post_meta($post->ID, $field['id'], true);
    571 
    572 
    573         switch ($field['type']) {
    574 
    575             case 'text':
    576                 echo '<tr>',
    577                 '<th style="width:15%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    578                 '<td>';
    579                 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $wplawyer_attorney_meta ? $wplawyer_attorney_meta : $field['std'], '" size="20" style="width:50%; min-width:150px;" />', '<br />', isset($field['desc']);
    580                 echo     '</td>','</tr>';
    581             break;
    582             case 'social_one':
    583                 echo '<tr><td colspan="2"><hr style="background:#ddd; border:0px; height:1px; position:relative; width:100%;" /><h4>Social Media Profiles</h4></td></tr>', '<tr>', '<th style="width:15%"><label for="', $field['id'], '">', $field['name'], '</label></th>', '<td>';
    584                 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $wplawyer_attorney_meta ? $wplawyer_attorney_meta : $field['std'], '" size="20" style="width:50%; min-width:150px;" />', '<br />', isset($field['desc']);
    585                 echo     '</td>','</tr>';
    586             break;
    587 
    588         }
    589 
    590     }
    591     echo '</table>';
    592     }
    593 
    594 
    595 ################################################################################
     580    foreach ($wplawyer_attorney_meta_box['fields'] as $field) {
     581        // get current post meta data
     582        $wplawyer_attorney_meta = get_post_meta($post->ID, $field['id'], true);
     583
     584
     585        switch ($field['type']) {
     586
     587        case 'text':
     588            echo '<tr>',
     589            '<th style="width:15%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
     590            '<td>';
     591            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $wplawyer_attorney_meta ? $wplawyer_attorney_meta : $field['std'], '" size="20" style="width:50%; min-width:150px;" />', '<br />', isset($field['desc']);
     592            echo     '</td>','</tr>';
     593            break;
     594        case 'social_one':
     595            echo '<tr><td colspan="2"><hr style="background:#ddd; border:0px; height:1px; position:relative; width:100%;" /><h4>Social Media Profiles</h4></td></tr>', '<tr>', '<th style="width:15%"><label for="', $field['id'], '">', $field['name'], '</label></th>', '<td>';
     596            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $wplawyer_attorney_meta ? $wplawyer_attorney_meta : $field['std'], '" size="20" style="width:50%; min-width:150px;" />', '<br />', isset($field['desc']);
     597            echo     '</td>','</tr>';
     598            break;
     599
     600        }
     601
     602    }
     603    echo '</table>';
     604}
     605
     606
     607//
    596608// Save MetaBox Data
    597 ################################################################################
     609//
    598610add_action('save_post', 'wplawyer_attorney_save_data');
    599611
    600 function wplawyer_attorney_save_data($post_id) {
     612function wplawyer_attorney_save_data($post_id)
     613{
    601614    global $wplawyer_attorney_meta_box;
    602615
    603616    // Verify Nonce
    604     if ( isset($_POST['wplawyer_attorney_meta_box_nonce']) && !wp_verify_nonce( $_POST['wplawyer_attorney_meta_box_nonce'], basename(__FILE__))) {
     617    if (isset($_POST['wplawyer_attorney_meta_box_nonce']) && !wp_verify_nonce($_POST['wplawyer_attorney_meta_box_nonce'], basename(__FILE__))) {
    605618        return $post_id;
    606619    }
    607620
    608621    // check autosave
    609     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
    610     return;
     622    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
     623        return;
     624    }
    611625
    612626    // check permissions
    613     if (!current_user_can('edit_post', $post_id))
    614     return;
     627    if (!current_user_can('edit_post', $post_id)) {
     628        return;
     629    }
    615630
    616631    foreach ($wplawyer_attorney_meta_box['fields'] as $field) {
     
    618633
    619634        if (!empty($_POST[$field['id']])) {
    620         $wplawyer_attorney_new = $_POST[$field['id']];
    621         } else {
    622             $wplawyer_attorney_new = '';
    623         }
    624 
    625         if ( $wplawyer_attorney_new && $wplawyer_attorney_new != $wplawyer_attorney_old) {
     635            $wplawyer_attorney_new = $_POST[$field['id']];
     636        } else {
     637            $wplawyer_attorney_new = '';
     638        }
     639
     640        if ($wplawyer_attorney_new && $wplawyer_attorney_new != $wplawyer_attorney_old) {
    626641            update_post_meta($post_id, $field['id'], $wplawyer_attorney_new);
    627642        } elseif ('' == $wplawyer_attorney_new && $wplawyer_attorney_old) {
     
    633648
    634649
    635 ################################################################################
     650//
    636651// Template Functions
    637 ################################################################################
     652//
    638653
    639654// Attorney Title
    640 function wplawyer_attorney_title() {
    641     global $wplawyer_attorney_title;
    642     $wplawyer_attorney_title = get_post_meta(get_the_ID(), 'wplawyer_attorney_title', true);
    643     if ($wplawyer_attorney_title == '') { } else {
    644         echo '<span id="attorney-title-label">Title:</span>&nbsp;<span id="attorney-title">' . $wplawyer_attorney_title . '</span>';
    645     }
    646 }
    647 
    648 function wplawyer_attorney_title_nolabel() {
    649     global $wplawyer_attorney_title;
    650     $wplawyer_attorney_title = get_post_meta(get_the_ID(), 'wplawyer_attorney_title', true);
    651     if ($wplawyer_attorney_title == '') { } else {
    652         echo '<span id="attorney-title">' . $wplawyer_attorney_title . '</span>';
    653     }
     655function wplawyer_attorney_title()
     656{
     657    global $wplawyer_attorney_title;
     658    $wplawyer_attorney_title = get_post_meta(get_the_ID(), 'wplawyer_attorney_title', true);
     659    if ($wplawyer_attorney_title == '') {
     660    } else {
     661         echo '<span id="attorney-title-label">Title:</span>&nbsp;<span id="attorney-title">' . $wplawyer_attorney_title . '</span>';
     662    }
     663}
     664
     665function wplawyer_attorney_title_nolabel()
     666{
     667    global $wplawyer_attorney_title;
     668    $wplawyer_attorney_title = get_post_meta(get_the_ID(), 'wplawyer_attorney_title', true);
     669    if ($wplawyer_attorney_title == '') {
     670    } else {
     671         echo '<span id="attorney-title">' . $wplawyer_attorney_title . '</span>';
     672    }
    654673}
    655674
    656675// Attorney Bar Number
    657 function wplawyer_attorney_bar_number() {
    658     $wplawyer_attorney_barnumber = get_post_meta(get_the_ID(), 'wplawyer_attorney_bar_number', true);
    659     if ($wplawyer_attorney_barnumber == '') { } else {
    660         echo '<span id="attorney-bar-number-label">Bar Number:</span>&nbsp;<span id="attorney-bar-number">' . $wplawyer_attorney_barnumber . '</span>';  }
    661 }
    662 
    663 function wplawyer_attorney_bar_number_nolabel() {
    664     $wplawyer_attorney_barnumber = get_post_meta(get_the_ID(), 'wplawyer_attorney_bar_number', true);
    665     if ($wplawyer_attorney_barnumber == '') { } else {
    666         echo '<span id="attorney-bar-number">' . $wplawyer_attorney_barnumber . '</span>';   }
     676function wplawyer_attorney_bar_number()
     677{
     678    $wplawyer_attorney_barnumber = get_post_meta(get_the_ID(), 'wplawyer_attorney_bar_number', true);
     679    if ($wplawyer_attorney_barnumber == '') {
     680    } else {
     681         echo '<span id="attorney-bar-number-label">Bar Number:</span>&nbsp;<span id="attorney-bar-number">' . $wplawyer_attorney_barnumber . '</span>';     
     682    }
     683}
     684
     685function wplawyer_attorney_bar_number_nolabel()
     686{
     687    $wplawyer_attorney_barnumber = get_post_meta(get_the_ID(), 'wplawyer_attorney_bar_number', true);
     688    if ($wplawyer_attorney_barnumber == '') {
     689    } else {
     690         echo '<span id="attorney-bar-number">' . $wplawyer_attorney_barnumber . '</span>';     
     691    }
    667692}
    668693
    669694// Attorney Address
    670 function wplawyer_attorney_address() {
    671     $wplawyer_attorney_address = get_post_meta(get_the_ID(), 'wplawyer_attorney_address', true);
    672     if ($wplawyer_attorney_address == '') { } else {
    673         echo '<span id="attorney-address-label">Location:</span>&nbsp;<span id="attorney-address">' . $wplawyer_attorney_address . '</span>';    }
    674 }
    675 
    676 function wplawyer_attorney_address_nolabel() {
    677     $wplawyer_attorney_address = get_post_meta(get_the_ID(), 'wplawyer_attorney_address', true);
    678     if ($wplawyer_attorney_address == '') { } else {
    679         echo '<span id="attorney-address">' . $wplawyer_attorney_address . '</span>';    }
     695function wplawyer_attorney_address()
     696{
     697    $wplawyer_attorney_address = get_post_meta(get_the_ID(), 'wplawyer_attorney_address', true);
     698    if ($wplawyer_attorney_address == '') {
     699    } else {
     700         echo '<span id="attorney-address-label">Location:</span>&nbsp;<span id="attorney-address">' . $wplawyer_attorney_address . '</span>';     
     701    }
     702}
     703
     704function wplawyer_attorney_address_nolabel()
     705{
     706    $wplawyer_attorney_address = get_post_meta(get_the_ID(), 'wplawyer_attorney_address', true);
     707    if ($wplawyer_attorney_address == '') {
     708    } else {
     709         echo '<span id="attorney-address">' . $wplawyer_attorney_address . '</span>';     
     710    }
    680711}
    681712
    682713// Attorney Email
    683 function wplawyer_attorney_email() {
    684     $wplawyer_attorney_email = get_post_meta(get_the_ID(), 'wplawyer_attorney_email', true);
    685     if ($wplawyer_attorney_email == '') { } else {
    686         echo '<span id="attorney-email-label">Email:</span>&nbsp;<a id="attorney-email" href="mailto:'. antispambot($wplawyer_attorney_email) .'">'. antispambot($wplawyer_attorney_email) .'</a>';
    687      }
    688 }
    689 
    690 function wplawyer_attorney_email_nolabel() {
    691     $wplawyer_attorney_email = get_post_meta(get_the_ID(), 'wplawyer_attorney_email', true);
    692     if ($wplawyer_attorney_email == '') { } else {
    693         echo '<a id="attorney-email" href="mailto:'. antispambot($wplawyer_attorney_email) .'">'. antispambot($wplawyer_attorney_email) .'</a>';
    694      }
     714function wplawyer_attorney_email()
     715{
     716    $wplawyer_attorney_email = get_post_meta(get_the_ID(), 'wplawyer_attorney_email', true);
     717    if ($wplawyer_attorney_email == '') {
     718    } else {
     719         echo '<span id="attorney-email-label">Email:</span>&nbsp;<a id="attorney-email" href="mailto:'. antispambot($wplawyer_attorney_email) .'">'. antispambot($wplawyer_attorney_email) .'</a>';
     720    }
     721}
     722
     723function wplawyer_attorney_email_nolabel()
     724{
     725    $wplawyer_attorney_email = get_post_meta(get_the_ID(), 'wplawyer_attorney_email', true);
     726    if ($wplawyer_attorney_email == '') {
     727    } else {
     728         echo '<a id="attorney-email" href="mailto:'. antispambot($wplawyer_attorney_email) .'">'. antispambot($wplawyer_attorney_email) .'</a>';
     729    }
    695730}
    696731
    697732// Attorney Mobile Phone
    698 function wplawyer_attorney_mobile() {
    699     $wplawyer_attorney_mobile = get_post_meta(get_the_ID(), 'wplawyer_attorney_mobile_number', true);
    700     if ($wplawyer_attorney_mobile == '') { } else {
    701         echo '<span id="attorney-mobile-label">Phone:</span>&nbsp;<a id="attorney-mobile" href="tel:' . $wplawyer_attorney_mobile . '">' . $wplawyer_attorney_mobile . '</a>';   }
    702 }
    703 
    704 function wplawyer_attorney_mobile_nolabel() {
    705     $wplawyer_attorney_mobile = get_post_meta(get_the_ID(), 'wplawyer_attorney_mobile_number', true);
    706     if ($wplawyer_attorney_mobile == '') { } else {
    707         echo '<a id="attorney-mobile" href="tel:' . $wplawyer_attorney_mobile . '">' . $wplawyer_attorney_mobile . '</a>';   }
     733function wplawyer_attorney_mobile()
     734{
     735    $wplawyer_attorney_mobile = get_post_meta(get_the_ID(), 'wplawyer_attorney_mobile_number', true);
     736    if ($wplawyer_attorney_mobile == '') {
     737    } else {
     738         echo '<span id="attorney-mobile-label">Phone:</span>&nbsp;<a id="attorney-mobile" href="tel:' . $wplawyer_attorney_mobile . '">' . $wplawyer_attorney_mobile . '</a>';     
     739    }
     740}
     741
     742function wplawyer_attorney_mobile_nolabel()
     743{
     744    $wplawyer_attorney_mobile = get_post_meta(get_the_ID(), 'wplawyer_attorney_mobile_number', true);
     745    if ($wplawyer_attorney_mobile == '') {
     746    } else {
     747         echo '<a id="attorney-mobile" href="tel:' . $wplawyer_attorney_mobile . '">' . $wplawyer_attorney_mobile . '</a>';     
     748    }
    708749}
    709750
    710751// Attorney Fax
    711 function wplawyer_attorney_fax() {
    712     $wplawyer_attorney_fax = get_post_meta(get_the_ID(), 'wplawyer_attorney_fax_number', true);
    713     if ($wplawyer_attorney_fax == '') { } else {
    714         echo '<span id="attorney-fax-label">Fax:</span>&nbsp;<a id="attorney-fax" href="tel:' . $wplawyer_attorney_fax . '">' . $wplawyer_attorney_fax . '</a>';     }
    715 }
    716 
    717 function wplawyer_attorney_fax_nolabel() {
    718     $wplawyer_attorney_fax = get_post_meta(get_the_ID(), 'wplawyer_attorney_fax_number', true);
    719     if ($wplawyer_attorney_fax == '') { } else {
    720         echo '<a id="attorney-fax" href="tel:' . $wplawyer_attorney_fax . '">' . $wplawyer_attorney_fax . '</a>';    }
     752function wplawyer_attorney_fax()
     753{
     754    $wplawyer_attorney_fax = get_post_meta(get_the_ID(), 'wplawyer_attorney_fax_number', true);
     755    if ($wplawyer_attorney_fax == '') {
     756    } else {
     757         echo '<span id="attorney-fax-label">Fax:</span>&nbsp;<a id="attorney-fax" href="tel:' . $wplawyer_attorney_fax . '">' . $wplawyer_attorney_fax . '</a>';     
     758    }
     759}
     760
     761function wplawyer_attorney_fax_nolabel()
     762{
     763    $wplawyer_attorney_fax = get_post_meta(get_the_ID(), 'wplawyer_attorney_fax_number', true);
     764    if ($wplawyer_attorney_fax == '') {
     765    } else {
     766         echo '<a id="attorney-fax" href="tel:' . $wplawyer_attorney_fax . '">' . $wplawyer_attorney_fax . '</a>';     
     767    }
    721768}
    722769
    723770// Attorney Website
    724 function wplawyer_attorney_website() {
    725     $wplawyer_attorney_website = get_post_meta(get_the_ID(), 'wplawyer_attorney_website', true);
    726     if ($wplawyer_attorney_website == '') { } else {
    727         echo '<span id="attorney-website-label">Website:</span>&nbsp;<a id="attorney-website" href="//' . $wplawyer_attorney_website . '">' . $wplawyer_attorney_website . '</a>';   }
    728 }
    729 
    730 function wplawyer_attorney_website_nolabel() {
    731     $wplawyer_attorney_website = get_post_meta(get_the_ID(), 'wplawyer_attorney_website', true);
    732     if ($wplawyer_attorney_website == '') { } else {
    733         echo '<a id="attorney-website" href="//' . $wplawyer_attorney_website . '">' . $wplawyer_attorney_website . '</a>';  }
     771function wplawyer_attorney_website()
     772{
     773    $wplawyer_attorney_website = get_post_meta(get_the_ID(), 'wplawyer_attorney_website', true);
     774    if ($wplawyer_attorney_website == '') {
     775    } else {
     776         echo '<span id="attorney-website-label">Website:</span>&nbsp;<a id="attorney-website" href="//' . $wplawyer_attorney_website . '">' . $wplawyer_attorney_website . '</a>';     
     777    }
     778}
     779
     780function wplawyer_attorney_website_nolabel()
     781{
     782    $wplawyer_attorney_website = get_post_meta(get_the_ID(), 'wplawyer_attorney_website', true);
     783    if ($wplawyer_attorney_website == '') {
     784    } else {
     785         echo '<a id="attorney-website" href="//' . $wplawyer_attorney_website . '">' . $wplawyer_attorney_website . '</a>';     
     786    }
    734787}
    735788
    736789// Attorney Facebook
    737 function wplawyer_attorney_facebook() {
    738     $wplawyer_attorney_facebook = get_post_meta(get_the_ID(), 'wplawyer_attorney_facebook', true);
    739     if ($wplawyer_attorney_facebook == '') { } else {
    740         echo '<span id="attorney-facebook-label">Facebook:</span>&nbsp;<a id="attorney-facebook" class="attorney-social" href="//' . $wplawyer_attorney_facebook . '">' . $wplawyer_attorney_facebook . '</a>';  }
    741 }
    742 
    743 function wplawyer_attorney_facebook_icon() {
    744     $wplawyer_attorney_facebook = get_post_meta(get_the_ID(), 'wplawyer_attorney_facebook', true);
    745     if ($wplawyer_attorney_facebook == '') { } else {
    746         echo '<a id="attorney-facebook" class="attorney-social" href="//' . $wplawyer_attorney_facebook . '"><li class="facebook-icon"></li></a>';   }
    747 }
    748 
    749 function wplawyer_attorney_facebook_nolabel() {
    750     $wplawyer_attorney_facebook = get_post_meta(get_the_ID(), 'wplawyer_attorney_facebook', true);
    751     if ($wplawyer_attorney_facebook == '') { } else {
    752         echo '<a id="attorney-facebook" class="attorney-social" href="//' . $wplawyer_attorney_facebook . '">' . $wplawyer_attorney_facebook . '</a>';   }
     790function wplawyer_attorney_facebook()
     791{
     792    $wplawyer_attorney_facebook = get_post_meta(get_the_ID(), 'wplawyer_attorney_facebook', true);
     793    if ($wplawyer_attorney_facebook == '') {
     794    } else {
     795         echo '<span id="attorney-facebook-label">Facebook:</span>&nbsp;<a id="attorney-facebook" class="attorney-social" href="//' . $wplawyer_attorney_facebook . '">' . $wplawyer_attorney_facebook . '</a>';     
     796    }
     797}
     798
     799function wplawyer_attorney_facebook_icon()
     800{
     801    $wplawyer_attorney_facebook = get_post_meta(get_the_ID(), 'wplawyer_attorney_facebook', true);
     802    if ($wplawyer_attorney_facebook == '') {
     803    } else {
     804         echo '<a id="attorney-facebook" class="attorney-social" href="//' . $wplawyer_attorney_facebook . '"><li class="facebook-icon"></li></a>';     
     805    }
     806}
     807
     808function wplawyer_attorney_facebook_nolabel()
     809{
     810    $wplawyer_attorney_facebook = get_post_meta(get_the_ID(), 'wplawyer_attorney_facebook', true);
     811    if ($wplawyer_attorney_facebook == '') {
     812    } else {
     813         echo '<a id="attorney-facebook" class="attorney-social" href="//' . $wplawyer_attorney_facebook . '">' . $wplawyer_attorney_facebook . '</a>';     
     814    }
    753815}
    754816
    755817// Attorney Twitter
    756 function wplawyer_attorney_twitter() {
    757     $wplawyer_attorney_twitter = get_post_meta(get_the_ID(), 'wplawyer_attorney_twitter', true);
    758     if ($wplawyer_attorney_twitter == '') { } else {
    759         echo '<span id="attorney-twitter-label">Twitter:</span>&nbsp;<a id="attorney-twitter" class="attorney-social" href="//' . $wplawyer_attorney_twitter . '">' . $wplawyer_attorney_twitter . '</a>';   }
    760 }
    761 
    762 function wplawyer_attorney_twitter_icon() {
    763     $wplawyer_attorney_twitter = get_post_meta(get_the_ID(), 'wplawyer_attorney_twitter', true);
    764     if ($wplawyer_attorney_twitter == '') { } else {
    765         echo '<a id="attorney-twitter" class="attorney-social" href="//' . $wplawyer_attorney_twitter . '"><li class="twitter-icon"></li></a>';  }
    766 }
    767 
    768 function wplawyer_attorney_twitter_nolabel() {
    769     $wplawyer_attorney_twitter = get_post_meta(get_the_ID(), 'wplawyer_attorney_twitter', true);
    770     if ($wplawyer_attorney_twitter == '') { } else {
    771         echo '<a id="attorney-twitter" class="attorney-social" href="//' . $wplawyer_attorney_twitter . '">' . $wplawyer_attorney_twitter . '</a>';  }
     818function wplawyer_attorney_twitter()
     819{
     820    $wplawyer_attorney_twitter = get_post_meta(get_the_ID(), 'wplawyer_attorney_twitter', true);
     821    if ($wplawyer_attorney_twitter == '') {
     822    } else {
     823         echo '<span id="attorney-twitter-label">Twitter:</span>&nbsp;<a id="attorney-twitter" class="attorney-social" href="//' . $wplawyer_attorney_twitter . '">' . $wplawyer_attorney_twitter . '</a>';     
     824    }
     825}
     826
     827function wplawyer_attorney_twitter_icon()
     828{
     829    $wplawyer_attorney_twitter = get_post_meta(get_the_ID(), 'wplawyer_attorney_twitter', true);
     830    if ($wplawyer_attorney_twitter == '') {
     831    } else {
     832         echo '<a id="attorney-twitter" class="attorney-social" href="//' . $wplawyer_attorney_twitter . '"><li class="twitter-icon"></li></a>';     
     833    }
     834}
     835
     836function wplawyer_attorney_twitter_nolabel()
     837{
     838    $wplawyer_attorney_twitter = get_post_meta(get_the_ID(), 'wplawyer_attorney_twitter', true);
     839    if ($wplawyer_attorney_twitter == '') {
     840    } else {
     841         echo '<a id="attorney-twitter" class="attorney-social" href="//' . $wplawyer_attorney_twitter . '">' . $wplawyer_attorney_twitter . '</a>';     
     842    }
    772843}
    773844
    774845// Attorney LinkedIn
    775 function wplawyer_attorney_linkedin() {
    776     $wplawyer_attorney_linkedin = get_post_meta(get_the_ID(), 'wplawyer_attorney_linkedin', true);
    777     if ($wplawyer_attorney_linkedin == '') { } else {
    778         echo '<span id="attorney-linkedin-label">Linkedin:</span>&nbsp;<a id="attorney-linkedin" class="attorney-social" href="//' . $wplawyer_attorney_linkedin . '">' . $wplawyer_attorney_linkedin . '</a>';  }
    779 }
    780 
    781 function wplawyer_attorney_linkedin_icon() {
    782     $wplawyer_attorney_linkedin = get_post_meta(get_the_ID(), 'wplawyer_attorney_linkedin', true);
    783     if ($wplawyer_attorney_linkedin == '') { } else {
    784         echo '<a id="attorney-linkedin" class="attorney-social" href="//' . $wplawyer_attorney_linkedin . '"><li class="linkedin-icon"></li></a>';   }
    785 }
    786 
    787 function wplawyer_attorney_linkedin_nolabel() {
    788     $wplawyer_attorney_linkedin = get_post_meta(get_the_ID(), 'wplawyer_attorney_linkedin', true);
    789     if ($wplawyer_attorney_linkedin == '') { } else {
    790         echo '<a id="attorney-linkedin" class="attorney-social" href="//' . $wplawyer_attorney_linkedin . '">' . $wplawyer_attorney_linkedin . '</a>';   }
     846function wplawyer_attorney_linkedin()
     847{
     848    $wplawyer_attorney_linkedin = get_post_meta(get_the_ID(), 'wplawyer_attorney_linkedin', true);
     849    if ($wplawyer_attorney_linkedin == '') {
     850    } else {
     851         echo '<span id="attorney-linkedin-label">Linkedin:</span>&nbsp;<a id="attorney-linkedin" class="attorney-social" href="//' . $wplawyer_attorney_linkedin . '">' . $wplawyer_attorney_linkedin . '</a>';     
     852    }
     853}
     854
     855function wplawyer_attorney_linkedin_icon()
     856{
     857    $wplawyer_attorney_linkedin = get_post_meta(get_the_ID(), 'wplawyer_attorney_linkedin', true);
     858    if ($wplawyer_attorney_linkedin == '') {
     859    } else {
     860         echo '<a id="attorney-linkedin" class="attorney-social" href="//' . $wplawyer_attorney_linkedin . '"><li class="linkedin-icon"></li></a>';     
     861    }
     862}
     863
     864function wplawyer_attorney_linkedin_nolabel()
     865{
     866    $wplawyer_attorney_linkedin = get_post_meta(get_the_ID(), 'wplawyer_attorney_linkedin', true);
     867    if ($wplawyer_attorney_linkedin == '') {
     868    } else {
     869         echo '<a id="attorney-linkedin" class="attorney-social" href="//' . $wplawyer_attorney_linkedin . '">' . $wplawyer_attorney_linkedin . '</a>';     
     870    }
    791871}
    792872
    793873// Attorney YouTube
    794 function wplawyer_attorney_youtube() {
    795     $wplawyer_attorney_youtube = get_post_meta(get_the_ID(), 'wplawyer_attorney_youtube', true);
    796     if ($wplawyer_attorney_youtube == '') { } else {
    797         echo '<span id="attorney-youtube-label">YouTube</span>&nbsp;<a id="attorney-youtube" class="attorney-social" href="//' . $wplawyer_attorney_youtube . '">' . $wplawyer_attorney_youtube . '</a>';    }
    798 }
    799 
    800 function wplawyer_attorney_youtube_icon() {
    801     $wplawyer_attorney_youtube = get_post_meta(get_the_ID(), 'wplawyer_attorney_youtube', true);
    802     if ($wplawyer_attorney_youtube == '') { } else {
    803         echo '<a id="attorney-youtube" class="attorney-social" href="//' . $wplawyer_attorney_youtube . '"><li class="youtube-icon"></li></a>';  }
    804 }
    805 
    806 function wplawyer_attorney_youtube_nolabel() {
    807     $wplawyer_attorney_youtube = get_post_meta(get_the_ID(), 'wplawyer_attorney_youtube', true);
    808     if ($wplawyer_attorney_youtube == '') { } else {
    809         echo '<a id="attorney-youtube" class="attorney-social" href="//' . $wplawyer_attorney_youtube . '">' . $wplawyer_attorney_youtube . '</a>';  }
    810 }
    811 
    812 
    813 
    814 
    815 
    816 ################################################################################
     874function wplawyer_attorney_youtube()
     875{
     876    $wplawyer_attorney_youtube = get_post_meta(get_the_ID(), 'wplawyer_attorney_youtube', true);
     877    if ($wplawyer_attorney_youtube == '') {
     878    } else {
     879         echo '<span id="attorney-youtube-label">YouTube</span>&nbsp;<a id="attorney-youtube" class="attorney-social" href="//' . $wplawyer_attorney_youtube . '">' . $wplawyer_attorney_youtube . '</a>';     
     880    }
     881}
     882
     883function wplawyer_attorney_youtube_icon()
     884{
     885    $wplawyer_attorney_youtube = get_post_meta(get_the_ID(), 'wplawyer_attorney_youtube', true);
     886    if ($wplawyer_attorney_youtube == '') {
     887    } else {
     888         echo '<a id="attorney-youtube" class="attorney-social" href="//' . $wplawyer_attorney_youtube . '"><li class="youtube-icon"></li></a>';     
     889    }
     890}
     891
     892function wplawyer_attorney_youtube_nolabel()
     893{
     894    $wplawyer_attorney_youtube = get_post_meta(get_the_ID(), 'wplawyer_attorney_youtube', true);
     895    if ($wplawyer_attorney_youtube == '') {
     896    } else {
     897         echo '<a id="attorney-youtube" class="attorney-social" href="//' . $wplawyer_attorney_youtube . '">' . $wplawyer_attorney_youtube . '</a>';     
     898    }
     899}
     900
     901
     902
     903
     904
     905//
    817906// Load Template Files
    818 ################################################################################
    819 
    820 add_filter( 'template_include', 'wplawyer_attorney_templates', 1 );
    821 
    822 function wplawyer_attorney_templates( $template_path ) {
    823     if ( get_post_type() == 'wplawyer-attorney' ) {
    824         // Single Property Template
    825         if ( is_single() ) {
     907//
     908
     909add_filter('template_include', 'wplawyer_attorney_templates', 1);
     910
     911function wplawyer_attorney_templates( $template_path )
     912{
     913    if (get_post_type() == 'wplawyer-attorney' ) {
     914        // Single Property Template
     915        if (is_single() ) {
    826916            // checks if the file exists in the theme first,
    827917            // otherwise serve the file from the plugin
    828             if ( $theme_file = locate_template( array ( 'single-wplawyer-attorney.php' ) ) ) {
     918            if ($theme_file = locate_template(array ( 'single-wplawyer-attorney.php' )) ) {
    829919                $template_path = $theme_file;
    830920            } else {
    831                 $template_path = plugin_dir_path( __FILE__ ) . '../templates/single-wplawyer-attorney.php';
     921                $template_path = plugin_dir_path(__FILE__) . '../templates/single-wplawyer-attorney.php';
    832922            }
    833923        }
    834924
    835925        // Archive Template
    836         if ( is_archive() ) {
     926        if (is_archive() ) {
    837927            // checks if the file exists in the theme first,
    838928            // otherwise serve the file from the plugin
    839             if ( $theme_file = locate_template( array ( 'archive-wplawyer-attorney.php' ) ) ) {
     929            if ($theme_file = locate_template(array ( 'archive-wplawyer-attorney.php' )) ) {
    840930                $template_path = $theme_file;
    841931            } else {
    842                 $template_path = plugin_dir_path( __FILE__ ) . '../templates/archive-wplawyer-attorney.php';
     932                $template_path = plugin_dir_path(__FILE__) . '../templates/archive-wplawyer-attorney.php';
    843933            }
    844934        }
  • wp-lawyer/trunk/modules/cases.php

    r1120676 r3217047  
    11<?php
    22
    3 ###########################################################
     3//
    44// Add Image Size for Single Case
    5 ###########################################################
    6 
    7     add_image_size( 'wplawyer-case', 400, 400, true ); // 400 x 400, for the single case pages
    8 
    9 ###########################################################
     5//
     6
     7    add_image_size('wplawyer-case', 400, 400, true); // 400 x 400, for the single case pages
     8
     9//
    1010// Register Cases Custom Post Type
    11 ###########################################################
    12 if ( ! function_exists('wp_lawyer_cases_cpt') ) {
    13 
    14 // Register Custom Post Type
    15 function wp_lawyer_cases_cpt() {
    16 
    17     $labels = array(
    18         'name'                => _x( 'Cases', 'Post Type General Name', 'wp-lawyer' ),
    19         'singular_name'       => _x( 'Case', 'Post Type Singular Name', 'wp-lawyer' ),
    20         'menu_name'           => __( 'Cases', 'wp-lawyer' ),
    21         'parent_item_colon'   => __( 'Parent Case:', 'wp-lawyer' ),
    22         'all_items'           => __( 'All Cases', 'wp-lawyer' ),
    23         'view_item'           => __( 'View Case', 'wp-lawyer' ),
    24         'add_new_item'        => __( 'Add New Case', 'wp-lawyer' ),
    25         'add_new'             => __( 'Add Case', 'wp-lawyer' ),
    26         'edit_item'           => __( 'Edit Case', 'wp-lawyer' ),
    27         'update_item'         => __( 'Update Case', 'wp-lawyer' ),
    28         'search_items'        => __( 'Search Cases', 'wp-lawyer' ),
    29         'not_found'           => __( 'No Cases Found', 'wp-lawyer' ),
    30         'not_found_in_trash'  => __( 'No Cases Found in Trash', 'wp-lawyer' ),
    31     );
    32     $args = array(
    33         'label'               => __( 'cases', 'wp-lawyer' ),
    34         'description'         => __( 'Cases', 'wp-lawyer' ),
    35         'labels'              => $labels,
    36         'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'publicize', 'wpcom-markdown', 'custom-fields'  ),
    37         'taxonomies'          => array( 'case-type' ),
    38         'hierarchical'        => false,
    39         'public'              => true,
    40         'show_ui'             => true,
    41         'show_in_menu'        => true,
    42         'show_in_nav_menus'   => true,
    43         'show_in_admin_bar'   => true,
    44         'menu_position'       => 5,
    45         'menu_icon'           => plugins_url( '../assets/images/cases-icon.png' , __FILE__ ),
    46         // 'register_meta_box_cb' => 'wplawyer_add_cases_metaboxes',
    47         'can_export'          => true,
    48         'has_archive'         => true,
    49         'exclude_from_search' => false,
    50         'publicly_queryable'  => true,
    51         'capability_type'     => 'page',
    52         'rewrite' => array('slug'=>'cases', 'with_front' => false)
    53     );
    54     register_post_type( 'wplawyer-cases', $args );
    55 
    56 }
    57 
    58 // Hook into the 'init' action
    59 add_action( 'init', 'wp_lawyer_cases_cpt', 0 );
    60 
    61 }
    62 
    63 
    64 
    65 ###########################################################
     11//
     12if (! function_exists('wp_lawyer_cases_cpt') ) {
     13
     14    // Register Custom Post Type
     15    function wp_lawyer_cases_cpt()
     16    {
     17
     18        $labels = array(
     19        'name'                => _x('Cases', 'Post Type General Name', 'wp-lawyer'),
     20        'singular_name'       => _x('Case', 'Post Type Singular Name', 'wp-lawyer'),
     21        'menu_name'           => __('Cases', 'wp-lawyer'),
     22        'parent_item_colon'   => __('Parent Case:', 'wp-lawyer'),
     23        'all_items'           => __('All Cases', 'wp-lawyer'),
     24        'view_item'           => __('View Case', 'wp-lawyer'),
     25        'add_new_item'        => __('Add New Case', 'wp-lawyer'),
     26        'add_new'             => __('Add Case', 'wp-lawyer'),
     27        'edit_item'           => __('Edit Case', 'wp-lawyer'),
     28        'update_item'         => __('Update Case', 'wp-lawyer'),
     29        'search_items'        => __('Search Cases', 'wp-lawyer'),
     30        'not_found'           => __('No Cases Found', 'wp-lawyer'),
     31        'not_found_in_trash'  => __('No Cases Found in Trash', 'wp-lawyer'),
     32        );
     33        $args = array(
     34        'label'               => __('cases', 'wp-lawyer'),
     35        'description'         => __('Cases', 'wp-lawyer'),
     36        'labels'              => $labels,
     37        'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'publicize', 'wpcom-markdown', 'custom-fields'  ),
     38        'taxonomies'          => array( 'case-type' ),
     39        'hierarchical'        => false,
     40        'public'              => true,
     41        'show_ui'             => true,
     42        'show_in_menu'        => true,
     43        'show_in_nav_menus'   => true,
     44        'show_in_admin_bar'   => true,
     45        'menu_position'       => 5,
     46        'menu_icon'           => plugins_url('../assets/images/cases-icon.png', __FILE__),
     47        // 'register_meta_box_cb' => 'wplawyer_add_cases_metaboxes',
     48        'can_export'          => true,
     49        'has_archive'         => true,
     50        'exclude_from_search' => false,
     51        'publicly_queryable'  => true,
     52        'capability_type'     => 'page',
     53        'rewrite' => array('slug'=>'cases', 'with_front' => false)
     54        );
     55        register_post_type('wplawyer-cases', $args);
     56
     57    }
     58
     59    // Hook into the 'init' action
     60    add_action('init', 'wp_lawyer_cases_cpt', 0);
     61
     62}
     63
     64
     65
     66//
    6667// Register Cases Type - Taxonomy
    67 ###########################################################
    68 if ( ! function_exists( 'wp_lawyer_cases_casetype' ) ) {
    69 
    70 // Register Custom Taxonomy
    71 function wp_lawyer_cases_casetype() {
    72 
    73     $labels = array(
    74         'name'                       => _x( 'Case Types', 'Taxonomy General Name', 'wp-lawyer' ),
    75         'singular_name'              => _x( 'Case Type', 'Taxonomy Singular Name', 'wp-lawyer' ),
    76         'menu_name'                  => __( 'Case Types', 'wp-lawyer' ),
    77         'all_items'                  => __( 'All Case Types', 'wp-lawyer' ),
    78         'parent_item'                => __( 'Parent Case Type', 'wp-lawyer' ),
    79         'parent_item_colon'          => __( 'Parent Case Types:', 'wp-lawyer' ),
    80         'new_item_name'              => __( 'New Case Types', 'wp-lawyer' ),
    81         'add_new_item'               => __( 'Add New Case Type', 'wp-lawyer' ),
    82         'edit_item'                  => __( 'Edit Case Type', 'wp-lawyer' ),
    83         'update_item'                => __( 'Update Case Type', 'wp-lawyer' ),
    84         'separate_items_with_commas' => __( 'Separate Case Type with commas', 'wp-lawyer' ),
    85         'search_items'               => __( 'Search Case Type', 'wp-lawyer' ),
    86         'add_or_remove_items'        => __( 'Add or remove Case Type', 'wp-lawyer' ),
    87         'choose_from_most_used'      => __( 'Choose from the most used Case Type', 'wp-lawyer' ),
    88         'not_found'                  => __( 'No Case Type Found', 'wp-lawyer' ),
    89     );
    90     $args = array(
    91         'labels'                     => $labels,
    92         'hierarchical'               => true,
    93         'public'                     => true,
    94         'show_ui'                    => true,
    95         'show_admin_column'          => true,
    96         'show_in_nav_menus'          => true,
    97         'show_tagcloud'              => true,
    98         'rewrite' => array('slug'=>'case/case-type', 'with_front' => false)
    99     );
    100     register_taxonomy( 'wplawyer-case-type', array( 'wplawyer-cases' ), $args );
    101 
    102 }
    103 
    104 // Hook into the 'init' action
    105 add_action( 'init', 'wp_lawyer_cases_casetype', 0 );
    106 
    107 }
    108 
    109 
    110 
    111 ################################################################################
     68//
     69if (! function_exists('wp_lawyer_cases_casetype') ) {
     70
     71    // Register Custom Taxonomy
     72    function wp_lawyer_cases_casetype()
     73    {
     74
     75        $labels = array(
     76        'name'                       => _x('Case Types', 'Taxonomy General Name', 'wp-lawyer'),
     77        'singular_name'              => _x('Case Type', 'Taxonomy Singular Name', 'wp-lawyer'),
     78        'menu_name'                  => __('Case Types', 'wp-lawyer'),
     79        'all_items'                  => __('All Case Types', 'wp-lawyer'),
     80        'parent_item'                => __('Parent Case Type', 'wp-lawyer'),
     81        'parent_item_colon'          => __('Parent Case Types:', 'wp-lawyer'),
     82        'new_item_name'              => __('New Case Types', 'wp-lawyer'),
     83        'add_new_item'               => __('Add New Case Type', 'wp-lawyer'),
     84        'edit_item'                  => __('Edit Case Type', 'wp-lawyer'),
     85        'update_item'                => __('Update Case Type', 'wp-lawyer'),
     86        'separate_items_with_commas' => __('Separate Case Type with commas', 'wp-lawyer'),
     87        'search_items'               => __('Search Case Type', 'wp-lawyer'),
     88        'add_or_remove_items'        => __('Add or remove Case Type', 'wp-lawyer'),
     89        'choose_from_most_used'      => __('Choose from the most used Case Type', 'wp-lawyer'),
     90        'not_found'                  => __('No Case Type Found', 'wp-lawyer'),
     91        );
     92        $args = array(
     93        'labels'                     => $labels,
     94        'hierarchical'               => true,
     95        'public'                     => true,
     96        'show_ui'                    => true,
     97        'show_admin_column'          => true,
     98        'show_in_nav_menus'          => true,
     99        'show_tagcloud'              => true,
     100        'rewrite' => array('slug'=>'case/case-type', 'with_front' => false)
     101        );
     102        register_taxonomy('wplawyer-case-type', array( 'wplawyer-cases' ), $args);
     103
     104    }
     105
     106    // Hook into the 'init' action
     107    add_action('init', 'wp_lawyer_cases_casetype', 0);
     108
     109}
     110
     111
     112
     113//
    112114// Setup Case Resolutions Taxonomy
    113 ################################################################################
    114 if ( ! function_exists( 'wplawyer_case_resolution' ) ) {
    115 
    116 // Register Custom Taxonomy
    117 function wplawyer_case_resolution() {
    118 
    119     $labels = array(
    120         'name'                       => _x( 'Resolutions', 'Taxonomy General Name', 'wp-lawyer' ),
    121         'singular_name'              => _x( 'Resolution', 'Taxonomy Singular Name', 'wp-lawyer' ),
    122         'menu_name'                  => __( 'Resolutions', 'wp-lawyer' ),
    123         'all_items'                  => __( 'All Resolutions', 'wp-lawyer' ),
    124         'parent_item'                => __( 'Parent Resolution', 'wp-lawyer' ),
    125         'parent_item_colon'          => __( 'Parent Resolution:', 'wp-lawyer' ),
    126         'new_item_name'              => __( 'New Resolution Name', 'wp-lawyer' ),
    127         'add_new_item'               => __( 'Add New Resolution', 'wp-lawyer' ),
    128         'edit_item'                  => __( 'Edit Resolution', 'wp-lawyer' ),
    129         'update_item'                => __( 'Update Resolution', 'wp-lawyer' ),
    130         'separate_items_with_commas' => __( 'Separate Resolutions with commas', 'wp-lawyer' ),
    131         'search_items'               => __( 'Search Resolutions', 'wp-lawyer' ),
    132         'add_or_remove_items'        => __( 'Add or remove Resolutions', 'wp-lawyer' ),
    133         'choose_from_most_used'      => __( 'Choose from the most used Resolutions', 'wp-lawyer' ),
    134         'not_found'                  => __( 'No Resolutions Found', 'wp-lawyer' ),
    135     );
    136     $args = array(
    137         'labels'                     => $labels,
    138         'hierarchical'               => true,
    139         'public'                     => true,
    140         'show_ui'                    => true,
    141         'show_admin_column'          => true,
    142         'show_in_nav_menus'          => true,
    143         'show_tagcloud'              => true,
    144         'rewrite' => array('slug'=>'cases/resolution', 'with_front' => false)
    145     );
    146     register_taxonomy( 'wplawyer-case-resolution', array( 'wplawyer-cases' ), $args );
    147 
    148     wp_insert_term('Settlement', 'wplawyer-case-resolution');
    149     wp_insert_term('Jury Verdict', 'wplawyer-case-resolution');
    150 
    151 }
    152 
    153 // Hook into the 'init' action
    154 add_action( 'init', 'wplawyer_case_resolution', 0 );
    155 
    156 }
    157 
    158 ###########################################################
     115//
     116if (! function_exists('wplawyer_case_resolution') ) {
     117
     118    // Register Custom Taxonomy
     119    function wplawyer_case_resolution()
     120    {
     121
     122        $labels = array(
     123        'name'                       => _x('Resolutions', 'Taxonomy General Name', 'wp-lawyer'),
     124        'singular_name'              => _x('Resolution', 'Taxonomy Singular Name', 'wp-lawyer'),
     125        'menu_name'                  => __('Resolutions', 'wp-lawyer'),
     126        'all_items'                  => __('All Resolutions', 'wp-lawyer'),
     127        'parent_item'                => __('Parent Resolution', 'wp-lawyer'),
     128        'parent_item_colon'          => __('Parent Resolution:', 'wp-lawyer'),
     129        'new_item_name'              => __('New Resolution Name', 'wp-lawyer'),
     130        'add_new_item'               => __('Add New Resolution', 'wp-lawyer'),
     131        'edit_item'                  => __('Edit Resolution', 'wp-lawyer'),
     132        'update_item'                => __('Update Resolution', 'wp-lawyer'),
     133        'separate_items_with_commas' => __('Separate Resolutions with commas', 'wp-lawyer'),
     134        'search_items'               => __('Search Resolutions', 'wp-lawyer'),
     135        'add_or_remove_items'        => __('Add or remove Resolutions', 'wp-lawyer'),
     136        'choose_from_most_used'      => __('Choose from the most used Resolutions', 'wp-lawyer'),
     137        'not_found'                  => __('No Resolutions Found', 'wp-lawyer'),
     138        );
     139        $args = array(
     140        'labels'                     => $labels,
     141        'hierarchical'               => true,
     142        'public'                     => true,
     143        'show_ui'                    => true,
     144        'show_admin_column'          => true,
     145        'show_in_nav_menus'          => true,
     146        'show_tagcloud'              => true,
     147        'rewrite' => array('slug'=>'cases/resolution', 'with_front' => false)
     148        );
     149        register_taxonomy('wplawyer-case-resolution', array( 'wplawyer-cases' ), $args);
     150
     151        wp_insert_term('Settlement', 'wplawyer-case-resolution');
     152        wp_insert_term('Jury Verdict', 'wplawyer-case-resolution');
     153
     154    }
     155
     156    // Hook into the 'init' action
     157    add_action('init', 'wplawyer_case_resolution', 0);
     158
     159}
     160
     161//
    159162// Courthouse - Taxonomy
    160 ###########################################################
    161 if ( ! function_exists( 'wplawyer_cases_courthouse' ) ) {
    162 
    163 // Register Custom Taxonomy
    164 function wplawyer_cases_courthouse() {
    165 
    166     $labels = array(
    167         'name'                       => _x( 'Court House', 'Taxonomy General Name', 'wp-lawyer' ),
    168         'singular_name'              => _x( 'Courthouse', 'Taxonomy Singular Name', 'wp-lawyer' ),
    169         'menu_name'                  => __( 'Court Houses', 'wp-lawyer' ),
    170         'all_items'                  => __( 'All Court Houses', 'wp-lawyer' ),
    171         'parent_item'                => __( 'Parent Courthouse', 'wp-lawyer' ),
    172         'parent_item_colon'          => __( 'Parent Courthouse:', 'wp-lawyer' ),
    173         'new_item_name'              => __( 'New Courthouse', 'wp-lawyer' ),
    174         'add_new_item'               => __( 'Add New Courthouse', 'wp-lawyer' ),
    175         'edit_item'                  => __( 'Edit Courthouse', 'wp-lawyer' ),
    176         'update_item'                => __( 'Update Courthouse', 'wp-lawyer' ),
    177         'separate_items_with_commas' => __( 'Separate Court Houses with commas', 'wp-lawyer' ),
    178         'search_items'               => __( 'Search Court Houses', 'wp-lawyer' ),
    179         'add_or_remove_items'        => __( 'Add or remove Court Houses', 'wp-lawyer' ),
    180         'choose_from_most_used'      => __( 'Choose from the most used Court Houses', 'wp-lawyer' ),
    181         'not_found'                  => __( 'No Court Houses Found', 'wp-lawyer' ),
    182     );
    183     $args = array(
    184         'labels'                     => $labels,
    185         'hierarchical'               => false,
    186         'public'                     => true,
    187         'show_ui'                    => true,
    188         'show_admin_column'          => true,
    189         'show_in_nav_menus'          => true,
    190         'show_tagcloud'              => true,
    191     );
    192     register_taxonomy( 'wplawyer-cases-courthouse', array( 'wplawyer-cases' ), $args );
    193 
    194 }
    195 
    196 // Hook into the 'init' action
    197 add_action( 'init', 'wplawyer_cases_courthouse', 0 );
    198 
    199 }
    200 
    201 
    202 
    203 ################################################################################
     163//
     164if (! function_exists('wplawyer_cases_courthouse') ) {
     165
     166    // Register Custom Taxonomy
     167    function wplawyer_cases_courthouse()
     168    {
     169
     170        $labels = array(
     171        'name'                       => _x('Court House', 'Taxonomy General Name', 'wp-lawyer'),
     172        'singular_name'              => _x('Courthouse', 'Taxonomy Singular Name', 'wp-lawyer'),
     173        'menu_name'                  => __('Court Houses', 'wp-lawyer'),
     174        'all_items'                  => __('All Court Houses', 'wp-lawyer'),
     175        'parent_item'                => __('Parent Courthouse', 'wp-lawyer'),
     176        'parent_item_colon'          => __('Parent Courthouse:', 'wp-lawyer'),
     177        'new_item_name'              => __('New Courthouse', 'wp-lawyer'),
     178        'add_new_item'               => __('Add New Courthouse', 'wp-lawyer'),
     179        'edit_item'                  => __('Edit Courthouse', 'wp-lawyer'),
     180        'update_item'                => __('Update Courthouse', 'wp-lawyer'),
     181        'separate_items_with_commas' => __('Separate Court Houses with commas', 'wp-lawyer'),
     182        'search_items'               => __('Search Court Houses', 'wp-lawyer'),
     183        'add_or_remove_items'        => __('Add or remove Court Houses', 'wp-lawyer'),
     184        'choose_from_most_used'      => __('Choose from the most used Court Houses', 'wp-lawyer'),
     185        'not_found'                  => __('No Court Houses Found', 'wp-lawyer'),
     186        );
     187        $args = array(
     188        'labels'                     => $labels,
     189        'hierarchical'               => false,
     190        'public'                     => true,
     191        'show_ui'                    => true,
     192        'show_admin_column'          => true,
     193        'show_in_nav_menus'          => true,
     194        'show_tagcloud'              => true,
     195        );
     196        register_taxonomy('wplawyer-cases-courthouse', array( 'wplawyer-cases' ), $args);
     197
     198    }
     199
     200    // Hook into the 'init' action
     201    add_action('init', 'wplawyer_cases_courthouse', 0);
     202
     203}
     204
     205
     206
     207//
    204208// Setup Meta Boxes
    205 ################################################################################
     209//
    206210
    207211$wplawyer_case_prefix = 'wplawyer_';
     
    226230            'std' => ''
    227231        ),
    228         array(
     232        array(
    229233            'name' => 'Defendent',
    230234            'id' => $wplawyer_case_prefix . 'case_defendent',
     
    237241
    238242
    239 ################################################################################
     243//
    240244// Add Meta Box
    241 ################################################################################
    242 function wplawyer_add_case_metaboxes() {
     245//
     246function wplawyer_add_case_metaboxes()
     247{
    243248    global $wplawyer_case_meta_box;
    244249    add_meta_box($wplawyer_case_meta_box['id'], $wplawyer_case_meta_box['title'], 'wplawyer_case_show_box', $wplawyer_case_meta_box['page'], $wplawyer_case_meta_box['context'], $wplawyer_case_meta_box['priority']);
     
    246251
    247252// Callback function to show fields in meta box
    248 function wplawyer_case_show_box() {
     253function wplawyer_case_show_box()
     254{
    249255    global $wplawyer_case_meta_box, $post;
    250256
     
    254260    echo '<table class="form-table" style="overflow:hidden;">';
    255261
    256     foreach ($wplawyer_case_meta_box['fields'] as $field) {
    257         // get current post meta data
    258         $wplawyer_case_meta = get_post_meta($post->ID, $field['id'], true);
    259 
    260 
    261         switch ($field['type']) {
    262 
    263             case 'text':
    264                 echo '<tr>',
    265                 '<th style="width:15%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
    266                 '<td>';
    267                 echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $wplawyer_case_meta ? $wplawyer_case_meta : $field['std'], '" size="20" style="width:50%; min-width:150px;" />', '<br />', isset($field['desc']);
    268                 echo     '</td>','</tr>';
    269             break;
    270         }
    271 
    272     }
    273     echo '</table>';
    274     }
    275 
    276 
    277 ################################################################################
     262    foreach ($wplawyer_case_meta_box['fields'] as $field) {
     263        // get current post meta data
     264        $wplawyer_case_meta = get_post_meta($post->ID, $field['id'], true);
     265
     266
     267        switch ($field['type']) {
     268
     269        case 'text':
     270            echo '<tr>',
     271            '<th style="width:15%"><label for="', $field['id'], '">', $field['name'], '</label></th>',
     272            '<td>';
     273            echo '<input type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $wplawyer_case_meta ? $wplawyer_case_meta : $field['std'], '" size="20" style="width:50%; min-width:150px;" />', '<br />', isset($field['desc']);
     274            echo     '</td>','</tr>';
     275            break;
     276        }
     277
     278    }
     279    echo '</table>';
     280}
     281
     282
     283//
    278284// Save MetaBox Data
    279 ################################################################################
     285//
    280286add_action('save_post', 'wplawyer_case_save_data');
    281287
    282 function wplawyer_case_save_data($post_id) {
     288function wplawyer_case_save_data($post_id)
     289{
    283290    global $wplawyer_case_meta_box;
    284291
    285292    // verify nonce
    286     if (isset($_POST['wplawyer_case_meta_box_nonce']) && !wp_verify_nonce( $_POST['wplawyer_case_meta_box_nonce'], basename(__FILE__))) {
     293    if (isset($_POST['wplawyer_case_meta_box_nonce']) && !wp_verify_nonce($_POST['wplawyer_case_meta_box_nonce'], basename(__FILE__))) {
    287294        return $post_id;
    288295    }
    289296    // check autosave
    290     if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)
    291     return;
     297    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
     298        return;
     299    }
    292300
    293301    // check permissions
    294     if (!current_user_can('edit_post', $post_id))
    295     return;
     302    if (!current_user_can('edit_post', $post_id)) {
     303        return;
     304    }
    296305
    297306    foreach ($wplawyer_case_meta_box['fields'] as $field) {
     
    299308
    300309        if (!empty($_POST[$field['id']])) {
    301                $wplawyer_case_new = $_POST[$field['id']];
    302         } else {
    303             $wplawyer_case_new = '';
    304         }
     310            $wplawyer_case_new = $_POST[$field['id']];
     311        } else {
     312            $wplawyer_case_new = '';
     313        }
    305314
    306315        if ($wplawyer_case_new && $wplawyer_case_new != $wplawyer_case_old) {
     
    314323
    315324
    316 ################################################################################
     325//
    317326// Template Functions
    318 ################################################################################
     327//
    319328
    320329// Cases Verdict Price
    321 function wplawyer_case_verdict_price() {
    322     $wplawyer_case_verdict_price = get_post_meta(get_the_ID(), 'wplawyer_case_verdict_price', true);
    323     if ($wplawyer_case_verdict_price == '') { } else {
    324         echo '<span id="case-verdict-price">' . $wplawyer_case_verdict_price . '</span>';
    325     }
     330function wplawyer_case_verdict_price()
     331{
     332    $wplawyer_case_verdict_price = get_post_meta(get_the_ID(), 'wplawyer_case_verdict_price', true);
     333    if ($wplawyer_case_verdict_price == '') {
     334    } else {
     335         echo '<span id="case-verdict-price">' . $wplawyer_case_verdict_price . '</span>';
     336    }
    326337}
    327338
    328339// Case Plantiff
    329 function wplawyer_case_plantiff() {
    330     $wplawyer_case_plantiff = get_post_meta(get_the_ID(), 'wplawyer_case_plantiff', true);
    331     if ($wplawyer_case_plantiff == '') { } else {
    332         echo '<span id="case-plantiff">' . $wplawyer_case_plantiff . '</span>';  }
     340function wplawyer_case_plantiff()
     341{
     342    $wplawyer_case_plantiff = get_post_meta(get_the_ID(), 'wplawyer_case_plantiff', true);
     343    if ($wplawyer_case_plantiff == '') {
     344    } else {
     345         echo '<span id="case-plantiff">' . $wplawyer_case_plantiff . '</span>';     
     346    }
    333347}
    334348
    335349// Case Defendent
    336 function wplawyer_case_defendent() {
    337     $wplawyer_case_defendent = get_post_meta(get_the_ID(), 'wplawyer_case_defendent', true);
    338     if ($wplawyer_case_defendent == '') { } else {
    339         echo '<span id="case-defendent">' . $wplawyer_case_defendent . '</span>';    }
    340 }
    341 
    342 
    343 
    344 
    345 ################################################################################
     350function wplawyer_case_defendent()
     351{
     352    $wplawyer_case_defendent = get_post_meta(get_the_ID(), 'wplawyer_case_defendent', true);
     353    if ($wplawyer_case_defendent == '') {
     354    } else {
     355         echo '<span id="case-defendent">' . $wplawyer_case_defendent . '</span>';     
     356    }
     357}
     358
     359
     360
     361
     362//
    346363// Load Template Files
    347 ################################################################################
    348 
    349 add_filter( 'template_include', 'wplawyer_cases_templates', 1 );
    350 
    351 function wplawyer_cases_templates( $template_path ) {
    352     if ( get_post_type() == 'wplawyer-cases' ) {
    353         // Single Property Template
    354         if ( is_single() ) {
     364//
     365
     366add_filter('template_include', 'wplawyer_cases_templates', 1);
     367
     368function wplawyer_cases_templates( $template_path )
     369{
     370    if (get_post_type() == 'wplawyer-cases' ) {
     371        // Single Property Template
     372        if (is_single() ) {
    355373            // checks if the file exists in the theme first,
    356374            // otherwise serve the file from the plugin
    357             if ( $theme_file = locate_template( array ( 'single-wplawyer-cases.php' ) ) ) {
     375            if ($theme_file = locate_template(array ( 'single-wplawyer-cases.php' )) ) {
    358376                $template_path = $theme_file;
    359377            } else {
    360                 $template_path = plugin_dir_path( __FILE__ ) . '../templates/single-wplawyer-cases.php';
     378                $template_path = plugin_dir_path(__FILE__) . '../templates/single-wplawyer-cases.php';
    361379            }
    362380        }
    363381
    364382        // Archive Template
    365         if ( is_archive() ) {
     383        if (is_archive() ) {
    366384            // checks if the file exists in the theme first,
    367385            // otherwise serve the file from the plugin
    368             if ( $theme_file = locate_template( array ( 'archive-wplawyer-cases.php' ) ) ) {
     386            if ($theme_file = locate_template(array ( 'archive-wplawyer-cases.php' )) ) {
    369387                $template_path = $theme_file;
    370388            } else {
    371                 $template_path = plugin_dir_path( __FILE__ ) . '../templates/archive-wplawyer-cases.php';
     389                $template_path = plugin_dir_path(__FILE__) . '../templates/archive-wplawyer-cases.php';
    372390            }
    373391        }
  • wp-lawyer/trunk/templates/archive-wplawyer-attorney.php

    r924045 r3217047  
    11<?php get_header(); ?>
    22
    3             <div class="content">
    4            
    5            
    6            
    7             <h1>Attorneys</h1>
    8            
    9            
    10            
     3            <div class="content">
     4           
     5           
     6           
     7            <h1>Attorneys</h1>
     8           
     9           
     10           
    1111<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    12    
    13     <div class="wplawyer-attorney-container">
    14        
    15         <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    16        
    17             <div class="wplawyer-attorney-thumb">
    18        
    19                 <?php if ( has_post_thumbnail()) : ?>
    20                         <?php the_post_thumbnail('wplawyer-attorney'); ?>
    21                     <?php else : endif; ?>
    22                    
    23             </div><!-- end attorney thumbnail -->
    24            
    25             <div class="wplawyer-attorney-info">
    26        
    27                 <ul>
    28                     <li><?php wplawyer_attorney_title(); ?></li>
    29                     <li><?php wplawyer_attorney_bar_number(); ?></li>
    30                     <li><?php wplawyer_attorney_address(); ?></li>
    31                     <li><?php wplawyer_attorney_email(); ?></li>
    32                     <li><?php wplawyer_attorney_mobile(); ?></li>
    33                     <li><?php wplawyer_attorney_fax(); ?></li>
    34                     <li><?php wplawyer_attorney_website(); ?></li>
    35                     <ul class="attorney-social"><?php wplawyer_attorney_facebook_icon(); ?><?php wplawyer_attorney_twitter_icon(); ?><?php wplawyer_attorney_linkedin_icon(); ?><?php wplawyer_attorney_youtube_icon(); ?></ul>
    36                     <li>Areas of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-practice-area', ' ', ', ', '' ); ?></li>
    37                     <li>Cities of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-city', ' ', ', ', '' ); ?></li>
    38                     <li>Counties of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-county', ' ', ', ', '' ); ?></li>
    39                     <li>States of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-state', ' ', ', ', '' ); ?></li>
    40                     <li>Districts: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-district', ' ', ', ', '' ); ?></li>
    41                     <li>Law School: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-lawschool', ' ', ', ', '' ); ?></li>
    42                     <li>Undergrad School: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-undergrad', ' ', ', ', '' ); ?></li>
    43                 </ul>
    44        
    45                 <?php the_content(); ?>
    46            
    47             </div><!-- end attorney info -->
    48        
    49         </div><!-- end attorney container -->
    50        
    51        
    52         <?php endwhile; else: ?>
     12   
     13    <div class="wplawyer-attorney-container">
     14       
     15        <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
     16       
     17            <div class="wplawyer-attorney-thumb">
     18       
     19        <?php if (has_post_thumbnail()) : ?>
     20            <?php the_post_thumbnail('wplawyer-attorney'); ?>
     21                    <?php else :
     22                    endif; ?>
     23                   
     24            </div><!-- end attorney thumbnail -->
     25           
     26            <div class="wplawyer-attorney-info">
     27       
     28                <ul>
     29                    <li><?php wplawyer_attorney_title(); ?></li>
     30                    <li><?php wplawyer_attorney_bar_number(); ?></li>
     31                    <li><?php wplawyer_attorney_address(); ?></li>
     32                    <li><?php wplawyer_attorney_email(); ?></li>
     33                    <li><?php wplawyer_attorney_mobile(); ?></li>
     34                    <li><?php wplawyer_attorney_fax(); ?></li>
     35                    <li><?php wplawyer_attorney_website(); ?></li>
     36                    <ul class="attorney-social"><?php wplawyer_attorney_facebook_icon(); ?><?php wplawyer_attorney_twitter_icon(); ?><?php wplawyer_attorney_linkedin_icon(); ?><?php wplawyer_attorney_youtube_icon(); ?></ul>
     37                    <li>Areas of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-practice-area', ' ', ', ', ''); ?></li>
     38                    <li>Cities of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-city', ' ', ', ', ''); ?></li>
     39                    <li>Counties of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-county', ' ', ', ', ''); ?></li>
     40                    <li>States of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-state', ' ', ', ', ''); ?></li>
     41                    <li>Districts: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-district', ' ', ', ', ''); ?></li>
     42                    <li>Law School: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-lawschool', ' ', ', ', ''); ?></li>
     43                    <li>Undergrad School: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-undergrad', ' ', ', ', ''); ?></li>
     44                </ul>
     45       
     46        <?php the_content(); ?>
     47           
     48            </div><!-- end attorney info -->
     49       
     50        </div><!-- end attorney container -->
     51       
     52       
     53<?php endwhile; else: ?>
    5354
    54                 <p>Sorry, this attorney appears to no longer exist.</p>
     55                <p>Sorry, this attorney appears to no longer exist.</p>
    5556
    56         <?php endif; ?>
    57        
    58        
    59        
    60         <!--- ADD PAGINATION LINKS --->
    61        
     57<?php endif; ?>
     58       
     59       
     60       
     61        <!--- ADD PAGINATION LINKS --->
     62       
    6263
    63     </div>
     64    </div>
    6465
    6566
  • wp-lawyer/trunk/templates/archive-wplawyer-cases.php

    r924045 r3217047  
    11<?php get_header(); ?>
    22
    3     <div class="content">
    4    
    5         <h1>Case Results</h1>
    6    
    7         <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    8    
    9             <!-- begin case -->
    10             <div class="wplawyer-case-container">
     3    <div class="content">
     4   
     5        <h1>Case Results</h1>
     6   
     7        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
     8   
     9            <!-- begin case -->
     10            <div class="wplawyer-case-container">
    1111
    12                 <!-- case type -->
    13                 <h3 class="case-type"><?php echo get_the_term_list( get_the_ID(), 'wplawyer-case-type', ' ', ', ', '' ); ?></h3>
    14                 <!-- #case type -->
    15                
    16                 <!-- case plaintiff v. defendent -->
    17                 <p class="case-parties"><a href="<?php the_permalink(); ?>"><?php wplawyer_case_plantiff(); ?>&nbsp;v.&nbsp;<?php wplawyer_case_defendent(); ?></a></p>
    18                 <!-- #case plaintiff v. defendent -->
    19                
    20                 <!-- case verdict price -->
    21                 <p class="case-verdict-price"><?php wplawyer_case_verdict_price(); ?></h3>
    22                 <!-- #case verdict price -->
    23                
    24                 <!-- case resolution i.e. settlement, jury verdict, etc -->
    25                 <p class="case-resolution"><?php echo get_the_term_list( get_the_ID(), 'wplawyer-case-resolution', ' ', ', ', '' ); ?></h5>
    26                 <!-- #case resolution -->
    27                
    28                 <!-- court house -->
    29                 <p class="case-court-house"><?php echo get_the_term_list( get_the_ID(), 'wplawyer-cases-courthouse', ' ', ', ', '' ); ?></p>
    30                 <!-- #court house -->
    31                
    32        
    33             </div><!-- #case -->
    34            
    35         <?php endwhile; endif; ?>
     12                <!-- case type -->
     13                <h3 class="case-type"><?php echo get_the_term_list(get_the_ID(), 'wplawyer-case-type', ' ', ', ', ''); ?></h3>
     14                <!-- #case type -->
     15               
     16                <!-- case plaintiff v. defendent -->
     17                <p class="case-parties"><a href="<?php the_permalink(); ?>"><?php wplawyer_case_plantiff(); ?>&nbsp;v.&nbsp;<?php wplawyer_case_defendent(); ?></a></p>
     18                <!-- #case plaintiff v. defendent -->
     19               
     20                <!-- case verdict price -->
     21                <p class="case-verdict-price"><?php wplawyer_case_verdict_price(); ?></h3>
     22                <!-- #case verdict price -->
     23               
     24                <!-- case resolution i.e. settlement, jury verdict, etc -->
     25                <p class="case-resolution"><?php echo get_the_term_list(get_the_ID(), 'wplawyer-case-resolution', ' ', ', ', ''); ?></h5>
     26                <!-- #case resolution -->
     27               
     28                <!-- court house -->
     29                <p class="case-court-house"><?php echo get_the_term_list(get_the_ID(), 'wplawyer-cases-courthouse', ' ', ', ', ''); ?></p>
     30                <!-- #court house -->
     31               
     32       
     33            </div><!-- #case -->
     34           
     35        <?php endwhile;
     36        endif; ?>
    3637
    37     </div><!-- end content -->
     38    </div><!-- end content -->
    3839
    3940<?php get_footer(); ?>
  • wp-lawyer/trunk/templates/single-wplawyer-attorney.php

    r924045 r3217047  
    11<?php get_header(); ?>
    22
    3    
    4            
     3   
     4           
    55<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    66
     
    88
    99<div class="wplawyer-attorney-container-single">
    10        
    11             <div class="wplawyer-attorney-thumb-single">
    12        
    13                 <?php if ( has_post_thumbnail()) : ?>
    14                         <?php the_post_thumbnail('wplawyer-attorney'); ?>
    15                     <?php else : endif; ?>
    16                    
    17             </div><!-- end attorney thumbnail -->
    18            
    19             <div class="wplawyer-attorney-info">
    20        
    21                 <ul>
    22                     <li><?php wplawyer_attorney_title(); ?></li>
    23                     <li><?php wplawyer_attorney_bar_number(); ?></li>
    24                     <li><?php wplawyer_attorney_address(); ?></li>
    25                     <li><?php wplawyer_attorney_email(); ?></li>
    26                     <li><?php wplawyer_attorney_mobile(); ?></li>
    27                     <li><?php wplawyer_attorney_fax(); ?></li>
    28                     <li><?php wplawyer_attorney_website(); ?></li>
    29                     <ul class="attorney-social"><?php wplawyer_attorney_facebook_icon(); ?><?php wplawyer_attorney_twitter_icon(); ?><?php wplawyer_attorney_linkedin_icon(); ?><?php wplawyer_attorney_youtube_icon(); ?></ul>
    30                     <li>Areas of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-practice-area', ' ', ', ', '' ); ?></li>
    31                     <li>Cities of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-city', ' ', ', ', '' ); ?></li>
    32                     <li>Counties of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-county', ' ', ', ', '' ); ?></li>
    33                     <li>States of Practice: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-state', ' ', ', ', '' ); ?></li>
    34                     <li>Districts: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-district', ' ', ', ', '' ); ?></li>
    35                     <li>Law School: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-lawschool', ' ', ', ', '' ); ?></li>
    36                     <li>Undergrad School: <?php echo get_the_term_list( get_the_ID(), 'wplawyer-attorney-undergrad', ' ', ', ', '' ); ?></li>
    37                 </ul>
    38        
    39                 <?php the_content(); ?>
    40            
    41             </div><!-- end attorney info -->
    42        
    43         </div><!-- end attorney container -->
    44        
    45        
     10       
     11            <div class="wplawyer-attorney-thumb-single">
     12       
     13        <?php if (has_post_thumbnail()) : ?>
     14            <?php the_post_thumbnail('wplawyer-attorney'); ?>
     15                    <?php else :
     16                    endif; ?>
     17                   
     18            </div><!-- end attorney thumbnail -->
     19           
     20            <div class="wplawyer-attorney-info">
     21       
     22                <ul>
     23                    <li><?php wplawyer_attorney_title(); ?></li>
     24                    <li><?php wplawyer_attorney_bar_number(); ?></li>
     25                    <li><?php wplawyer_attorney_address(); ?></li>
     26                    <li><?php wplawyer_attorney_email(); ?></li>
     27                    <li><?php wplawyer_attorney_mobile(); ?></li>
     28                    <li><?php wplawyer_attorney_fax(); ?></li>
     29                    <li><?php wplawyer_attorney_website(); ?></li>
     30                    <ul class="attorney-social"><?php wplawyer_attorney_facebook_icon(); ?><?php wplawyer_attorney_twitter_icon(); ?><?php wplawyer_attorney_linkedin_icon(); ?><?php wplawyer_attorney_youtube_icon(); ?></ul>
     31                    <li>Areas of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-practice-area', ' ', ', ', ''); ?></li>
     32                    <li>Cities of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-city', ' ', ', ', ''); ?></li>
     33                    <li>Counties of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-county', ' ', ', ', ''); ?></li>
     34                    <li>States of Practice: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-state', ' ', ', ', ''); ?></li>
     35                    <li>Districts: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-district', ' ', ', ', ''); ?></li>
     36                    <li>Law School: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-lawschool', ' ', ', ', ''); ?></li>
     37                    <li>Undergrad School: <?php echo get_the_term_list(get_the_ID(), 'wplawyer-attorney-undergrad', ' ', ', ', ''); ?></li>
     38                </ul>
     39       
     40        <?php the_content(); ?>
     41           
     42            </div><!-- end attorney info -->
     43       
     44        </div><!-- end attorney container -->
     45       
     46       
    4647
    47         <?php endwhile; else: ?>
     48<?php endwhile; else: ?>
    4849
    49             <p>Sorry, this attorney appears to no longer exist.</p>
     50            <p>Sorry, this attorney appears to no longer exist.</p>
    5051
    51         <?php endif; ?>
     52<?php endif; ?>
    5253
    5354
  • wp-lawyer/trunk/templates/single-wplawyer-cases.php

    r924045 r3217047  
    11<style type="text/css">
    22.case-thumb {
    3     margin: 0 20px 0 0;
    4     float: left;
     3    margin: 0 20px 0 0;
     4    float: left;
    55}
    66.case-information {
    7     margin: 0 20px;
    8     float: left;
     7    margin: 0 20px;
     8    float: left;
    99}
    1010.clear {
    11     clear: both;
     11    clear: both;
    1212}
    1313</style>
     
    1515<?php get_header(); ?>
    1616
    17     <div class="content">
    18            
    19     <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    20                
    21         <h1><?php the_title(); ?></h1>
    22        
    23         <div class="case-thumb">
    24        
    25         <?php if ( has_post_thumbnail()) : ?>
    26                         <?php the_post_thumbnail('wplawyer-case'); ?>
    27                     <?php else : endif; ?>
    28                    
    29         </div>
    30        
    31         <div class="case-information">
    32        
    33             <!-- case type -->
    34             <h3 class="case-type"><?php echo get_the_term_list( get_the_ID(), 'wplawyer-case-type', ' ', ', ', '' ); ?></h3>
    35             <!-- #case type -->
    36                
    37             <!-- case plaintiff v. defendent -->
    38             <p class="case-parties"><?php wplawyer_case_plantiff(); ?>&nbsp;v.&nbsp;<?php wplawyer_case_defendent(); ?></p>
    39             <!-- #case plaintiff v. defendent -->
    40                
    41             <!-- case verdict price -->
    42             <p class="case-verdict-price"><?php wplawyer_case_verdict_price(); ?></h3>
    43             <!-- #case verdict price -->
    44                
    45             <!-- case resolution i.e. settlement, jury verdict, etc -->
    46             <p class="case-resolution"><?php echo get_the_term_list( get_the_ID(), 'wplawyer-case-resolution', ' ', ', ', '' ); ?></h5>
    47             <!-- #case resolution -->
    48                
    49             <!-- court house -->
    50             <p class="case-court-house"><?php echo get_the_term_list( get_the_ID(), 'wplawyer-cases-courthouse', ' ', ', ', '' ); ?></p>
    51             <!-- #court house -->
    52        
    53         </div>
    54        
    55         <div class="clear"></div>
    56        
    57         <?php the_content(); ?>
     17    <div class="content">
     18           
     19    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
     20               
     21        <h1><?php the_title(); ?></h1>
     22       
     23        <div class="case-thumb">
     24       
     25            <?php if (has_post_thumbnail()) : ?>
     26                <?php the_post_thumbnail('wplawyer-case'); ?>
     27                    <?php else :
     28                    endif; ?>
     29                   
     30        </div>
     31       
     32        <div class="case-information">
     33       
     34            <!-- case type -->
     35            <h3 class="case-type"><?php echo get_the_term_list(get_the_ID(), 'wplawyer-case-type', ' ', ', ', ''); ?></h3>
     36            <!-- #case type -->
     37               
     38            <!-- case plaintiff v. defendent -->
     39            <p class="case-parties"><?php wplawyer_case_plantiff(); ?>&nbsp;v.&nbsp;<?php wplawyer_case_defendent(); ?></p>
     40            <!-- #case plaintiff v. defendent -->
     41               
     42            <!-- case verdict price -->
     43            <p class="case-verdict-price"><?php wplawyer_case_verdict_price(); ?></h3>
     44            <!-- #case verdict price -->
     45               
     46            <!-- case resolution i.e. settlement, jury verdict, etc -->
     47            <p class="case-resolution"><?php echo get_the_term_list(get_the_ID(), 'wplawyer-case-resolution', ' ', ', ', ''); ?></h5>
     48            <!-- #case resolution -->
     49               
     50            <!-- court house -->
     51            <p class="case-court-house"><?php echo get_the_term_list(get_the_ID(), 'wplawyer-cases-courthouse', ' ', ', ', ''); ?></p>
     52            <!-- #court house -->
     53       
     54        </div>
     55       
     56        <div class="clear"></div>
     57       
     58            <?php the_content(); ?>
    5859
    59     <?php endwhile; else: ?>
     60    <?php endwhile; else: ?>
    6061
    61         <p>Sorry, this case appears to no longer exist.</p>
     62        <p>Sorry, this case appears to no longer exist.</p>
    6263
    63     <?php endif; ?>
     64    <?php endif; ?>
    6465
    65     </div>
     66    </div>
    6667
    6768
  • wp-lawyer/trunk/uninstall.php

    r924045 r3217047  
    66 */
    77
    8 if( !defined( 'ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') )
     8if(!defined('ABSPATH') && !defined('WP_UNINSTALL_PLUGIN') ) {
    99    exit();
     10}
    1011
    1112
    12     global $wpdb;
     13    global $wpdb;
    1314
    1415    // Delete our Options
    15     delete_option( 'wplawyer_version' );
     16    delete_option('wplawyer_version');
    1617
    1718    // Delete our Transients
     
    2021    // DROP Attorneys Posts
    2122    $args = array (
    22         'post_type' => array('wplawyer-attorney'),
    23         'nopaging' => true
    24     );
    25     $query = new WP_Query ($args);
    26         while ($query->have_posts ()) {
    27             $query->the_post ();
    28             $id = get_the_ID ();
    29             wp_delete_post ($id, true);
    30             delete_post_meta_by_key($id->ID);
    31         }
    32     wp_reset_postdata ();
     23        'post_type' => array('wplawyer-attorney'),
     24        'nopaging' => true
     25    );
     26    $query = new WP_Query($args);
     27    while ($query->have_posts()) {
     28        $query->the_post();
     29        $id = get_the_ID();
     30        wp_delete_post($id, true);
     31        delete_post_meta_by_key($id->ID);
     32    }
     33    wp_reset_postdata();
  • wp-lawyer/trunk/wp-lawyer.php

    r1121518 r3217047  
    11<?php
    22
    3 /*!-----------------------------------------------------------------------------------
    4 
    5   Plugin Name: WP Lawyer
    6   Version: 1.0.3
    7   Plugin URI: //wp-lawyer.com
    8   Description: A custom WordPress plugin for Lawyers and Law Firms.
    9   Author: imFORZA
    10   Author URI: //www.imforza.com
    11   Text Domain: wp-lawyer
    12   Domain Path: /languages/
    13   License: GPL v3
    14 
    15 -----------------------------------------------------------------------------------*/
    16 
     3/**
     4 * !
     5 * Plugin Name: WP Lawyer
     6 * Version: 1.0.4
     7 * Plugin URI: //wp-lawyer.com
     8 * Description: A custom WordPress plugin for Lawyers and Law Firms.
     9 * Author: imFORZA
     10 * Author URI: //www.imforza.com
     11 * Contributors: bhubbard
     12 * Requires at least: 4.7
     13 * Tested up to: 6.7.1
     14 * Stable tag: 1.0.4
     15 * License: GPLv3 or later
     16 * License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
     17 * Version: 1.0.2
     18 * Text Domain: wp-lawyer
     19 * Domain Path: /languages/
     20 * License: GPL v3
     21 */
    1722
    1823
    1924// Load Attorney Module
    20 require_once('modules/attorneys.php');
     25require_once 'modules/attorneys.php';
    2126
    2227// Load Cases Module
    23 require_once('modules/cases.php');
     28require_once 'modules/cases.php';
    2429
    2530
    2631// Language Support
    27 load_plugin_textdomain( 'wp-lawyer', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
     32load_plugin_textdomain('wp-lawyer', false, dirname(plugin_basename(__FILE__)) . '/languages');
    2833
    2934
    30 ################################################################################
     35//
    3136// Plugin Activation
    32 ################################################################################
     37//
    3338
    34 register_activation_hook( __FILE__, 'wplawyer_activate' );
     39register_activation_hook(__FILE__, 'wplawyer_activate');
    3540
    36 function wplawyer_activate() {
     41/**
     42 * Undocumented function
     43 *
     44 * @return void
     45 */
     46function wplawyer_activate()
     47{
    3748    global $wpdb;
    3849
     
    4152}
    4253
    43 ################################################################################
     54//
    4455// Plugin Deactivation
    45 ################################################################################
    46 register_deactivation_hook( __FILE__, 'wplawyer_deactivation' );
     56//
     57register_deactivation_hook(__FILE__, 'wplawyer_deactivation');
    4758
    48 function wplawyer_deactivation() {
     59/**
     60 * Undocumented function
     61 *
     62 * @return void
     63 */
     64function wplawyer_deactivation()
     65{
    4966
    50         flush_rewrite_rules();
     67    flush_rewrite_rules();
    5168}
    5269
    5370
    54 ################################################################################
     71//
    5572// Plugin Styles
    56 ################################################################################
     73//
    5774
    5875// Register style sheet.
    59 add_action( 'wp_enqueue_scripts', 'wplawyer_styles' );
     76add_action('wp_enqueue_scripts', 'wplawyer_styles');
    6077
    61 function wplawyer_styles() {
     78/**
     79 * Undocumented function
     80 *
     81 * @return void
     82 */
     83function wplawyer_styles()
     84{
    6285
    63         if ( !is_admin() ) {
     86    if (!is_admin() ) {
    6487
    65             wp_register_style('wplawyer', plugins_url ( 'wp-lawyer/assets/css/main.css' ), false, null, 'all');
    66             wp_enqueue_style('wplawyer');
    67         }
    68     }
    69 
     88        wp_register_style('wplawyer', plugins_url('wp-lawyer/assets/css/main.css'), false, null, 'all');
     89        wp_enqueue_style('wplawyer');
     90    }
     91}
Note: See TracChangeset for help on using the changeset viewer.