@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | namespace PodloveSubscribeButton; |
3 | 3 | |
4 | 4 | if ( ! class_exists( 'WP_List_Table' ) ) { |
5 | - require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
|
5 | + require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
|
6 | 6 | } |
7 | 7 | |
8 | 8 | class Button_List_Table extends \WP_List_Table { |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | ); |
29 | 29 | |
30 | 30 | return sprintf( '%1$s %2$s', |
31 | - /*$1%s*/ $button->title . '<br><code>[podlove-subscribe-button button="' . $button->name . '"]</code>', |
|
32 | - /*$3%s*/ $this->row_actions( $actions ) |
|
31 | + /*$1%s*/ $button->title . '<br><code>[podlove-subscribe-button button="' . $button->name . '"]</code>', |
|
32 | + /*$3%s*/ $this->row_actions( $actions ) |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | 'autowidth', |
22 | 22 | 'button', |
23 | 23 | 'color', |
24 | - 'language' |
|
24 | + 'language' |
|
25 | 25 | ); |
26 | 26 | |
27 | 27 | public function __construct() { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | \PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'format' ), |
50 | 50 | \PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'color' ), |
51 | 51 | false, |
52 | - false, |
|
52 | + false, |
|
53 | 53 | \PodloveSubscribeButton::get_array_value_with_fallback( $instance, 'language' ) |
54 | 54 | ); |
55 | 55 |
@@ -396,14 +396,14 @@ discard block |
||
396 | 396 | $this->set_defaults(); |
397 | 397 | |
398 | 398 | $sql = 'INSERT INTO ' |
399 | - . static::table_name() |
|
400 | - . ' ( ' |
|
401 | - . implode( ',', static::property_names() ) |
|
402 | - . ' ) ' |
|
403 | - . 'VALUES' |
|
404 | - . ' ( ' |
|
405 | - . implode( ',', array_map( array( $this, 'property_name_to_sql_value' ), static::property_names() ) ) |
|
406 | - . ' );' |
|
399 | + . static::table_name() |
|
400 | + . ' ( ' |
|
401 | + . implode( ',', static::property_names() ) |
|
402 | + . ' ) ' |
|
403 | + . 'VALUES' |
|
404 | + . ' ( ' |
|
405 | + . implode( ',', array_map( array( $this, 'property_name_to_sql_value' ), static::property_names() ) ) |
|
406 | + . ' );' |
|
407 | 407 | ; |
408 | 408 | $success = $wpdb->query( $sql ); |
409 | 409 | if ( $success ) { |
@@ -411,9 +411,9 @@ discard block |
||
411 | 411 | } |
412 | 412 | } else { |
413 | 413 | $sql = 'UPDATE ' . static::table_name() |
414 | - . ' SET ' |
|
415 | - . implode( ',', array_map( array( $this, 'property_name_to_sql_update_statement' ), static::property_names() ) ) |
|
416 | - . ' WHERE id = ' . $this->id |
|
414 | + . ' SET ' |
|
415 | + . implode( ',', array_map( array( $this, 'property_name_to_sql_update_statement' ), static::property_names() ) ) |
|
416 | + . ' WHERE id = ' . $this->id |
|
417 | 417 | ; |
418 | 418 | |
419 | 419 | $success = $wpdb->query( $sql ); |
@@ -461,13 +461,13 @@ discard block |
||
461 | 461 | global $wpdb; |
462 | 462 | |
463 | 463 | $sql = 'DELETE FROM ' |
464 | - . static::table_name() |
|
465 | - . ' WHERE id = ' . $this->id; |
|
464 | + . static::table_name() |
|
465 | + . ' WHERE id = ' . $this->id; |
|
466 | 466 | |
467 | 467 | $rows_affected = $wpdb->query( $sql ); |
468 | 468 | |
469 | - do_action( 'podlove_psb_model_delete', $this ); |
|
470 | - do_action( 'podlove_psb_model_change', $this ); |
|
469 | + do_action( 'podlove_psb_model_delete', $this ); |
|
470 | + do_action( 'podlove_psb_model_change', $this ); |
|
471 | 471 | |
472 | 472 | return $rows_affected !== false; |
473 | 473 | } |
@@ -506,10 +506,10 @@ discard block |
||
506 | 506 | $property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}"; |
507 | 507 | |
508 | 508 | $sql = 'CREATE TABLE IF NOT EXISTS ' |
509 | - . static::table_name() |
|
510 | - . ' (' |
|
511 | - . implode( ',', $property_sql ) |
|
512 | - . ' ) CHARACTER SET utf8;' |
|
509 | + . static::table_name() |
|
510 | + . ' (' |
|
511 | + . implode( ',', $property_sql ) |
|
512 | + . ' ) CHARACTER SET utf8;' |
|
513 | 513 | ; |
514 | 514 | |
515 | 515 | $wpdb->query( $sql ); |
@@ -152,11 +152,11 @@ |
||
152 | 152 | |
153 | 153 | public static function sanitize_settings( $input = null ) { |
154 | 154 | |
155 | - $output = $input; |
|
155 | + $output = $input; |
|
156 | 156 | |
157 | - if ( ! array_key_exists('autowidth', $input ) ) { |
|
158 | - $output['autowidth'] = 'off'; |
|
159 | - } |
|
157 | + if ( ! array_key_exists('autowidth', $input ) ) { |
|
158 | + $output['autowidth'] = 'off'; |
|
159 | + } |
|
160 | 160 | |
161 | 161 | return $output; |
162 | 162 | } |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | <div id="post-body" class="columns-2"> |
41 | 41 | <div id="post-body-content"> |
42 | 42 | <?php |
43 | - switch ( $action ) { |
|
44 | - case 'new': self::new_template(); break; |
|
45 | - case 'edit': self::edit_template(); break; |
|
46 | - case 'index': self::view_template(); break; |
|
47 | - default: self::view_template(); break; |
|
48 | - } |
|
49 | - ?> |
|
43 | + switch ( $action ) { |
|
44 | + case 'new': self::new_template(); break; |
|
45 | + case 'edit': self::edit_template(); break; |
|
46 | + case 'index': self::view_template(); break; |
|
47 | + default: self::view_template(); break; |
|
48 | + } |
|
49 | + ?> |
|
50 | 50 | </div> |
51 | 51 | <div id="postbox-container-1" class="postbox-container"> |
52 | 52 | <?php self::sidebar(); ?> |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | </div> |
93 | 93 | <?php |
94 | 94 | |
95 | - } |
|
95 | + } |
|
96 | 96 | |
97 | 97 | /** |
98 | 98 | * Process form: save/update a format |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $table->display(); |
203 | 203 | |
204 | 204 | if ( $is_network ) { |
205 | - // https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/ |
|
205 | + // https://vedovini.net/2015/10/using-the-wordpress-settings-api-with-network-admin-pages/ |
|
206 | 206 | ?> |
207 | 207 | <form method="post" action="edit.php?action=podlove_psb_update_network_options"> |
208 | 208 | <?php |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | if ( is_multisite() ) { |
81 | 81 | add_filter( 'podlove_psb_defaults_options', array( __CLASS__, 'get_network_defaults' ) ); |
82 | - } |
|
82 | + } |
|
83 | 83 | |
84 | 84 | self::menu(); |
85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | public static function get_network_defaults( $options ) { |
89 | 89 | $network_defaults = get_site_option( 'podlove_psb_defaults' ); |
90 | 90 | return $network_defaults; |
91 | - } |
|
91 | + } |
|
92 | 92 | |
93 | 93 | public static function widgets() { |
94 | 94 | register_widget( '\PodloveSubscribeButton\Widget' ); |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
160 | - * Get value from the associative array of the plugin defaults option |
|
161 | - * |
|
160 | + * Get value from the associative array of the plugin defaults option |
|
161 | + * |
|
162 | 162 | * @param $key |
163 | 163 | * @param bool $default |
164 | 164 | * |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | if ( isset( $attribute_value ) && ctype_alnum( $attribute_value ) && key_exists( $attribute_value, \PodloveSubscribeButton\Model\Button::$$attribute ) ) { |
245 | 245 | return $attribute_value; |
246 | 246 | } else { |
247 | - $default = get_option( 'podlove_psb_defaults', \PodloveSubscribeButton\Defaults::options() ); |
|
247 | + $default = get_option( 'podlove_psb_defaults', \PodloveSubscribeButton\Defaults::options() ); |
|
248 | 248 | return $default[ $attribute ]; |
249 | 249 | } |
250 | 250 |