@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public function load() { |
| 33 | 33 | // Current user. |
| 34 | - if ( ! current_user_can( 'edit_payments' ) ) { |
|
| 34 | + if ( !current_user_can( 'edit_payments' ) ) { |
|
| 35 | 35 | return; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // Bulk actions. |
| 46 | - add_filter( 'bulk_actions-' . $screen->id, array( $this, 'bulk_actions' ) ); |
|
| 46 | + add_filter( 'bulk_actions-'.$screen->id, array( $this, 'bulk_actions' ) ); |
|
| 47 | 47 | |
| 48 | - add_filter( 'handle_bulk_actions-' . $screen->id, array( $this, 'handle_bulk_action' ), 10, 3 ); |
|
| 48 | + add_filter( 'handle_bulk_actions-'.$screen->id, array( $this, 'handle_bulk_action' ), 10, 3 ); |
|
| 49 | 49 | |
| 50 | 50 | // Admin notices. |
| 51 | 51 | add_action( 'admin_notices', array( $this, 'admin_notices' ) ); |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | public function bulk_actions( $bulk_actions ) { |
| 63 | 63 | // Don't allow edit in bulk. |
| 64 | - unset( $bulk_actions['edit'] ); |
|
| 64 | + unset( $bulk_actions[ 'edit' ] ); |
|
| 65 | 65 | |
| 66 | 66 | // Bulk check payment status. |
| 67 | - $bulk_actions['pronamic_payment_check_status'] = __( 'Check Payment Status', 'pronamic_ideal' ); |
|
| 67 | + $bulk_actions[ 'pronamic_payment_check_status' ] = __( 'Check Payment Status', 'pronamic_ideal' ); |
|
| 68 | 68 | |
| 69 | 69 | return $bulk_actions; |
| 70 | 70 | } |
@@ -102,11 +102,11 @@ discard block |
||
| 102 | 102 | // Make sure gateway supports `payment_status_request` feature. |
| 103 | 103 | $config_id = $payment->config_id; |
| 104 | 104 | |
| 105 | - if ( ! isset( $gateways[ $config_id ] ) ) { |
|
| 105 | + if ( !isset( $gateways[ $config_id ] ) ) { |
|
| 106 | 106 | $gateways[ $config_id ] = \Pronamic\WordPress\Pay\Plugin::get_gateway( $config_id ); |
| 107 | 107 | |
| 108 | - if ( $gateways[ $config_id ] && ! $gateways[ $config_id ]->supports( 'payment_status_request' ) ) { |
|
| 109 | - $unsupported_gateways[] = $config_id; |
|
| 108 | + if ( $gateways[ $config_id ] && !$gateways[ $config_id ]->supports( 'payment_status_request' ) ) { |
|
| 109 | + $unsupported_gateways[ ] = $config_id; |
|
| 110 | 110 | } |
| 111 | 111 | } |
| 112 | 112 | |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | add_filter( 'request', array( $this, 'request' ) ); |
| 48 | 48 | |
| 49 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_columns', array( $this, 'columns' ) ); |
|
| 50 | - add_filter( 'manage_edit-' . self::POST_TYPE . '_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 49 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_columns', array( $this, 'columns' ) ); |
|
| 50 | + add_filter( 'manage_edit-'.self::POST_TYPE.'_sortable_columns', array( $this, 'sortable_columns' ) ); |
|
| 51 | 51 | |
| 52 | - add_action( 'manage_' . self::POST_TYPE . '_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 52 | + add_action( 'manage_'.self::POST_TYPE.'_posts_custom_column', array( $this, 'custom_columns' ), 10, 2 ); |
|
| 53 | 53 | |
| 54 | 54 | add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); |
| 55 | 55 | |
@@ -71,10 +71,10 @@ discard block |
||
| 71 | 71 | $screen = get_current_screen(); |
| 72 | 72 | |
| 73 | 73 | if ( self::POST_TYPE === $screen->post_type ) { |
| 74 | - if ( ! isset( $vars['post_status'] ) ) { |
|
| 75 | - $vars['post_status'] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() ); |
|
| 74 | + if ( !isset( $vars[ 'post_status' ] ) ) { |
|
| 75 | + $vars[ 'post_status' ] = array_keys( \Pronamic\WordPress\Pay\Plugin::get_subscription_states() ); |
|
| 76 | 76 | |
| 77 | - $vars['post_status'][] = 'publish'; |
|
| 77 | + $vars[ 'post_status' ][ ] = 'publish'; |
|
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
@@ -112,8 +112,8 @@ discard block |
||
| 112 | 112 | * @return array |
| 113 | 113 | */ |
| 114 | 114 | public function sortable_columns( $sortable_columns ) { |
| 115 | - $sortable_columns['pronamic_subscription_title'] = 'ID'; |
|
| 116 | - $sortable_columns['pronamic_subscription_date'] = 'date'; |
|
| 115 | + $sortable_columns[ 'pronamic_subscription_title' ] = 'ID'; |
|
| 116 | + $sortable_columns[ 'pronamic_subscription_date' ] = 'date'; |
|
| 117 | 117 | |
| 118 | 118 | return $sortable_columns; |
| 119 | 119 | } |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | $source_id = $subscription->get_source_id(); |
| 157 | 157 | $source_description = $subscription->get_source_description(); |
| 158 | 158 | |
| 159 | - $source_id_text = '#' . $source_id; |
|
| 159 | + $source_id_text = '#'.$source_id; |
|
| 160 | 160 | |
| 161 | 161 | $source_link = $subscription->get_source_link(); |
| 162 | 162 | |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | $config_id = get_post_meta( $payment->get_id(), '_pronamic_payment_config_id', true ); |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - if ( isset( $config_id ) && ! empty( $config_id ) ) { |
|
| 199 | + if ( isset( $config_id ) && !empty( $config_id ) ) { |
|
| 200 | 200 | echo get_the_title( $config_id ); |
| 201 | 201 | } else { |
| 202 | 202 | echo '—'; |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | * @param WP_Post $post The object for the current post/page. |
| 321 | 321 | */ |
| 322 | 322 | public function meta_box_info( $post ) { |
| 323 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-subscription-info.php'; |
|
| 323 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-subscription-info.php'; |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | ) |
| 338 | 338 | ); |
| 339 | 339 | |
| 340 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-notes.php'; |
|
| 340 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-notes.php'; |
|
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | /** |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | * @param WP_Post $post The object for the current post/page. |
| 347 | 347 | */ |
| 348 | 348 | public function meta_box_payments( $post ) { |
| 349 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-subscription-payments.php'; |
|
| 349 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-subscription-payments.php'; |
|
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | /** |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | public function meta_box_update( $post ) { |
| 358 | 358 | wp_nonce_field( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ); |
| 359 | 359 | |
| 360 | - include plugin_dir_path( $this->plugin->get_file() ) . 'admin/meta-box-subscription-update.php'; |
|
| 360 | + include plugin_dir_path( $this->plugin->get_file() ).'admin/meta-box-subscription-update.php'; |
|
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
@@ -406,11 +406,11 @@ discard block |
||
| 406 | 406 | * @param WP_Post $post WordPress post. |
| 407 | 407 | */ |
| 408 | 408 | public function transition_post_status( $new_status, $old_status, $post ) { |
| 409 | - if ( ! filter_has_var( INPUT_POST, 'pronamic_subscription_update_nonce' ) ) { |
|
| 409 | + if ( !filter_has_var( INPUT_POST, 'pronamic_subscription_update_nonce' ) ) { |
|
| 410 | 410 | return; |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | - if ( ! check_admin_referer( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ) ) { |
|
| 413 | + if ( !check_admin_referer( 'pronamic_subscription_update', 'pronamic_subscription_update_nonce' ) ) { |
|
| 414 | 414 | return; |
| 415 | 415 | } |
| 416 | 416 | |