├── 404.php
├── admin.php
├── archive-mfields_bookmark.php
├── archive.php
├── author.php
├── biography.php
├── category.php
├── comments.php
├── date.php
├── entry-post-image.php
├── entry-post-standard.php
├── entry-post-status.php
├── entry-post.php
├── entry.php
├── footer-basic.php
├── footer.php
├── functions.php
├── header-basic.php
├── header.php
├── home.php
├── image.php
├── images
├── diagonal-stripes.png
├── edit.png
├── icon-sprite.png
├── icons.png
├── lanterns.jpg
└── quote.png
├── inc
├── dropdowns.js
└── post-labels.php
├── index.php
├── longdesc-template.php
├── loop-search.php
├── loop-table.php
├── nav-posts.php
├── page.php
├── password-protected-post-form.php
├── readme.md
├── readme.txt
├── search.php
├── searchform.php
├── single-mfields_bookmark.php
├── single.php
├── sticky-posts.php
├── style-editor.css
├── style-syntax-highlighter.css
├── style.css
├── tag.php
├── taxonomy-mfields_bookmark_source.php
├── taxonomy-mfields_bookmark_type.php
├── taxonomy.php
└── top.php
/404.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright Copyright (c) 2011, Michael Fields
16 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
17 | * @since Nighthawk 1.0
18 | */
19 | ?>
20 |
21 |
22 |
23 |
28 |
29 |
30 |
31 |
32 | 10 ), array( 'widget_id' => null ) ); ?>
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/admin.php:
--------------------------------------------------------------------------------
1 | ';
37 | screen_icon();
38 |
39 | echo "\n" . 'Nighthawk
';
40 | echo "\n" . '';
41 |
42 | do_settings_sections( 'nighthawk' );
43 |
44 | echo "\n" . '
';
45 | }
46 |
47 | static public function intro() {
48 | echo 'This is some stuff about Nighthawk!
';
49 | }
50 |
51 | static public function plugins() {
52 | $testListTable = new Nighthawk_Supported_Plugins();
53 | $testListTable->prepare_items();
54 | $testListTable->display();
55 | }
56 | }
57 | Nighthawk_Admin::init();
58 |
59 | require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
60 |
61 | class Nighthawk_Supported_Plugins extends WP_List_Table {
62 |
63 | var $items = array(
64 | array(
65 | 'name' => 'Long Description for Image Attachments',
66 | 'slug' => 'long-description-for-image-attachments',
67 | 'author' => 'Michael Fields',
68 | ),
69 | array(
70 | 'name' => 'Mfields Bookmarks',
71 | 'author' => 'Michael Fields',
72 | ),
73 | array(
74 | 'name' => 'Subscribe to Comments',
75 | 'slug' => 'subscribe-to-comments',
76 | 'author' => 'Mark Jaquith',
77 | ),
78 | array(
79 | 'name' => 'SyntaxHighlighter Evolved',
80 | 'slug' => 'syntaxhighlighter',
81 | 'author' => 'Viper007Bond',
82 | ),
83 | array(
84 | 'name' => 'Taxonomy Images',
85 | 'slug' => 'taxonomy-images',
86 | 'author' => 'Michael Fields',
87 | ),
88 | );
89 |
90 | function __construct() {
91 | parent::__construct( array(
92 | 'singular' => 'plugin',
93 | 'plural' => 'plugins',
94 | 'ajax' => false
95 | ) );
96 | }
97 |
98 | function column_name( $item ) {
99 | return $item['name'];
100 | }
101 |
102 | function column_author( $item ) {
103 | return $item['author'];
104 | }
105 |
106 | function column_link( $item ) {
107 | if ( isset( $item['slug'] ) && ! empty( $item['slug'] ) ) {
108 | $url = 'http://wordpress.org/extend/plugins/' . $item['slug'] . '/';
109 | $title = sprintf( __( 'Read more about the %1$s plugin.' ), $item['name'] );
110 | return 'wordpress.org';
111 | }
112 | }
113 |
114 | function get_columns() {
115 | return array(
116 | 'name' => __( 'Plugin Name', 'nighthawk' ),
117 | 'link' => __( 'Plugin Page', 'nighthawk' ),
118 | 'author' => __( 'Author', 'nighthawk' ),
119 | );
120 | }
121 |
122 | function prepare_items() {
123 | $this->_column_headers = array(
124 | $this->get_columns(),
125 | array(),
126 | $this->get_sortable_columns(),
127 | );
128 |
129 | $this->set_pagination_args( array(
130 | 'total_items' => count( $this->items ),
131 | 'per_page' => 999,
132 | 'total_pages' => 1
133 | ) );
134 | }
135 | }
136 |
--------------------------------------------------------------------------------
/archive-mfields_bookmark.php:
--------------------------------------------------------------------------------
1 |
9 | * @copyright Copyright (c) 2011, Michael Fields
10 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11 | * @since 1.0
12 | */
13 |
14 | $nighthawk_post_type = 'mfields_bookmark';
15 |
16 | if ( ! have_posts() ) {
17 | get_template_part( '404', $nighthawk_post_type );
18 | }
19 |
20 | get_header( $nighthawk_post_type );
21 |
22 | ?>
23 |
24 |
43 |
44 |
45 |
46 | __( 'Post Title', 'nighthawk' ),
51 | 'class' => 'post-title',
52 | 'callback' => 'nighthawk_td_title',
53 | ),
54 | array(
55 | 'label' => __( 'Source', 'nighthawk' ),
56 | 'class' => 'bookmark-source',
57 | 'callback' => 'nighthawk_td_bookmark_source',
58 | ),
59 | array(
60 | 'label' => __( 'Permalink', 'nighthawk' ),
61 | 'class' => 'permalink',
62 | 'callback' => 'nighthawk_td_permalink_icon',
63 | ),
64 | ) );
65 |
66 | query_posts( wp_parse_args( $query_string, array( 'posts_per_page' => 30 ) ) );
67 | get_template_part( 'loop-table' );
68 | ?>
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/archive.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright Copyright (c) 2011, Michael Fields
8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 | * @since Nighthawk 1.0
10 | */
11 |
12 | if ( ! have_posts() ) {
13 | get_template_part( '404', 'archive' );
14 | }
15 |
16 | get_header( 'archive' );
17 |
18 | ?>
19 |
20 |
21 | get_queried_object();
28 | if ( isset( $post_type->name ) && is_paged() ) {
29 | $url = get_post_type_archive_link( $post_type->name );
30 | }
31 | }
32 |
33 | if ( ! empty( $url ) ) {
34 | echo '' . esc_html( $title ) . '';
35 | }
36 | else {
37 | echo esc_html( $title );
38 | }
39 |
40 | ?>
41 | ', '' ); ?>
42 |
43 |
44 |
45 |
46 |
54 |
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/author.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright Copyright (c) 2011, Michael Fields
8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 | * @since Nighthawk 1.0
10 | *
11 | * @todo Add edit link.
12 | * @todo Add website link.
13 | */
14 |
15 | if ( ! have_posts() ) {
16 | get_template_part( '404', 'author' );
17 | }
18 |
19 | get_header( 'author' );
20 |
21 | the_post();
22 |
23 | echo '';
24 |
25 | echo '' . esc_html( get_the_author() ) . '
';
26 |
27 | $bio = get_the_author_meta( 'description' );
28 | if ( ! empty( $bio ) ) {
29 | echo '' . $bio . '
';
30 | }
31 |
32 | echo '';
33 |
34 | rewind_posts();
35 |
36 | ?>
37 |
38 |
39 |
40 | 30 ) ) );
42 | get_template_part( 'loop-table', 'author' );
43 | ?>
44 |
45 |
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/biography.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright Copyright (c) 2011, Michael Fields
16 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
17 | * @since Nighthawk 1.0
18 | */
19 |
20 | if ( ! post_type_supports( get_post_type(), 'author' ) ) {
21 | return;
22 | }
23 |
24 | $description = get_the_author_meta( 'description' );
25 | if ( empty( $description ) ) {
26 | return;
27 | }
28 | ?>
29 |
30 |
31 |
39 |
--------------------------------------------------------------------------------
/category.php:
--------------------------------------------------------------------------------
1 |
9 | * @copyright Copyright (c) 2011, Michael Fields
10 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
11 | * @since Nighthawk 1.0
12 | */
13 |
14 | if ( ! have_posts() ) {
15 | get_template_part( '404', 'category' );
16 | }
17 |
18 | get_header( 'category' );
19 |
20 | ?>
21 |
22 |
35 |
36 |
37 |
38 | 30 ) ) );
40 | get_template_part( 'loop-table' );
41 | ?>
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/comments.php:
--------------------------------------------------------------------------------
1 |
17 | * @copyright Copyright (c) 2011, Michael Fields
18 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
19 | * @since Nighthawk 1.0
20 | */
21 |
22 | /*
23 | * Return early if ...
24 | * Post is protected by a password.
25 | */
26 | if ( post_password_required() ) {
27 | if ( have_comments() )
28 | echo '' . sprintf( __( 'This %1$s is password protected. Enter the password to view any comments.', 'nighthawk' ), Nighthawk::post_label() ) . '
';
29 | return;
30 | }
31 |
32 | /*
33 | * Return early if ...
34 | * there are no comments and comments are not allowed.
35 | */
36 | if ( ! have_comments() && ! comments_open() ) {
37 | return;
38 | }
39 |
40 | /*
41 | * Return early if ...
42 | * post_type does not support comments.
43 | */
44 | $post_type = get_post_type();
45 | if ( ! post_type_supports( $post_type, 'comments' ) ) {
46 | return;
47 | }
48 |
49 | if ( have_comments() ) {
50 |
51 | /* Comment heading. */
52 | $heading = sprintf( _n( '%1$s Comment', '%1$s Comments', get_comments_number(), 'nighthawk' ), number_format_i18n( get_comments_number() ) );
53 |
54 | /* Addendum */
55 | $addendum = '' . __( 'Leave a comment', 'nighthawk' ) . '';
56 | if ( ! comments_open() ) {
57 | $addendum = '' . __( 'Comments are closed', 'nighthawk' ) . '';
58 | }
59 |
60 | /* Print heading. */
61 | echo '';
62 |
63 | /* List the comments. */
64 | echo '';
71 |
72 | /* Paged navigation. */
73 | if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) {
74 | echo '';
75 | echo '
'; previous_comments_link( __( '« Older Comments', 'nighthawk' ) ); echo '
';
76 | echo '
'; next_comments_link( __( 'Newer Comments »', 'nighthawk' ) ); echo '
';
77 | echo '
';
78 | }
79 | }
80 |
81 | /* Display comment form. */
82 | comment_form( apply_filters( 'nighthawk_comment_form_args', array(
83 | 'title_reply' => __( 'Share your thoughts', 'nighthawk' ),
84 | 'comment_notes_before' => '',
85 | 'comment_notes_after' => nighthawk_subscribe_to_comments_checkbox(),
86 | ) ) );
87 |
88 | nighthawk_subscribe_to_comments_manual_form( '', '
' );
--------------------------------------------------------------------------------
/date.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright Copyright (c) 2011, Michael Fields
8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 | * @since Nighthawk 1.0
10 | */
11 |
12 | if ( ! have_posts() ) {
13 | get_template_part( '404', 'archive-date' );
14 | }
15 |
16 | get_header( 'archive-date' );
17 |
18 | ?>
19 |
20 |
21 |
22 |
23 |
45 |
46 | ' . $meta . ''; ?>
47 |
48 |
49 |
50 |
51 | 30 ) ) );
53 | get_template_part( 'loop-table' );
54 | ?>
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/entry-post-image.php:
--------------------------------------------------------------------------------
1 | >
2 |
3 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/entry-post-standard.php:
--------------------------------------------------------------------------------
1 | >
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
', '' ); ?>
11 |
12 |
13 |
14 |
15 |
16 |
17 | '
' . __( 'Pages:', 'nighthawk' ),
19 | 'after' => '
'
20 | ) ); ?>
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/entry-post-status.php:
--------------------------------------------------------------------------------
1 | >
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/entry-post.php:
--------------------------------------------------------------------------------
1 |
7 | * @copyright Copyright (c) 2011, Michael Fields
8 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
9 | * @since Nighthawk 1.0
10 | */
11 | ?>
12 |
13 | >
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
', '' ); ?>
23 |
24 |
25 |
26 |
27 |
28 |
29 | '
' . __( 'Pages:', 'nighthawk' ),
31 | 'after' => '
'
32 | ) ); ?>
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/entry.php:
--------------------------------------------------------------------------------
1 |
11 | * @copyright Copyright (c) 2011, Michael Fields
12 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
13 | * @since Nighthawk 1.0
14 | */
15 | ?>
16 |
17 | >
18 |
19 |
', '' );
27 | }
28 |
29 | /* Content. */
30 | if ( post_type_supports( $nighthawk_post_type, 'editor' ) ) {
31 | echo "\n" . '
';
32 | the_content( __( 'Continue Reading', 'nighthawk' ) );
33 | echo "\n" . '
';
34 | wp_link_pages( array(
35 | 'after' => '
',
36 | 'before' => '' . __( 'Pages:', 'nighthawk' ),
37 | ) );
38 | }
39 | /* Excerpt - Attempt to display excerpt only if the post_type does not support content. */
40 | else if ( post_type_supports( $nighthawk_post_type, 'excerpt' ) ) {
41 | echo "\n" . '
';
42 | the_excerpt();
43 | echo "\n" . '
';
44 | }
45 |
46 | do_action( 'nighthawk_entry_end' );
47 | ?>
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/footer-basic.php:
--------------------------------------------------------------------------------
1 |
15 | * @copyright Copyright (c) 2011, Michael Fields
16 | * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
17 | * @since 1.0
18 | */
19 | ?>
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
40 |
41 |