@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @see https://github.com/WordPress/WordPress/blob/4.0/wp-includes/post.php#L167 |
39 | 39 | */ |
40 | - add_action( 'init', array( $this, 'register_gateway_post_type' ), 0 ); // Highest priority. |
|
40 | + add_action('init', array($this, 'register_gateway_post_type'), 0); // Highest priority. |
|
41 | 41 | |
42 | - add_action( 'save_post_' . self::POST_TYPE, array( $this, 'maybe_set_default_gateway' ) ); |
|
42 | + add_action('save_post_' . self::POST_TYPE, array($this, 'maybe_set_default_gateway')); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -50,23 +50,23 @@ discard block |
||
50 | 50 | public function register_gateway_post_type() { |
51 | 51 | register_post_type( |
52 | 52 | 'pronamic_gateway', array( |
53 | - 'label' => __( 'Payment Gateway Configurations', 'pronamic_ideal' ), |
|
53 | + 'label' => __('Payment Gateway Configurations', 'pronamic_ideal'), |
|
54 | 54 | 'labels' => array( |
55 | - 'name' => __( 'Payment Gateway Configurations', 'pronamic_ideal' ), |
|
56 | - 'singular_name' => __( 'Payment Gateway Configuration', 'pronamic_ideal' ), |
|
57 | - 'add_new' => __( 'Add New', 'pronamic_ideal' ), |
|
58 | - 'add_new_item' => __( 'Add New Payment Gateway Configuration', 'pronamic_ideal' ), |
|
59 | - 'edit_item' => __( 'Edit Payment Gateway Configuration', 'pronamic_ideal' ), |
|
60 | - 'new_item' => __( 'New Payment Gateway Configuration', 'pronamic_ideal' ), |
|
61 | - 'all_items' => __( 'All Payment Gateway Configurations', 'pronamic_ideal' ), |
|
62 | - 'view_item' => __( 'View Payment Gateway Configuration', 'pronamic_ideal' ), |
|
63 | - 'search_items' => __( 'Search Payment Gateway Configurations', 'pronamic_ideal' ), |
|
64 | - 'not_found' => __( 'No payment gateway configurations found.', 'pronamic_ideal' ), |
|
65 | - 'not_found_in_trash' => __( 'No payment gateway configurations found in Trash.', 'pronamic_ideal' ), |
|
66 | - 'menu_name' => __( 'Configurations', 'pronamic_ideal' ), |
|
67 | - 'filter_items_list' => __( 'Filter payment gateway configurations list', 'pronamic_ideal' ), |
|
68 | - 'items_list_navigation' => __( 'Payment gateway configurations list navigation', 'pronamic_ideal' ), |
|
69 | - 'items_list' => __( 'Payment gateway configurations list', 'pronamic_ideal' ), |
|
55 | + 'name' => __('Payment Gateway Configurations', 'pronamic_ideal'), |
|
56 | + 'singular_name' => __('Payment Gateway Configuration', 'pronamic_ideal'), |
|
57 | + 'add_new' => __('Add New', 'pronamic_ideal'), |
|
58 | + 'add_new_item' => __('Add New Payment Gateway Configuration', 'pronamic_ideal'), |
|
59 | + 'edit_item' => __('Edit Payment Gateway Configuration', 'pronamic_ideal'), |
|
60 | + 'new_item' => __('New Payment Gateway Configuration', 'pronamic_ideal'), |
|
61 | + 'all_items' => __('All Payment Gateway Configurations', 'pronamic_ideal'), |
|
62 | + 'view_item' => __('View Payment Gateway Configuration', 'pronamic_ideal'), |
|
63 | + 'search_items' => __('Search Payment Gateway Configurations', 'pronamic_ideal'), |
|
64 | + 'not_found' => __('No payment gateway configurations found.', 'pronamic_ideal'), |
|
65 | + 'not_found_in_trash' => __('No payment gateway configurations found in Trash.', 'pronamic_ideal'), |
|
66 | + 'menu_name' => __('Configurations', 'pronamic_ideal'), |
|
67 | + 'filter_items_list' => __('Filter payment gateway configurations list', 'pronamic_ideal'), |
|
68 | + 'items_list_navigation' => __('Payment gateway configurations list navigation', 'pronamic_ideal'), |
|
69 | + 'items_list' => __('Payment gateway configurations list', 'pronamic_ideal'), |
|
70 | 70 | ), |
71 | 71 | 'public' => false, |
72 | 72 | 'publicly_queryable' => false, |
@@ -93,21 +93,21 @@ discard block |
||
93 | 93 | * |
94 | 94 | * @param int $post_id Post ID. |
95 | 95 | */ |
96 | - public function maybe_set_default_gateway( $post_id ) { |
|
96 | + public function maybe_set_default_gateway($post_id) { |
|
97 | 97 | // Don't set the default gateway if the post is not published. |
98 | - if ( 'publish' !== get_post_status( $post_id ) ) { |
|
98 | + if ('publish' !== get_post_status($post_id)) { |
|
99 | 99 | return; |
100 | 100 | } |
101 | 101 | |
102 | 102 | // Don't set the default gateway if there is already a published gateway set. |
103 | - $config_id = get_option( 'pronamic_pay_config_id' ); |
|
103 | + $config_id = get_option('pronamic_pay_config_id'); |
|
104 | 104 | |
105 | - if ( ! empty( $config_id ) && 'publish' === get_post_status( $config_id ) ) { |
|
105 | + if ( ! empty($config_id) && 'publish' === get_post_status($config_id)) { |
|
106 | 106 | return; |
107 | 107 | } |
108 | 108 | |
109 | 109 | // Update. |
110 | - update_option( 'pronamic_pay_config_id', $post_id ); |
|
110 | + update_option('pronamic_pay_config_id', $post_id); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -19,39 +19,39 @@ |
||
19 | 19 | <table class="widefat fixed comments comments-box" cellspacing="0"> |
20 | 20 | <tbody> |
21 | 21 | |
22 | - <?php if ( empty( $comments ) ) : ?> |
|
22 | + <?php if (empty($comments)) : ?> |
|
23 | 23 | |
24 | 24 | <tr class="no-items"> |
25 | 25 | <td> |
26 | - <?php esc_html_e( 'No logs found.', 'pronamic_ideal' ); ?> |
|
26 | + <?php esc_html_e('No logs found.', 'pronamic_ideal'); ?> |
|
27 | 27 | </td> |
28 | 28 | </tr> |
29 | 29 | |
30 | 30 | <?php else : ?> |
31 | 31 | |
32 | - <?php foreach ( $comments as $comment ) : ?> |
|
32 | + <?php foreach ($comments as $comment) : ?> |
|
33 | 33 | |
34 | 34 | <?php |
35 | 35 | |
36 | 36 | $html_id = 'comment-' . $comment->comment_ID; |
37 | - $html_class = join( ' ', get_comment_class( wp_get_comment_status( $comment->comment_ID ) ) ); |
|
37 | + $html_class = join(' ', get_comment_class(wp_get_comment_status($comment->comment_ID))); |
|
38 | 38 | |
39 | 39 | ?> |
40 | - <tr id="<?php esc_attr( $html_id ); ?>" class="<?php esc_attr( $html_class ); ?>"> |
|
40 | + <tr id="<?php esc_attr($html_id); ?>" class="<?php esc_attr($html_class); ?>"> |
|
41 | 41 | <td> |
42 | 42 | <?php |
43 | 43 | |
44 | 44 | printf( |
45 | - esc_html__( '%1$s at %2$s', 'pronamic_ideal' ), |
|
45 | + esc_html__('%1$s at %2$s', 'pronamic_ideal'), |
|
46 | 46 | /* translators: comment date format. See http://php.net/date */ |
47 | - esc_html( get_comment_date( __( 'Y/m/d', 'pronamic_ideal' ), $comment->comment_ID ) ), |
|
48 | - esc_html( get_comment_date( get_option( 'time_format' ), $comment->comment_ID ) ) |
|
47 | + esc_html(get_comment_date(__('Y/m/d', 'pronamic_ideal'), $comment->comment_ID)), |
|
48 | + esc_html(get_comment_date(get_option('time_format'), $comment->comment_ID)) |
|
49 | 49 | ); |
50 | 50 | |
51 | 51 | ?> |
52 | 52 | </td> |
53 | 53 | <td> |
54 | - <?php comment_text( $comment ); ?> |
|
54 | + <?php comment_text($comment); ?> |
|
55 | 55 | </td> |
56 | 56 | </tr> |
57 | 57 |
@@ -27,13 +27,15 @@ |
||
27 | 27 | </td> |
28 | 28 | </tr> |
29 | 29 | |
30 | - <?php else : ?> |
|
30 | + <?php else { |
|
31 | + : ?> |
|
31 | 32 | |
32 | 33 | <?php foreach ( $comments as $comment ) : ?> |
33 | 34 | |
34 | 35 | <?php |
35 | 36 | |
36 | 37 | $html_id = 'comment-' . $comment->comment_ID; |
38 | +} |
|
37 | 39 | $html_class = join( ' ', get_comment_class( wp_get_comment_status( $comment->comment_ID ) ) ); |
38 | 40 | |
39 | 41 | ?> |