@@ -7,8 +7,8 @@ |
||
7 | 7 | * @since Twenty Eleven 1.0 |
8 | 8 | */ |
9 | 9 | ?> |
10 | - <form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> |
|
11 | - <label for="s" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label> |
|
12 | - <input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> |
|
13 | - <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" /> |
|
10 | + <form method="get" id="searchform" action="<?php echo esc_url(home_url('/')); ?>"> |
|
11 | + <label for="s" class="assistive-text"><?php _e('Search', 'twentyeleven'); ?></label> |
|
12 | + <input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e('Search', 'twentyeleven'); ?>" /> |
|
13 | + <input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e('Search', 'twentyeleven'); ?>" /> |
|
14 | 14 | </form> |
@@ -8,14 +8,14 @@ |
||
8 | 8 | */ |
9 | 9 | ?> |
10 | 10 | |
11 | -<article id="post-<?php the_ID(); ?>" <?php post_class( 'intro' ); ?>> |
|
11 | +<article id="post-<?php the_ID(); ?>" <?php post_class('intro'); ?>> |
|
12 | 12 | <header class="entry-header"> |
13 | 13 | <h2 class="entry-title"><?php the_title(); ?></h2> |
14 | 14 | </header><!-- .entry-header --> |
15 | 15 | |
16 | 16 | <div class="entry-content"> |
17 | 17 | <?php the_content(); ?> |
18 | - <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> |
|
19 | - <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> |
|
18 | + <?php wp_link_pages(array('before' => '<div class="page-link"><span>'.__('Pages:', 'twentyeleven').'</span>', 'after' => '</div>')); ?> |
|
19 | + <?php edit_post_link(__('Edit', 'twentyeleven'), '<span class="edit-link">', '</span>'); ?> |
|
20 | 20 | </div><!-- .entry-content --> |
21 | 21 | </article><!-- #post-<?php the_ID(); ?> --> |
@@ -14,30 +14,30 @@ |
||
14 | 14 | |
15 | 15 | <article id="post-0" class="post error404 not-found"> |
16 | 16 | <header class="entry-header"> |
17 | - <h1 class="entry-title"><?php _e( 'This is somewhat embarrassing, isn’t it?', 'twentyeleven' ); ?></h1> |
|
17 | + <h1 class="entry-title"><?php _e('This is somewhat embarrassing, isn’t it?', 'twentyeleven'); ?></h1> |
|
18 | 18 | </header> |
19 | 19 | |
20 | 20 | <div class="entry-content"> |
21 | - <p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help.', 'twentyeleven' ); ?></p> |
|
21 | + <p><?php _e('It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help.', 'twentyeleven'); ?></p> |
|
22 | 22 | |
23 | 23 | <?php get_search_form(); ?> |
24 | 24 | |
25 | - <?php the_widget( 'WP_Widget_Recent_Posts', array( 'number' => 10 ), array( 'widget_id' => '404' ) ); ?> |
|
25 | + <?php the_widget('WP_Widget_Recent_Posts', array('number' => 10), array('widget_id' => '404')); ?> |
|
26 | 26 | |
27 | 27 | <div class="widget"> |
28 | - <h2 class="widgettitle"><?php _e( 'Most Used Categories', 'twentyeleven' ); ?></h2> |
|
28 | + <h2 class="widgettitle"><?php _e('Most Used Categories', 'twentyeleven'); ?></h2> |
|
29 | 29 | <ul> |
30 | - <?php wp_list_categories( array( 'orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10 ) ); ?> |
|
30 | + <?php wp_list_categories(array('orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10)); ?> |
|
31 | 31 | </ul> |
32 | 32 | </div> |
33 | 33 | |
34 | 34 | <?php |
35 | 35 | /* translators: %1$s: smilie */ |
36 | - $archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'twentyeleven' ), convert_smilies( ':)' ) ) . '</p>'; |
|
37 | - the_widget( 'WP_Widget_Archives', array( 'count' => 0, 'dropdown' => 1 ), array( 'after_title' => '</h2>' . $archive_content ) ); |
|
36 | + $archive_content = '<p>'.sprintf(__('Try looking in the monthly archives. %1$s', 'twentyeleven'), convert_smilies(':)')).'</p>'; |
|
37 | + the_widget('WP_Widget_Archives', array('count' => 0, 'dropdown' => 1), array('after_title' => '</h2>'.$archive_content)); |
|
38 | 38 | ?> |
39 | 39 | |
40 | - <?php the_widget( 'WP_Widget_Tag_Cloud' ); ?> |
|
40 | + <?php the_widget('WP_Widget_Tag_Cloud'); ?> |
|
41 | 41 | |
42 | 42 | </div><!-- .entry-content --> |
43 | 43 | </article><!-- #post-0 --> |
@@ -1,11 +1,11 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying content |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Twenty_Eleven |
|
7 | - * @since Twenty Eleven 1.0 |
|
8 | - */ |
|
3 | + * Template for displaying content |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Twenty_Eleven |
|
7 | + * @since Twenty Eleven 1.0 |
|
8 | + */ |
|
9 | 9 | ?> |
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
@@ -10,75 +10,75 @@ |
||
10 | 10 | |
11 | 11 | <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> |
12 | 12 | <header class="entry-header"> |
13 | - <?php if ( is_sticky() ) : ?> |
|
13 | + <?php if (is_sticky()) : ?> |
|
14 | 14 | <hgroup> |
15 | 15 | <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2> |
16 | - <h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3> |
|
16 | + <h3 class="entry-format"><?php _e('Featured', 'twentyeleven'); ?></h3> |
|
17 | 17 | </hgroup> |
18 | 18 | <?php else : ?> |
19 | 19 | <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1> |
20 | 20 | <?php endif; ?> |
21 | 21 | |
22 | - <?php if ( 'post' == get_post_type() ) : ?> |
|
22 | + <?php if ('post' == get_post_type()) : ?> |
|
23 | 23 | <div class="entry-meta"> |
24 | 24 | <?php twentyeleven_posted_on(); ?> |
25 | 25 | </div><!-- .entry-meta --> |
26 | 26 | <?php endif; ?> |
27 | 27 | |
28 | - <?php if ( comments_open() && ! post_password_required() ) : ?> |
|
28 | + <?php if (comments_open() && ! post_password_required()) : ?> |
|
29 | 29 | <div class="comments-link"> |
30 | - <?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?> |
|
30 | + <?php comments_popup_link('<span class="leave-reply">'.__('Reply', 'twentyeleven').'</span>', _x('1', 'comments number', 'twentyeleven'), _x('%', 'comments number', 'twentyeleven')); ?> |
|
31 | 31 | </div> |
32 | 32 | <?php endif; ?> |
33 | 33 | </header><!-- .entry-header --> |
34 | 34 | |
35 | - <?php if ( is_search() ) : // Only display Excerpts for Search ?> |
|
35 | + <?php if (is_search()) : // Only display Excerpts for Search ?> |
|
36 | 36 | <div class="entry-summary"> |
37 | 37 | <?php the_excerpt(); ?> |
38 | 38 | </div><!-- .entry-summary --> |
39 | 39 | <?php else : ?> |
40 | 40 | <div class="entry-content"> |
41 | - <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?> |
|
42 | - <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> |
|
41 | + <?php the_content(__('Continue reading <span class="meta-nav">→</span>', 'twentyeleven')); ?> |
|
42 | + <?php wp_link_pages(array('before' => '<div class="page-link"><span>'.__('Pages:', 'twentyeleven').'</span>', 'after' => '</div>')); ?> |
|
43 | 43 | </div><!-- .entry-content --> |
44 | 44 | <?php endif; ?> |
45 | 45 | |
46 | 46 | <footer class="entry-meta"> |
47 | 47 | <?php $show_sep = false; ?> |
48 | - <?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?> |
|
48 | + <?php if (is_object_in_taxonomy(get_post_type(), 'category')) : // Hide category text when not supported ?> |
|
49 | 49 | <?php |
50 | 50 | /* translators: used between list items, there is a space after the comma */ |
51 | - $categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) ); |
|
52 | - if ( $categories_list ): |
|
51 | + $categories_list = get_the_category_list(__(', ', 'twentyeleven')); |
|
52 | + if ($categories_list): |
|
53 | 53 | ?> |
54 | 54 | <span class="cat-links"> |
55 | - <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); |
|
55 | + <?php printf(__('<span class="%1$s">Posted in</span> %2$s', 'twentyeleven'), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list); |
|
56 | 56 | $show_sep = true; ?> |
57 | 57 | </span> |
58 | 58 | <?php endif; // End if categories ?> |
59 | 59 | <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?> |
60 | - <?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported ?> |
|
60 | + <?php if (is_object_in_taxonomy(get_post_type(), 'post_tag')) : // Hide tag text when not supported ?> |
|
61 | 61 | <?php |
62 | 62 | /* translators: used between list items, there is a space after the comma */ |
63 | - $tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); |
|
64 | - if ( $tags_list ): |
|
65 | - if ( $show_sep ) : ?> |
|
63 | + $tags_list = get_the_tag_list('', __(', ', 'twentyeleven')); |
|
64 | + if ($tags_list): |
|
65 | + if ($show_sep) : ?> |
|
66 | 66 | <span class="sep"> | </span> |
67 | 67 | <?php endif; // End if $show_sep ?> |
68 | 68 | <span class="tag-links"> |
69 | - <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); |
|
69 | + <?php printf(__('<span class="%1$s">Tagged</span> %2$s', 'twentyeleven'), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list); |
|
70 | 70 | $show_sep = true; ?> |
71 | 71 | </span> |
72 | 72 | <?php endif; // End if $tags_list ?> |
73 | 73 | <?php endif; // End if is_object_in_taxonomy( get_post_type(), 'post_tag' ) ?> |
74 | 74 | |
75 | - <?php if ( comments_open() ) : ?> |
|
76 | - <?php if ( $show_sep ) : ?> |
|
75 | + <?php if (comments_open()) : ?> |
|
76 | + <?php if ($show_sep) : ?> |
|
77 | 77 | <span class="sep"> | </span> |
78 | 78 | <?php endif; // End if $show_sep ?> |
79 | - <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span> |
|
79 | + <span class="comments-link"><?php comments_popup_link('<span class="leave-reply">'.__('Leave a reply', 'twentyeleven').'</span>', __('<b>1</b> Reply', 'twentyeleven'), __('<b>%</b> Replies', 'twentyeleven')); ?></span> |
|
80 | 80 | <?php endif; // End if comments_open() ?> |
81 | 81 | |
82 | - <?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?> |
|
82 | + <?php edit_post_link(__('Edit', 'twentyeleven'), '<span class="edit-link">', '</span>'); ?> |
|
83 | 83 | </footer><!-- .entry-meta --> |
84 | 84 | </article><!-- #post-<?php the_ID(); ?> --> |
@@ -15,8 +15,11 @@ discard block |
||
15 | 15 | <h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2> |
16 | 16 | <h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3> |
17 | 17 | </hgroup> |
18 | - <?php else : ?> |
|
19 | - <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1> |
|
18 | + <?php else { |
|
19 | + : ?> |
|
20 | + <h1 class="entry-title"><a href="<?php the_permalink(); |
|
21 | +} |
|
22 | +?>" rel="bookmark"><?php the_title(); ?></a></h1> |
|
20 | 23 | <?php endif; ?> |
21 | 24 | |
22 | 25 | <?php if ( 'post' == get_post_type() ) : ?> |
@@ -36,9 +39,12 @@ discard block |
||
36 | 39 | <div class="entry-summary"> |
37 | 40 | <?php the_excerpt(); ?> |
38 | 41 | </div><!-- .entry-summary --> |
39 | - <?php else : ?> |
|
42 | + <?php else { |
|
43 | + : ?> |
|
40 | 44 | <div class="entry-content"> |
41 | - <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?> |
|
45 | + <?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); |
|
46 | +} |
|
47 | +?> |
|
42 | 48 | <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?> |
43 | 49 | </div><!-- .entry-content --> |
44 | 50 | <?php endif; ?> |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Template for displaying Comments |
|
4 | - * |
|
5 | - * The area of the page that contains both current comments |
|
6 | - * and the comment form. The actual display of comments is |
|
7 | - * handled by a callback to twentyeleven_comment() which is |
|
8 | - * located in the functions.php file. |
|
9 | - * |
|
10 | - * @package WordPress |
|
11 | - * @subpackage Twenty_Eleven |
|
12 | - * @since Twenty Eleven 1.0 |
|
13 | - */ |
|
3 | + * Template for displaying Comments |
|
4 | + * |
|
5 | + * The area of the page that contains both current comments |
|
6 | + * and the comment form. The actual display of comments is |
|
7 | + * handled by a callback to twentyeleven_comment() which is |
|
8 | + * located in the functions.php file. |
|
9 | + * |
|
10 | + * @package WordPress |
|
11 | + * @subpackage Twenty_Eleven |
|
12 | + * @since Twenty Eleven 1.0 |
|
13 | + */ |
|
14 | 14 | ?> |
15 | 15 | <div id="comments"> |
16 | 16 | <?php if ( post_password_required() ) : ?> |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | */ |
14 | 14 | ?> |
15 | 15 | <div id="comments"> |
16 | - <?php if ( post_password_required() ) : ?> |
|
17 | - <p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p> |
|
16 | + <?php if (post_password_required()) : ?> |
|
17 | + <p class="nopassword"><?php _e('This post is password protected. Enter the password to view any comments.', 'twentyeleven'); ?></p> |
|
18 | 18 | </div><!-- #comments --> |
19 | 19 | <?php |
20 | 20 | /* |
@@ -28,19 +28,19 @@ discard block |
||
28 | 28 | |
29 | 29 | <?php // You can start editing here -- including this comment! ?> |
30 | 30 | |
31 | - <?php if ( have_comments() ) : ?> |
|
31 | + <?php if (have_comments()) : ?> |
|
32 | 32 | <h2 id="comments-title"> |
33 | 33 | <?php |
34 | - printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyeleven' ), |
|
35 | - number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' ); |
|
34 | + printf(_n('One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyeleven'), |
|
35 | + number_format_i18n(get_comments_number()), '<span>'.get_the_title().'</span>'); |
|
36 | 36 | ?> |
37 | 37 | </h2> |
38 | 38 | |
39 | - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
|
39 | + <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // are there comments to navigate through ?> |
|
40 | 40 | <nav id="comment-nav-above"> |
41 | - <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> |
|
42 | - <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div> |
|
43 | - <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div> |
|
41 | + <h1 class="assistive-text"><?php _e('Comment navigation', 'twentyeleven'); ?></h1> |
|
42 | + <div class="nav-previous"><?php previous_comments_link(__('← Older Comments', 'twentyeleven')); ?></div> |
|
43 | + <div class="nav-next"><?php next_comments_link(__('Newer Comments →', 'twentyeleven')); ?></div> |
|
44 | 44 | </nav> |
45 | 45 | <?php endif; // check for comment navigation ?> |
46 | 46 | |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | * define twentyeleven_comment() and that will be used instead. |
54 | 54 | * See twentyeleven_comment() in twentyeleven/functions.php for more. |
55 | 55 | */ |
56 | - wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) ); |
|
56 | + wp_list_comments(array('callback' => 'twentyeleven_comment')); |
|
57 | 57 | ?> |
58 | 58 | </ol> |
59 | 59 | |
60 | - <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> |
|
60 | + <?php if (get_comment_pages_count() > 1 && get_option('page_comments')) : // are there comments to navigate through ?> |
|
61 | 61 | <nav id="comment-nav-below"> |
62 | - <h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1> |
|
63 | - <div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div> |
|
64 | - <div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div> |
|
62 | + <h1 class="assistive-text"><?php _e('Comment navigation', 'twentyeleven'); ?></h1> |
|
63 | + <div class="nav-previous"><?php previous_comments_link(__('← Older Comments', 'twentyeleven')); ?></div> |
|
64 | + <div class="nav-next"><?php next_comments_link(__('Newer Comments →', 'twentyeleven')); ?></div> |
|
65 | 65 | </nav> |
66 | 66 | <?php endif; // check for comment navigation ?> |
67 | 67 | |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | * If there are no comments and comments are closed, let's leave a little note, shall we? |
71 | 71 | * But we only want the note on posts and pages that had comments in the first place. |
72 | 72 | */ |
73 | - if ( ! comments_open() && get_comments_number() ) : ?> |
|
74 | - <p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ); ?></p> |
|
73 | + if ( ! comments_open() && get_comments_number()) : ?> |
|
74 | + <p class="nocomments"><?php _e('Comments are closed.', 'twentyeleven'); ?></p> |
|
75 | 75 | <?php endif; ?> |
76 | 76 | |
77 | 77 | <?php endif; // have_comments() ?> |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * @package Hello_Dolly |
|
4 | - * @version 1.6 |
|
5 | - */ |
|
3 | + * @package Hello_Dolly |
|
4 | + * @version 1.6 |
|
5 | + */ |
|
6 | 6 | /* |
7 | 7 | Plugin Name: Hello Dolly |
8 | 8 | Plugin URI: http://wordpress.org/plugins/hello-dolly/ |
@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | Dolly'll never go away again"; |
45 | 45 | |
46 | 46 | // Here we split it into lines |
47 | - $lyrics = explode( "\n", $lyrics ); |
|
47 | + $lyrics = explode("\n", $lyrics); |
|
48 | 48 | |
49 | 49 | // And then randomly choose a line |
50 | - return wptexturize( $lyrics[ mt_rand( 0, count( $lyrics ) - 1 ) ] ); |
|
50 | + return wptexturize($lyrics[mt_rand(0, count($lyrics) - 1)]); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | // This just echoes the chosen line, we'll position it later |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | // Now we set that function up to execute when the admin_notices action is called |
60 | -add_action( 'admin_notices', 'hello_dolly' ); |
|
60 | +add_action('admin_notices', 'hello_dolly'); |
|
61 | 61 | |
62 | 62 | // We need some CSS to position the paragraph |
63 | 63 | function dolly_css() { |
@@ -77,6 +77,6 @@ discard block |
||
77 | 77 | "; |
78 | 78 | } |
79 | 79 | |
80 | -add_action( 'admin_head', 'dolly_css' ); |
|
80 | +add_action('admin_head', 'dolly_css'); |
|
81 | 81 | |
82 | 82 | ?> |
@@ -8,29 +8,29 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | /** Make sure that the WordPress bootstrap has run before continuing. */ |
11 | -require(dirname(__FILE__) . '/wp-load.php'); |
|
11 | +require(dirname(__FILE__).'/wp-load.php'); |
|
12 | 12 | |
13 | 13 | /** This filter is documented in wp-admin/options.php */ |
14 | -if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) |
|
15 | - wp_die( __( 'This action has been disabled by the administrator.' ) ); |
|
14 | +if ( ! apply_filters('enable_post_by_email_configuration', true)) |
|
15 | + wp_die(__('This action has been disabled by the administrator.')); |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Fires to allow a plugin to do a complete takeover of Post by Email. |
19 | 19 | * |
20 | 20 | * @since 2.9.0 |
21 | 21 | */ |
22 | -do_action( 'wp-mail.php' ); |
|
22 | +do_action('wp-mail.php'); |
|
23 | 23 | |
24 | 24 | /** Get the POP3 class with which to access the mailbox. */ |
25 | -require_once( ABSPATH . WPINC . '/class-pop3.php' ); |
|
25 | +require_once(ABSPATH.WPINC.'/class-pop3.php'); |
|
26 | 26 | |
27 | 27 | /** Only check at this interval for new messages. */ |
28 | -if ( !defined('WP_MAIL_INTERVAL') ) |
|
28 | +if ( ! defined('WP_MAIL_INTERVAL')) |
|
29 | 29 | define('WP_MAIL_INTERVAL', 300); // 5 minutes |
30 | 30 | |
31 | 31 | $last_checked = get_transient('mailserver_last_checked'); |
32 | 32 | |
33 | -if ( $last_checked ) |
|
33 | +if ($last_checked) |
|
34 | 34 | wp_die(__('Slow down cowboy, no need to check for new mails so often!')); |
35 | 35 | |
36 | 36 | set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL); |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | |
42 | 42 | $pop3 = new POP3(); |
43 | 43 | |
44 | -if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) |
|
45 | - wp_die( esc_html( $pop3->ERROR ) ); |
|
44 | +if ( ! $pop3->connect(get_option('mailserver_url'), get_option('mailserver_port')) || ! $pop3->user(get_option('mailserver_login'))) |
|
45 | + wp_die(esc_html($pop3->ERROR)); |
|
46 | 46 | |
47 | -$count = $pop3->pass( get_option('mailserver_pass') ); |
|
47 | +$count = $pop3->pass(get_option('mailserver_pass')); |
|
48 | 48 | |
49 | -if( false === $count ) |
|
50 | - wp_die( esc_html( $pop3->ERROR ) ); |
|
49 | +if (false === $count) |
|
50 | + wp_die(esc_html($pop3->ERROR)); |
|
51 | 51 | |
52 | -if( 0 === $count ) { |
|
52 | +if (0 === $count) { |
|
53 | 53 | $pop3->quit(); |
54 | - wp_die( __('There doesn’t seem to be any new mail.') ); |
|
54 | + wp_die(__('There doesn’t seem to be any new mail.')); |
|
55 | 55 | } |
56 | 56 | |
57 | -for ( $i = 1; $i <= $count; $i++ ) { |
|
57 | +for ($i = 1; $i <= $count; $i++) { |
|
58 | 58 | |
59 | 59 | $message = $pop3->get($i); |
60 | 60 | |
@@ -69,28 +69,28 @@ discard block |
||
69 | 69 | $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); |
70 | 70 | foreach ($message as $line) { |
71 | 71 | // Body signal. |
72 | - if ( strlen($line) < 3 ) |
|
72 | + if (strlen($line) < 3) |
|
73 | 73 | $bodysignal = true; |
74 | - if ( $bodysignal ) { |
|
74 | + if ($bodysignal) { |
|
75 | 75 | $content .= $line; |
76 | 76 | } else { |
77 | - if ( preg_match('/Content-Type: /i', $line) ) { |
|
77 | + if (preg_match('/Content-Type: /i', $line)) { |
|
78 | 78 | $content_type = trim($line); |
79 | 79 | $content_type = substr($content_type, 14, strlen($content_type) - 14); |
80 | 80 | $content_type = explode(';', $content_type); |
81 | - if ( ! empty( $content_type[1] ) ) { |
|
81 | + if ( ! empty($content_type[1])) { |
|
82 | 82 | $charset = explode('=', $content_type[1]); |
83 | - $charset = ( ! empty( $charset[1] ) ) ? trim($charset[1]) : ''; |
|
83 | + $charset = ( ! empty($charset[1])) ? trim($charset[1]) : ''; |
|
84 | 84 | } |
85 | 85 | $content_type = $content_type[0]; |
86 | 86 | } |
87 | - if ( preg_match('/Content-Transfer-Encoding: /i', $line) ) { |
|
87 | + if (preg_match('/Content-Transfer-Encoding: /i', $line)) { |
|
88 | 88 | $content_transfer_encoding = trim($line); |
89 | 89 | $content_transfer_encoding = substr($content_transfer_encoding, 27, strlen($content_transfer_encoding) - 27); |
90 | 90 | $content_transfer_encoding = explode(';', $content_transfer_encoding); |
91 | 91 | $content_transfer_encoding = $content_transfer_encoding[0]; |
92 | 92 | } |
93 | - if ( ( $content_type == 'multipart/alternative' ) && ( false !== strpos($line, 'boundary="') ) && ( '' == $boundary ) ) { |
|
93 | + if (($content_type == 'multipart/alternative') && (false !== strpos($line, 'boundary="')) && ('' == $boundary)) { |
|
94 | 94 | $boundary = trim($line); |
95 | 95 | $boundary = explode('"', $boundary); |
96 | 96 | $boundary = $boundary[1]; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $subject = trim($line); |
100 | 100 | $subject = substr($subject, 9, strlen($subject) - 9); |
101 | 101 | // Captures any text in the subject before $phone_delim as the subject |
102 | - if ( function_exists('iconv_mime_decode') ) { |
|
102 | + if (function_exists('iconv_mime_decode')) { |
|
103 | 103 | $subject = iconv_mime_decode($subject, 2, get_option('blog_charset')); |
104 | 104 | } else { |
105 | 105 | $subject = wp_iso_descrambler($subject); |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | * Set the author using the email address (From or Reply-To, the last used) |
113 | 113 | * otherwise use the site admin. |
114 | 114 | */ |
115 | - if ( ! $author_found && preg_match( '/^(From|Reply-To): /', $line ) ) { |
|
116 | - if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) |
|
115 | + if ( ! $author_found && preg_match('/^(From|Reply-To): /', $line)) { |
|
116 | + if (preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches)) |
|
117 | 117 | $author = $matches[0]; |
118 | 118 | else |
119 | 119 | $author = trim($line); |
120 | 120 | $author = sanitize_email($author); |
121 | - if ( is_email($author) ) { |
|
122 | - echo '<p>' . sprintf(__('Author is %s'), $author) . '</p>'; |
|
121 | + if (is_email($author)) { |
|
122 | + echo '<p>'.sprintf(__('Author is %s'), $author).'</p>'; |
|
123 | 123 | $userdata = get_user_by('email', $author); |
124 | - if ( ! empty( $userdata ) ) { |
|
124 | + if ( ! empty($userdata)) { |
|
125 | 125 | $post_author = $userdata->ID; |
126 | 126 | $author_found = true; |
127 | 127 | } |
@@ -144,9 +144,9 @@ discard block |
||
144 | 144 | $ddate_m = $date_arr[1]; |
145 | 145 | $ddate_d = $date_arr[0]; |
146 | 146 | $ddate_Y = $date_arr[2]; |
147 | - for ( $j = 0; $j < 12; $j++ ) { |
|
148 | - if ( $ddate_m == $dmonths[$j] ) { |
|
149 | - $ddate_m = $j+1; |
|
147 | + for ($j = 0; $j < 12; $j++) { |
|
148 | + if ($ddate_m == $dmonths[$j]) { |
|
149 | + $ddate_m = $j + 1; |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | } |
161 | 161 | |
162 | 162 | // Set $post_status based on $author_found and on author's publish_posts capability |
163 | - if ( $author_found ) { |
|
163 | + if ($author_found) { |
|
164 | 164 | $user = new WP_User($post_author); |
165 | - $post_status = ( $user->has_cap('publish_posts') ) ? 'publish' : 'pending'; |
|
165 | + $post_status = ($user->has_cap('publish_posts')) ? 'publish' : 'pending'; |
|
166 | 166 | } else { |
167 | 167 | // Author not found in DB, set status to pending. Author already set to admin. |
168 | 168 | $post_status = 'pending'; |
@@ -170,12 +170,12 @@ discard block |
||
170 | 170 | |
171 | 171 | $subject = trim($subject); |
172 | 172 | |
173 | - if ( $content_type == 'multipart/alternative' ) { |
|
173 | + if ($content_type == 'multipart/alternative') { |
|
174 | 174 | $content = explode('--'.$boundary, $content); |
175 | 175 | $content = $content[2]; |
176 | 176 | |
177 | 177 | // Match case-insensitive content-transfer-encoding. |
178 | - if ( preg_match( '/Content-Transfer-Encoding: quoted-printable/i', $content, $delim) ) { |
|
178 | + if (preg_match('/Content-Transfer-Encoding: quoted-printable/i', $content, $delim)) { |
|
179 | 179 | $content = explode($delim[0], $content); |
180 | 180 | $content = $content[1]; |
181 | 181 | } |
@@ -193,19 +193,19 @@ discard block |
||
193 | 193 | * |
194 | 194 | * @param string $content The original email content. |
195 | 195 | */ |
196 | - $content = apply_filters( 'wp_mail_original_content', $content ); |
|
196 | + $content = apply_filters('wp_mail_original_content', $content); |
|
197 | 197 | |
198 | - if ( false !== stripos($content_transfer_encoding, "quoted-printable") ) { |
|
198 | + if (false !== stripos($content_transfer_encoding, "quoted-printable")) { |
|
199 | 199 | $content = quoted_printable_decode($content); |
200 | 200 | } |
201 | 201 | |
202 | - if ( function_exists('iconv') && ! empty( $charset ) ) { |
|
202 | + if (function_exists('iconv') && ! empty($charset)) { |
|
203 | 203 | $content = iconv($charset, get_option('blog_charset'), $content); |
204 | 204 | } |
205 | 205 | |
206 | 206 | // Captures any text in the body after $phone_delim as the body |
207 | 207 | $content = explode($phone_delim, $content); |
208 | - $content = empty( $content[1] ) ? $content[0] : $content[1]; |
|
208 | + $content = empty($content[1]) ? $content[0] : $content[1]; |
|
209 | 209 | |
210 | 210 | $content = trim($content); |
211 | 211 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * |
217 | 217 | * @param string $content The email content. |
218 | 218 | */ |
219 | - $post_content = apply_filters( 'phone_content', $content ); |
|
219 | + $post_content = apply_filters('phone_content', $content); |
|
220 | 220 | |
221 | 221 | $post_title = xmlrpc_getposttitle($content); |
222 | 222 | |
@@ -224,15 +224,15 @@ discard block |
||
224 | 224 | |
225 | 225 | $post_category = array(get_option('default_email_category')); |
226 | 226 | |
227 | - $post_data = compact('post_content','post_title','post_date','post_date_gmt','post_author','post_category', 'post_status'); |
|
227 | + $post_data = compact('post_content', 'post_title', 'post_date', 'post_date_gmt', 'post_author', 'post_category', 'post_status'); |
|
228 | 228 | $post_data = wp_slash($post_data); |
229 | 229 | |
230 | 230 | $post_ID = wp_insert_post($post_data); |
231 | - if ( is_wp_error( $post_ID ) ) |
|
232 | - echo "\n" . $post_ID->get_error_message(); |
|
231 | + if (is_wp_error($post_ID)) |
|
232 | + echo "\n".$post_ID->get_error_message(); |
|
233 | 233 | |
234 | 234 | // We couldn't post, for whatever reason. Better move forward to the next email. |
235 | - if ( empty( $post_ID ) ) |
|
235 | + if (empty($post_ID)) |
|
236 | 236 | continue; |
237 | 237 | |
238 | 238 | /** |
@@ -242,17 +242,17 @@ discard block |
||
242 | 242 | * |
243 | 243 | * @param int $post_ID The post ID. |
244 | 244 | */ |
245 | - do_action( 'publish_phone', $post_ID ); |
|
245 | + do_action('publish_phone', $post_ID); |
|
246 | 246 | |
247 | - echo "\n<p>" . sprintf(__('<strong>Author:</strong> %s'), esc_html($post_author)) . '</p>'; |
|
248 | - echo "\n<p>" . sprintf(__('<strong>Posted title:</strong> %s'), esc_html($post_title)) . '</p>'; |
|
247 | + echo "\n<p>".sprintf(__('<strong>Author:</strong> %s'), esc_html($post_author)).'</p>'; |
|
248 | + echo "\n<p>".sprintf(__('<strong>Posted title:</strong> %s'), esc_html($post_title)).'</p>'; |
|
249 | 249 | |
250 | - if(!$pop3->delete($i)) { |
|
251 | - echo '<p>' . sprintf(__('Oops: %s'), esc_html($pop3->ERROR)) . '</p>'; |
|
250 | + if ( ! $pop3->delete($i)) { |
|
251 | + echo '<p>'.sprintf(__('Oops: %s'), esc_html($pop3->ERROR)).'</p>'; |
|
252 | 252 | $pop3->reset(); |
253 | 253 | exit; |
254 | 254 | } else { |
255 | - echo '<p>' . sprintf(__('Mission complete. Message <strong>%s</strong> deleted.'), $i) . '</p>'; |
|
255 | + echo '<p>'.sprintf(__('Mission complete. Message <strong>%s</strong> deleted.'), $i).'</p>'; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | } |
@@ -11,8 +11,9 @@ discard block |
||
11 | 11 | require(dirname(__FILE__) . '/wp-load.php'); |
12 | 12 | |
13 | 13 | /** This filter is documented in wp-admin/options.php */ |
14 | -if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) |
|
14 | +if ( ! apply_filters( 'enable_post_by_email_configuration', true ) ) { |
|
15 | 15 | wp_die( __( 'This action has been disabled by the administrator.' ) ); |
16 | +} |
|
16 | 17 | |
17 | 18 | /** |
18 | 19 | * Fires to allow a plugin to do a complete takeover of Post by Email. |
@@ -25,13 +26,16 @@ discard block |
||
25 | 26 | require_once( ABSPATH . WPINC . '/class-pop3.php' ); |
26 | 27 | |
27 | 28 | /** Only check at this interval for new messages. */ |
28 | -if ( !defined('WP_MAIL_INTERVAL') ) |
|
29 | - define('WP_MAIL_INTERVAL', 300); // 5 minutes |
|
29 | +if ( !defined('WP_MAIL_INTERVAL') ) { |
|
30 | + define('WP_MAIL_INTERVAL', 300); |
|
31 | +} |
|
32 | +// 5 minutes |
|
30 | 33 | |
31 | 34 | $last_checked = get_transient('mailserver_last_checked'); |
32 | 35 | |
33 | -if ( $last_checked ) |
|
36 | +if ( $last_checked ) { |
|
34 | 37 | wp_die(__('Slow down cowboy, no need to check for new mails so often!')); |
38 | +} |
|
35 | 39 | |
36 | 40 | set_transient('mailserver_last_checked', true, WP_MAIL_INTERVAL); |
37 | 41 | |
@@ -41,13 +45,15 @@ discard block |
||
41 | 45 | |
42 | 46 | $pop3 = new POP3(); |
43 | 47 | |
44 | -if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) |
|
48 | +if ( !$pop3->connect( get_option('mailserver_url'), get_option('mailserver_port') ) || !$pop3->user( get_option('mailserver_login') ) ) { |
|
45 | 49 | wp_die( esc_html( $pop3->ERROR ) ); |
50 | +} |
|
46 | 51 | |
47 | 52 | $count = $pop3->pass( get_option('mailserver_pass') ); |
48 | 53 | |
49 | -if( false === $count ) |
|
54 | +if( false === $count ) { |
|
50 | 55 | wp_die( esc_html( $pop3->ERROR ) ); |
56 | +} |
|
51 | 57 | |
52 | 58 | if( 0 === $count ) { |
53 | 59 | $pop3->quit(); |
@@ -69,8 +75,9 @@ discard block |
||
69 | 75 | $dmonths = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); |
70 | 76 | foreach ($message as $line) { |
71 | 77 | // Body signal. |
72 | - if ( strlen($line) < 3 ) |
|
73 | - $bodysignal = true; |
|
78 | + if ( strlen($line) < 3 ) { |
|
79 | + $bodysignal = true; |
|
80 | + } |
|
74 | 81 | if ( $bodysignal ) { |
75 | 82 | $content .= $line; |
76 | 83 | } else { |
@@ -113,10 +120,11 @@ discard block |
||
113 | 120 | * otherwise use the site admin. |
114 | 121 | */ |
115 | 122 | if ( ! $author_found && preg_match( '/^(From|Reply-To): /', $line ) ) { |
116 | - if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) |
|
117 | - $author = $matches[0]; |
|
118 | - else |
|
119 | - $author = trim($line); |
|
123 | + if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) { |
|
124 | + $author = $matches[0]; |
|
125 | + } else { |
|
126 | + $author = trim($line); |
|
127 | + } |
|
120 | 128 | $author = sanitize_email($author); |
121 | 129 | if ( is_email($author) ) { |
122 | 130 | echo '<p>' . sprintf(__('Author is %s'), $author) . '</p>'; |
@@ -220,7 +228,9 @@ discard block |
||
220 | 228 | |
221 | 229 | $post_title = xmlrpc_getposttitle($content); |
222 | 230 | |
223 | - if ($post_title == '') $post_title = $subject; |
|
231 | + if ($post_title == '') { |
|
232 | + $post_title = $subject; |
|
233 | + } |
|
224 | 234 | |
225 | 235 | $post_category = array(get_option('default_email_category')); |
226 | 236 | |
@@ -228,12 +238,14 @@ discard block |
||
228 | 238 | $post_data = wp_slash($post_data); |
229 | 239 | |
230 | 240 | $post_ID = wp_insert_post($post_data); |
231 | - if ( is_wp_error( $post_ID ) ) |
|
232 | - echo "\n" . $post_ID->get_error_message(); |
|
241 | + if ( is_wp_error( $post_ID ) ) { |
|
242 | + echo "\n" . $post_ID->get_error_message(); |
|
243 | + } |
|
233 | 244 | |
234 | 245 | // We couldn't post, for whatever reason. Better move forward to the next email. |
235 | - if ( empty( $post_ID ) ) |
|
236 | - continue; |
|
246 | + if ( empty( $post_ID ) ) { |
|
247 | + continue; |
|
248 | + } |
|
237 | 249 | |
238 | 250 | /** |
239 | 251 | * Fires after a post submitted by email is published. |
@@ -12,21 +12,21 @@ discard block |
||
12 | 12 | * @package WordPress |
13 | 13 | */ |
14 | 14 | |
15 | -require_once( dirname( __FILE__ ) . '/wp-load.php' ); |
|
15 | +require_once(dirname(__FILE__).'/wp-load.php'); |
|
16 | 16 | |
17 | -header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); |
|
17 | +header('Content-Type: text/xml; charset='.get_option('blog_charset'), true); |
|
18 | 18 | $link_cat = ''; |
19 | -if ( !empty($_GET['link_cat']) ) { |
|
19 | +if ( ! empty($_GET['link_cat'])) { |
|
20 | 20 | $link_cat = $_GET['link_cat']; |
21 | - if ( !in_array($link_cat, array('all', '0')) ) |
|
22 | - $link_cat = absint( (string)urldecode($link_cat) ); |
|
21 | + if ( ! in_array($link_cat, array('all', '0'))) |
|
22 | + $link_cat = absint((string) urldecode($link_cat)); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | echo '<?xml version="1.0"?'.">\n"; |
26 | 26 | ?> |
27 | 27 | <opml version="1.0"> |
28 | 28 | <head> |
29 | - <title><?php printf( __('Links for %s'), esc_attr(get_bloginfo('name', 'display')) ); ?></title> |
|
29 | + <title><?php printf(__('Links for %s'), esc_attr(get_bloginfo('name', 'display'))); ?></title> |
|
30 | 30 | <dateCreated><?php echo gmdate("D, d M Y H:i:s"); ?> GMT</dateCreated> |
31 | 31 | <?php |
32 | 32 | /** |
@@ -34,17 +34,17 @@ discard block |
||
34 | 34 | * |
35 | 35 | * @since 3.0.0 |
36 | 36 | */ |
37 | - do_action( 'opml_head' ); |
|
37 | + do_action('opml_head'); |
|
38 | 38 | ?> |
39 | 39 | </head> |
40 | 40 | <body> |
41 | 41 | <?php |
42 | -if ( empty($link_cat) ) |
|
42 | +if (empty($link_cat)) |
|
43 | 43 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0)); |
44 | 44 | else |
45 | 45 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat)); |
46 | 46 | |
47 | -foreach ( (array)$cats as $cat ) : |
|
47 | +foreach ((array) $cats as $cat) : |
|
48 | 48 | /** |
49 | 49 | * Filter the OPML outline link category name. |
50 | 50 | * |
@@ -52,13 +52,13 @@ discard block |
||
52 | 52 | * |
53 | 53 | * @param string $catname The OPML outline category name. |
54 | 54 | */ |
55 | - $catname = apply_filters( 'link_category', $cat->name ); |
|
55 | + $catname = apply_filters('link_category', $cat->name); |
|
56 | 56 | |
57 | 57 | ?> |
58 | 58 | <outline type="category" title="<?php echo esc_attr($catname); ?>"> |
59 | 59 | <?php |
60 | 60 | $bookmarks = get_bookmarks(array("category" => $cat->term_id)); |
61 | - foreach ( (array)$bookmarks as $bookmark ) : |
|
61 | + foreach ((array) $bookmarks as $bookmark) : |
|
62 | 62 | /** |
63 | 63 | * Filter the OPML outline link title text. |
64 | 64 | * |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param string $title The OPML outline title text. |
68 | 68 | */ |
69 | - $title = apply_filters( 'link_title', $bookmark->link_name ); |
|
69 | + $title = apply_filters('link_title', $bookmark->link_name); |
|
70 | 70 | ?> |
71 | 71 | <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" /> |
72 | 72 | <?php |
@@ -18,9 +18,10 @@ discard block |
||
18 | 18 | $link_cat = ''; |
19 | 19 | if ( !empty($_GET['link_cat']) ) { |
20 | 20 | $link_cat = $_GET['link_cat']; |
21 | - if ( !in_array($link_cat, array('all', '0')) ) |
|
22 | - $link_cat = absint( (string)urldecode($link_cat) ); |
|
23 | -} |
|
21 | + if ( !in_array($link_cat, array('all', '0')) ) { |
|
22 | + $link_cat = absint( (string)urldecode($link_cat) ); |
|
23 | + } |
|
24 | + } |
|
24 | 25 | |
25 | 26 | echo '<?xml version="1.0"?'.">\n"; |
26 | 27 | ?> |
@@ -39,10 +40,11 @@ discard block |
||
39 | 40 | </head> |
40 | 41 | <body> |
41 | 42 | <?php |
42 | -if ( empty($link_cat) ) |
|
43 | +if ( empty($link_cat) ) { |
|
43 | 44 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0)); |
44 | -else |
|
45 | +} else { |
|
45 | 46 | $cats = get_categories(array('taxonomy' => 'link_category', 'hierarchical' => 0, 'include' => $link_cat)); |
47 | +} |
|
46 | 48 | |
47 | 49 | foreach ( (array)$cats as $cat ) : |
48 | 50 | /** |
@@ -68,7 +70,10 @@ discard block |
||
68 | 70 | */ |
69 | 71 | $title = apply_filters( 'link_title', $bookmark->link_name ); |
70 | 72 | ?> |
71 | - <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) echo $bookmark->link_updated; ?>" /> |
|
73 | + <outline text="<?php echo esc_attr($title); ?>" type="link" xmlUrl="<?php echo esc_attr($bookmark->link_rss); ?>" htmlUrl="<?php echo esc_attr($bookmark->link_url); ?>" updated="<?php if ('0000-00-00 00:00:00' != $bookmark->link_updated) { |
|
74 | + echo $bookmark->link_updated; |
|
75 | +} |
|
76 | +?>" /> |
|
72 | 77 | <?php |
73 | 78 | endforeach; // $bookmarks |
74 | 79 | ?> |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Tools Administration Screen. |
|
4 | - * |
|
5 | - * @package WordPress |
|
6 | - * @subpackage Administration |
|
7 | - */ |
|
3 | + * Tools Administration Screen. |
|
4 | + * |
|
5 | + * @package WordPress |
|
6 | + * @subpackage Administration |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | 10 | require_once( dirname( __FILE__ ) . '/admin.php' ); |
@@ -7,68 +7,68 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** WordPress Administration Bootstrap */ |
10 | -require_once( dirname( __FILE__ ) . '/admin.php' ); |
|
10 | +require_once(dirname(__FILE__).'/admin.php'); |
|
11 | 11 | |
12 | 12 | $title = __('Tools'); |
13 | 13 | |
14 | -get_current_screen()->add_help_tab( array( |
|
14 | +get_current_screen()->add_help_tab(array( |
|
15 | 15 | 'id' => 'press-this', |
16 | 16 | 'title' => __('Press This'), |
17 | - 'content' => '<p>' . __('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.') . '</p>', |
|
18 | -) ); |
|
19 | -get_current_screen()->add_help_tab( array( |
|
17 | + 'content' => '<p>'.__('Press This is a bookmarklet that makes it easy to blog about something you come across on the web. You can use it to just grab a link, or to post an excerpt. Press This will even allow you to choose from images included on the page and use them in your post. Just drag the Press This link on this screen to your bookmarks bar in your browser, and you’ll be on your way to easier content creation. Clicking on it while on another website opens a popup window with all these options.').'</p>', |
|
18 | +)); |
|
19 | +get_current_screen()->add_help_tab(array( |
|
20 | 20 | 'id' => 'converter', |
21 | 21 | 'title' => __('Categories and Tags Converter'), |
22 | - 'content' => '<p>' . __('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.' ) . '</p>' . |
|
23 | - '<p>' . __( 'The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.' ) . '</p>', |
|
24 | -) ); |
|
22 | + 'content' => '<p>'.__('Categories have hierarchy, meaning that you can nest sub-categories. Tags do not have hierarchy and cannot be nested. Sometimes people start out using one on their posts, then later realize that the other would work better for their content.').'</p>'. |
|
23 | + '<p>'.__('The Categories and Tags Converter link on this screen will take you to the Import screen, where that Converter is one of the plugins you can install. Once that plugin is installed, the Activate Plugin & Run Importer link will take you to a screen where you can choose to convert tags into categories or vice versa.').'</p>', |
|
24 | +)); |
|
25 | 25 | |
26 | 26 | get_current_screen()->set_help_sidebar( |
27 | - '<p><strong>' . __('For more information:') . '</strong></p>' . |
|
28 | - '<p>' . __('<a href="https://codex.wordpress.org/Tools_Screen" target="_blank">Documentation on Tools</a>') . '</p>' . |
|
29 | - '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' |
|
27 | + '<p><strong>'.__('For more information:').'</strong></p>'. |
|
28 | + '<p>'.__('<a href="https://codex.wordpress.org/Tools_Screen" target="_blank">Documentation on Tools</a>').'</p>'. |
|
29 | + '<p>'.__('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>').'</p>' |
|
30 | 30 | ); |
31 | 31 | |
32 | -require_once( ABSPATH . 'wp-admin/admin-header.php' ); |
|
32 | +require_once(ABSPATH.'wp-admin/admin-header.php'); |
|
33 | 33 | |
34 | 34 | ?> |
35 | 35 | <div class="wrap"> |
36 | -<h1><?php echo esc_html( $title ); ?></h1> |
|
36 | +<h1><?php echo esc_html($title); ?></h1> |
|
37 | 37 | |
38 | -<?php if ( current_user_can('edit_posts') ) : ?> |
|
38 | +<?php if (current_user_can('edit_posts')) : ?> |
|
39 | 39 | <div class="card pressthis"> |
40 | 40 | <h3><?php _e('Press This') ?></h3> |
41 | - <p><?php _e( 'Press This is a little tool that lets you grab bits of the web and create new posts with ease.' );?></p> |
|
42 | - <p><?php _e( 'Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.' ); ?></p> |
|
41 | + <p><?php _e('Press This is a little tool that lets you grab bits of the web and create new posts with ease.'); ?></p> |
|
42 | + <p><?php _e('Use Press This to clip text, images and videos from any web page. Then edit and add more straight from Press This before you save or publish it in a post on your site.'); ?></p> |
|
43 | 43 | |
44 | 44 | |
45 | 45 | <form> |
46 | - <h3><?php _e( 'Install Press This' ); ?></h3> |
|
47 | - <h4><?php _e( 'Bookmarklet' ); ?></h4> |
|
48 | - <p><?php _e( 'Drag the bookmarklet below to your bookmarks bar. Then, when you’re on a page you want to share, simply “press” it.' ); ?></p> |
|
46 | + <h3><?php _e('Install Press This'); ?></h3> |
|
47 | + <h4><?php _e('Bookmarklet'); ?></h4> |
|
48 | + <p><?php _e('Drag the bookmarklet below to your bookmarks bar. Then, when you’re on a page you want to share, simply “press” it.'); ?></p> |
|
49 | 49 | |
50 | 50 | <p class="pressthis-bookmarklet-wrapper"> |
51 | - <a class="pressthis-bookmarklet" onclick="return false;" href="<?php echo htmlspecialchars( get_shortcut_link() ); ?>"><span><?php _e( 'Press This' ); ?></span></a> |
|
51 | + <a class="pressthis-bookmarklet" onclick="return false;" href="<?php echo htmlspecialchars(get_shortcut_link()); ?>"><span><?php _e('Press This'); ?></span></a> |
|
52 | 52 | <button type="button" class="button button-secondary pressthis-js-toggle js-show-pressthis-code-wrap" aria-expanded="false" aria-controls="pressthis-code-wrap"> |
53 | 53 | <span class="dashicons dashicons-clipboard"></span> |
54 | - <span class="screen-reader-text"><?php _e( 'Copy “Press This” bookmarklet code' ) ?></span> |
|
54 | + <span class="screen-reader-text"><?php _e('Copy “Press This” bookmarklet code') ?></span> |
|
55 | 55 | </button> |
56 | 56 | </p> |
57 | 57 | |
58 | 58 | <div class="hidden js-pressthis-code-wrap clear" id="pressthis-code-wrap"> |
59 | 59 | <p id="pressthis-code-desc"> |
60 | - <?php _e( 'If you can’t drag the bookmarklet to your bookmarks, copy the following code and create a new bookmark. Paste the code into the new bookmark’s URL field.' ) ?> |
|
60 | + <?php _e('If you can’t drag the bookmarklet to your bookmarks, copy the following code and create a new bookmark. Paste the code into the new bookmark’s URL field.') ?> |
|
61 | 61 | </p> |
62 | 62 | <p> |
63 | - <textarea class="js-pressthis-code" rows="5" cols="120" readonly="readonly" aria-labelledby="pressthis-code-desc"><?php echo htmlspecialchars( get_shortcut_link() ); ?></textarea> |
|
63 | + <textarea class="js-pressthis-code" rows="5" cols="120" readonly="readonly" aria-labelledby="pressthis-code-desc"><?php echo htmlspecialchars(get_shortcut_link()); ?></textarea> |
|
64 | 64 | </p> |
65 | 65 | </div> |
66 | 66 | |
67 | - <h4><?php _e( 'Direct link (best for mobile)' ); ?></h4> |
|
68 | - <p><?php _e( 'Follow the link to open Press This. Then add it to your device’s bookmarks or home screen.' ); ?></p> |
|
67 | + <h4><?php _e('Direct link (best for mobile)'); ?></h4> |
|
68 | + <p><?php _e('Follow the link to open Press This. Then add it to your device’s bookmarks or home screen.'); ?></p> |
|
69 | 69 | |
70 | 70 | <p> |
71 | - <a class="button button-secondary" href="<?php echo htmlspecialchars( admin_url( 'press-this.php' ) ); ?>"><?php _e( 'Open Press This' ) ?></a> |
|
71 | + <a class="button button-secondary" href="<?php echo htmlspecialchars(admin_url('press-this.php')); ?>"><?php _e('Open Press This') ?></a> |
|
72 | 72 | </p> |
73 | 73 | <script> |
74 | 74 | jQuery( document ).ready( function( $ ) { |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | <?php |
96 | 96 | endif; |
97 | 97 | |
98 | -if ( current_user_can( 'import' ) ) : |
|
98 | +if (current_user_can('import')) : |
|
99 | 99 | $cats = get_taxonomy('category'); |
100 | 100 | $tags = get_taxonomy('post_tag'); |
101 | -if ( current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms) ) : ?> |
|
101 | +if (current_user_can($cats->cap->manage_terms) || current_user_can($tags->cap->manage_terms)) : ?> |
|
102 | 102 | <div class="card"> |
103 | - <h3 class="title"><?php _e( 'Categories and Tags Converter' ) ?></h3> |
|
104 | - <p><?php printf( __('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php' ); ?></p> |
|
103 | + <h3 class="title"><?php _e('Categories and Tags Converter') ?></h3> |
|
104 | + <p><?php printf(__('If you want to convert your categories to tags (or vice versa), use the <a href="%s">Categories and Tags Converter</a> available from the Import screen.'), 'import.php'); ?></p> |
|
105 | 105 | </div> |
106 | 106 | <?php |
107 | 107 | endif; |
@@ -112,8 +112,8 @@ discard block |
||
112 | 112 | * |
113 | 113 | * @since 2.8.0 |
114 | 114 | */ |
115 | -do_action( 'tool_box' ); |
|
115 | +do_action('tool_box'); |
|
116 | 116 | ?> |
117 | 117 | </div> |
118 | 118 | <?php |
119 | -include( ABSPATH . 'wp-admin/admin-footer.php' ); |
|
119 | +include(ABSPATH.'wp-admin/admin-footer.php'); |