@@ -188,8 +188,9 @@ |
||
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | // Fetch the (network)button by it's name |
| 191 | - if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $args[ 'button' ] ) ) |
|
| 192 | - return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] ); |
|
| 191 | + if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $args[ 'button' ] ) ) { |
|
| 192 | + return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] ); |
|
| 193 | + } |
|
| 193 | 194 | |
| 194 | 195 | // Get button styling and options |
| 195 | 196 | $autowidth = self::interpret_width_attribute( self::get_array_value_with_fallback( $args, 'width' ) ); |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // CSS Stylesheet |
| 89 | - wp_register_style( 'podlove-subscribe-button', \PodloveSubscribeButton\Helpers::get_url( '' ) . 'css/style.css' , false, self::$version ); |
|
| 89 | + wp_register_style( 'podlove-subscribe-button', \PodloveSubscribeButton\Helpers::get_url( '' ) . 'css/style.css', false, self::$version ); |
|
| 90 | 90 | wp_enqueue_style( 'podlove-subscribe-button' ); |
| 91 | 91 | |
| 92 | 92 | // Admin JS |
@@ -389,14 +389,14 @@ discard block |
||
| 389 | 389 | $this->set_defaults(); |
| 390 | 390 | |
| 391 | 391 | $sql = 'INSERT INTO ' |
| 392 | - . static::table_name() |
|
| 393 | - . ' ( ' |
|
| 394 | - . implode( ',', static::property_names() ) |
|
| 395 | - . ' ) ' |
|
| 396 | - . 'VALUES' |
|
| 397 | - . ' ( ' |
|
| 398 | - . implode( ',', array_map( array( $this, 'property_name_to_sql_value' ), static::property_names() ) ) |
|
| 399 | - . ' );' |
|
| 392 | + . static::table_name() |
|
| 393 | + . ' ( ' |
|
| 394 | + . implode( ',', static::property_names() ) |
|
| 395 | + . ' ) ' |
|
| 396 | + . 'VALUES' |
|
| 397 | + . ' ( ' |
|
| 398 | + . implode( ',', array_map( array( $this, 'property_name_to_sql_value' ), static::property_names() ) ) |
|
| 399 | + . ' );' |
|
| 400 | 400 | ; |
| 401 | 401 | $success = $wpdb->query( $sql ); |
| 402 | 402 | if ( $success ) { |
@@ -404,9 +404,9 @@ discard block |
||
| 404 | 404 | } |
| 405 | 405 | } else { |
| 406 | 406 | $sql = 'UPDATE ' . static::table_name() |
| 407 | - . ' SET ' |
|
| 408 | - . implode( ',', array_map( array( $this, 'property_name_to_sql_update_statement' ), static::property_names() ) ) |
|
| 409 | - . ' WHERE id = ' . $this->id |
|
| 407 | + . ' SET ' |
|
| 408 | + . implode( ',', array_map( array( $this, 'property_name_to_sql_update_statement' ), static::property_names() ) ) |
|
| 409 | + . ' WHERE id = ' . $this->id |
|
| 410 | 410 | ; |
| 411 | 411 | |
| 412 | 412 | $success = $wpdb->query( $sql ); |
@@ -454,13 +454,13 @@ discard block |
||
| 454 | 454 | global $wpdb; |
| 455 | 455 | |
| 456 | 456 | $sql = 'DELETE FROM ' |
| 457 | - . static::table_name() |
|
| 458 | - . ' WHERE id = ' . $this->id; |
|
| 457 | + . static::table_name() |
|
| 458 | + . ' WHERE id = ' . $this->id; |
|
| 459 | 459 | |
| 460 | 460 | $rows_affected = $wpdb->query( $sql ); |
| 461 | 461 | |
| 462 | - do_action( 'podlove_model_delete', $this ); |
|
| 463 | - do_action( 'podlove_model_change', $this ); |
|
| 462 | + do_action( 'podlove_model_delete', $this ); |
|
| 463 | + do_action( 'podlove_model_change', $this ); |
|
| 464 | 464 | |
| 465 | 465 | return $rows_affected !== false; |
| 466 | 466 | } |
@@ -499,10 +499,10 @@ discard block |
||
| 499 | 499 | $property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}"; |
| 500 | 500 | |
| 501 | 501 | $sql = 'CREATE TABLE IF NOT EXISTS ' |
| 502 | - . static::table_name() |
|
| 503 | - . ' (' |
|
| 504 | - . implode( ',', $property_sql ) |
|
| 505 | - . ' ) CHARACTER SET utf8;' |
|
| 502 | + . static::table_name() |
|
| 503 | + . ' (' |
|
| 504 | + . implode( ',', $property_sql ) |
|
| 505 | + . ' ) CHARACTER SET utf8;' |
|
| 506 | 506 | ; |
| 507 | 507 | |
| 508 | 508 | $wpdb->query( $sql ); |
@@ -45,11 +45,13 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | private static function unserialize_property( $property ) { |
| 48 | - if ( ! isset( $property ) ) |
|
| 49 | - return; |
|
| 48 | + if ( ! isset( $property ) ) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 50 | 51 | |
| 51 | - if ( $unserialized_string = is_serialized( $property ) ) |
|
| 52 | - return unserialize( $property ); |
|
| 52 | + if ( $unserialized_string = is_serialized( $property ) ) { |
|
| 53 | + return unserialize( $property ); |
|
| 54 | + } |
|
| 53 | 55 | |
| 54 | 56 | return $property; |
| 55 | 57 | } |
@@ -319,8 +321,9 @@ discard block |
||
| 319 | 321 | */ |
| 320 | 322 | public function update_attributes( $attributes ) { |
| 321 | 323 | |
| 322 | - if ( ! is_array( $attributes ) ) |
|
| 323 | - return false; |
|
| 324 | + if ( ! is_array( $attributes ) ) { |
|
| 325 | + return false; |
|
| 326 | + } |
|
| 324 | 327 | |
| 325 | 328 | $request = filter_input_array( INPUT_POST ); // Do this for security reasons |
| 326 | 329 | |
@@ -429,12 +432,14 @@ discard block |
||
| 429 | 432 | |
| 430 | 433 | $defaults = $this->default_values(); |
| 431 | 434 | |
| 432 | - if ( ! is_array( $defaults ) || empty( $defaults ) ) |
|
| 433 | - return; |
|
| 435 | + if ( ! is_array( $defaults ) || empty( $defaults ) ) { |
|
| 436 | + return; |
|
| 437 | + } |
|
| 434 | 438 | |
| 435 | 439 | foreach ( $defaults as $property => $value ) { |
| 436 | - if ( $this->$property === null ) |
|
| 437 | - $this->$property = $value; |
|
| 440 | + if ( $this->$property === null ) { |
|
| 441 | + $this->$property = $value; |
|
| 442 | + } |
|
| 438 | 443 | } |
| 439 | 444 | |
| 440 | 445 | } |
@@ -495,8 +500,9 @@ discard block |
||
| 495 | 500 | global $wpdb; |
| 496 | 501 | |
| 497 | 502 | $property_sql = array(); |
| 498 | - foreach ( static::properties() as $property ) |
|
| 499 | - $property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}"; |
|
| 503 | + foreach ( static::properties() as $property ) { |
|
| 504 | + $property_sql[ ] = "`{$property[ 'name' ]}` {$property[ 'type' ]}"; |
|
| 505 | + } |
|
| 500 | 506 | |
| 501 | 507 | $sql = 'CREATE TABLE IF NOT EXISTS ' |
| 502 | 508 | . static::table_name() |
@@ -186,11 +186,13 @@ |
||
| 186 | 186 | * @return string |
| 187 | 187 | */ |
| 188 | 188 | private static function interpret_autowidth_attribute( $autowidth ) { |
| 189 | - if ( $autowidth == 'default' && get_option( 'podlove_subscribe_button_default_autowidth' ) !== 'on' ) |
|
| 190 | - return ''; |
|
| 189 | + if ( $autowidth == 'default' && get_option( 'podlove_subscribe_button_default_autowidth' ) !== 'on' ) { |
|
| 190 | + return ''; |
|
| 191 | + } |
|
| 191 | 192 | |
| 192 | - if ( $autowidth !== 'default' && $autowidth !== 'on' ) |
|
| 193 | - return ''; |
|
| 193 | + if ( $autowidth !== 'default' && $autowidth !== 'on' ) { |
|
| 194 | + return ''; |
|
| 195 | + } |
|
| 194 | 196 | |
| 195 | 197 | return ' auto'; |
| 196 | 198 | |
@@ -118,19 +118,19 @@ |
||
| 118 | 118 | */ |
| 119 | 119 | private function get_feeds_as_array( $feeds = array() ) { |
| 120 | 120 | foreach ( $feeds as $feed ) { |
| 121 | - if ( isset( \PodloveSubscribeButton\Defaults::media_types()[ $feed['format'] ]['extension'] ) ) { |
|
| 121 | + if ( isset( \PodloveSubscribeButton\Defaults::media_types()[ $feed[ 'format' ] ][ 'extension' ] ) ) { |
|
| 122 | 122 | $new_feed = array( |
| 123 | 123 | 'type' => 'audio', |
| 124 | - 'format' => \PodloveSubscribeButton\Defaults::media_types()[ $feed['format'] ]['extension'], |
|
| 125 | - 'url' => $feed['url'], |
|
| 124 | + 'format' => \PodloveSubscribeButton\Defaults::media_types()[ $feed[ 'format' ] ][ 'extension' ], |
|
| 125 | + 'url' => $feed[ 'url' ], |
|
| 126 | 126 | 'variant' => 'high', |
| 127 | 127 | ); |
| 128 | 128 | |
| 129 | - if ( isset( $feed['itunesfeedid'] ) && $feed['itunesfeedid'] > 0 ) { |
|
| 130 | - $new_feed['directory-url-itunes'] = "https://itunes.apple.com/podcast/id" . $feed['itunesfeedid']; |
|
| 129 | + if ( isset( $feed[ 'itunesfeedid' ] ) && $feed[ 'itunesfeedid' ] > 0 ) { |
|
| 130 | + $new_feed[ 'directory-url-itunes' ] = "https://itunes.apple.com/podcast/id" . $feed[ 'itunesfeedid' ]; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - $feeds[] = $new_feed; |
|
| 133 | + $feeds[ ] = $new_feed; |
|
| 134 | 134 | |
| 135 | 135 | } |
| 136 | 136 | } |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | * Process form: save/update a format |
| 46 | 46 | */ |
| 47 | 47 | public static function save() { |
| 48 | - if ( null == filter_input( INPUT_GET, 'button' ) ) |
|
| 49 | - return; |
|
| 48 | + if ( null == filter_input( INPUT_GET, 'button' ) ) { |
|
| 49 | + return; |
|
| 50 | + } |
|
| 50 | 51 | |
| 51 | 52 | $post = filter_input_array( INPUT_POST ); |
| 52 | 53 | |
@@ -81,8 +82,9 @@ discard block |
||
| 81 | 82 | * Process form: delete a format |
| 82 | 83 | */ |
| 83 | 84 | public static function delete() { |
| 84 | - if ( null == filter_input( INPUT_GET, 'button' ) ) |
|
| 85 | - return; |
|
| 85 | + if ( null == filter_input( INPUT_GET, 'button' ) ) { |
|
| 86 | + return; |
|
| 87 | + } |
|
| 86 | 88 | |
| 87 | 89 | $button = ( filter_input( INPUT_GET, 'network' ) === '1' ? \PodloveSubscribeButton\Model\NetworkButton::find_by_id( filter_input( INPUT_GET, 'button' ) ) : \PodloveSubscribeButton\Model\Button::find_by_id( filter_input( INPUT_GET, 'button' ) ) ); |
| 88 | 90 | $button->delete(); |
@@ -104,8 +106,9 @@ discard block |
||
| 104 | 106 | } |
| 105 | 107 | |
| 106 | 108 | public static function process_form() { |
| 107 | - if ( null === filter_input( INPUT_GET, 'button' ) ) |
|
| 108 | - return; |
|
| 109 | + if ( null === filter_input( INPUT_GET, 'button' ) ) { |
|
| 110 | + return; |
|
| 111 | + } |
|
| 109 | 112 | |
| 110 | 113 | $action = ( null !== filter_input( INPUT_GET, 'action' ) ? filter_input( INPUT_GET, 'action' ) : null ); |
| 111 | 114 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | <td> |
| 176 | 176 | <select name="podlove_subscribe_button_default_size" id="podlove_subscribe_button_default_size"> |
| 177 | 177 | <?php foreach ( \PodloveSubscribeButton\Defaults::button( 'size' ) as $value => $description ) : ?> |
| 178 | - <option value="<?php echo $value; ?>" <?php selected( $settings['size'], $value ); ?>><?php echo $description; ?></option> |
|
| 178 | + <option value="<?php echo $value; ?>" <?php selected( $settings[ 'size' ], $value ); ?>><?php echo $description; ?></option> |
|
| 179 | 179 | <?php endforeach; ?> |
| 180 | 180 | </select> |
| 181 | 181 | </td> |
@@ -184,14 +184,14 @@ discard block |
||
| 184 | 184 | <th scope="row"><label for="podlove_subscribe_button_default_autowidth"><?php _e( 'Autowidth', 'podlove-subscribe-button' ); ?></label></th> |
| 185 | 185 | <td> |
| 186 | 186 | <input type="checkbox" name="podlove_subscribe_button_default_autowidth" |
| 187 | - id="podlove_subscribe_button_default_autowidth" <?php checked( $settings['autowidth'], 'on' ); ?> /> |
|
| 187 | + id="podlove_subscribe_button_default_autowidth" <?php checked( $settings[ 'autowidth' ], 'on' ); ?> /> |
|
| 188 | 188 | </td> |
| 189 | 189 | </tr> |
| 190 | 190 | <tr valign="top"> |
| 191 | 191 | <th scope="row"><label for="podlove_subscribe_button_default_color"><?php _e( 'Color', 'podlove-subscribe-button' ); ?></label></th> |
| 192 | 192 | <td> |
| 193 | 193 | <input id="podlove_subscribe_button_default_color" name="podlove_subscribe_button_default_color" class="podlove_subscribe_button_color" |
| 194 | - value="<?php echo $settings['color'] ?>"/> |
|
| 194 | + value="<?php echo $settings[ 'color' ] ?>"/> |
|
| 195 | 195 | </td> |
| 196 | 196 | </tr> |
| 197 | 197 | <tr valign="top"> |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | <td> |
| 200 | 200 | <select name="podlove_subscribe_button_default_style" id="podlove_subscribe_button_default_style"> |
| 201 | 201 | <?php foreach ( \PodloveSubscribeButton\Defaults::button( 'style' ) as $value => $description ) : ?> |
| 202 | - <option value="<?php echo $value; ?>" <?php selected( $settings['style'], $value ); ?>><?php echo $description; ?></option> |
|
| 202 | + <option value="<?php echo $value; ?>" <?php selected( $settings[ 'style' ], $value ); ?>><?php echo $description; ?></option> |
|
| 203 | 203 | <?php endforeach; ?> |
| 204 | 204 | </select> |
| 205 | 205 | </td> |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | <td> |
| 210 | 210 | <select name="podlove_subscribe_button_default_format" id="podlove_subscribe_button_default_format"> |
| 211 | 211 | <?php foreach ( \PodloveSubscribeButton\Defaults::button( 'format' ) as $value => $description ) : ?> |
| 212 | - <option value="<?php echo $value; ?>" <?php selected( $settings['format'], $value ); ?>><?php echo $description; ?></option> |
|
| 212 | + <option value="<?php echo $value; ?>" <?php selected( $settings[ 'format' ], $value ); ?>><?php echo $description; ?></option> |
|
| 213 | 213 | <?php endforeach; ?> |
| 214 | 214 | </select> |
| 215 | 215 | </td> |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | <td> |
| 220 | 220 | <select name="podlove_subscribe_button_default_language" id="podlove_subscribe_button_default_language"> |
| 221 | 221 | <?php foreach ( \PodloveSubscribeButton\Defaults::button( 'language' ) as $value ) : ?> |
| 222 | - <option value="<?php echo $value; ?>" <?php selected( $settings['language'], $value ); ?>><?php echo $value; ?></option> |
|
| 222 | + <option value="<?php echo $value; ?>" <?php selected( $settings[ 'language' ], $value ); ?>><?php echo $value; ?></option> |
|
| 223 | 223 | <?php endforeach; ?> |
| 224 | 224 | </select> |
| 225 | 225 | </td> |
@@ -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(); ?> |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | </div> |
| 79 | 79 | <?php |
| 80 | 80 | |
| 81 | - } |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * Process form: save/update a format |
@@ -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 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | parent::__construct( array( |
| 16 | 16 | 'singular' => 'feed', // singular name of the listed records |
| 17 | 17 | 'plural' => 'feeds', // plural name of the listed records |
| 18 | - 'ajax' => false, // does this table support ajax? |
|
| 18 | + 'ajax' => false, // does this table support ajax? |
|
| 19 | 19 | ) ); |
| 20 | 20 | |
| 21 | 21 | } |
@@ -104,9 +104,11 @@ |
||
| 104 | 104 | echo "<option value='" . $subscribebutton->name . "' " . selected( $subscribebutton->name, $button ) . " >" . $subscribebutton->title . " (" . $subscribebutton->name . ")</option>"; |
| 105 | 105 | } ?> |
| 106 | 106 | </optgroup> |
| 107 | - <?php else : |
|
| 107 | + <?php else { |
|
| 108 | + : |
|
| 108 | 109 | foreach ( $buttons as $subscribebutton ) { |
| 109 | 110 | echo "<option value='" . $subscribebutton->name . "' " . selected( $subscribebutton->name, $button ) . " >" . $subscribebutton->title . " (" . $subscribebutton->name . ")</option>"; |
| 111 | +} |
|
| 110 | 112 | } |
| 111 | 113 | endif; ?> |
| 112 | 114 | </select> |
@@ -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 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | parent::__construct( |
| 29 | 29 | 'podlove_subscribe_button_wp_plugin_widget', |
| 30 | 30 | ( Helpers::is_podlove_publisher_active() ? 'Podlove Subscribe Button (WordPress plugin)' : 'Podlove Subscribe Button' ), |
| 31 | - array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ), ) |
|
| 31 | + array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ),) |
|
| 32 | 32 | ); |
| 33 | 33 | |
| 34 | 34 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | public function widget( $args, $instance ) { |
| 37 | 37 | // Fetch the (network)button by it's name |
| 38 | 38 | if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $instance[ 'button' ] ) ) { |
| 39 | - return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args['button'] ); |
|
| 39 | + return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] ); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | echo $args[ 'before_widget' ]; |
@@ -62,15 +62,15 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public function form( $instance ) { |
| 65 | - $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; |
|
| 66 | - $button = isset( $instance[ 'button' ] ) ? $instance[ 'button' ] : ''; |
|
| 67 | - $size = isset( $instance[ 'size' ] ) ? $instance[ 'size' ] : 'big'; |
|
| 68 | - $style = isset( $instance[ 'style' ] ) ? $instance[ 'style' ] : 'filled'; |
|
| 69 | - $format = isset( $instance[ 'format' ] ) ? $instance[ 'format' ] : 'cover'; |
|
| 65 | + $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; |
|
| 66 | + $button = isset( $instance[ 'button' ] ) ? $instance[ 'button' ] : ''; |
|
| 67 | + $size = isset( $instance[ 'size' ] ) ? $instance[ 'size' ] : 'big'; |
|
| 68 | + $style = isset( $instance[ 'style' ] ) ? $instance[ 'style' ] : 'filled'; |
|
| 69 | + $format = isset( $instance[ 'format' ] ) ? $instance[ 'format' ] : 'cover'; |
|
| 70 | 70 | $autowidth = isset( $instance[ 'autowidth' ] ) ? $instance[ 'autowidth' ] : true; |
| 71 | - $infotext = isset( $instance[ 'infotext' ] ) ? $instance[ 'infotext' ] : ''; |
|
| 72 | - $color = isset( $instance[ 'color' ] ) ? $instance[ 'color' ] : '#75ad91'; |
|
| 73 | - $language = isset( $instance[ 'language' ] ) ? $instance[ 'language' ] : Defaults::options()['language']; |
|
| 71 | + $infotext = isset( $instance[ 'infotext' ] ) ? $instance[ 'infotext' ] : ''; |
|
| 72 | + $color = isset( $instance[ 'color' ] ) ? $instance[ 'color' ] : '#75ad91'; |
|
| 73 | + $language = isset( $instance[ 'language' ] ) ? $instance[ 'language' ] : Defaults::options()[ 'language' ]; |
|
| 74 | 74 | |
| 75 | 75 | $buttons = \PodloveSubscribeButton\Model\Button::all(); |
| 76 | 76 | if ( is_multisite() ) { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | 'big' => __( 'Big', 'podlove-subscribe-button' ), |
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | - $language = array( 'de', 'en', 'eo', 'fi', 'fr', 'nl', 'zh', 'ja', ); |
|
| 38 | + $language = array( 'de', 'en', 'eo', 'fi', 'fr', 'nl', 'zh', 'ja',); |
|
| 39 | 39 | |
| 40 | 40 | return $$property; |
| 41 | 41 | |
@@ -70,9 +70,9 @@ |
||
| 70 | 70 | $language = get_option( 'WPLANG' ); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - $lang_code = strtolower(explode('_', $language)[0]); |
|
| 73 | + $lang_code = strtolower( explode( '_', $language )[ 0 ] ); |
|
| 74 | 74 | |
| 75 | - if ( in_array( $lang_code, \PodloveSubscribeButton\Defaults::button('language' ) ) ) { |
|
| 75 | + if ( in_array( $lang_code, \PodloveSubscribeButton\Defaults::button( 'language' ) ) ) { |
|
| 76 | 76 | return $lang_code; |
| 77 | 77 | } else { |
| 78 | 78 | return 'en'; |
@@ -88,8 +88,9 @@ |
||
| 88 | 88 | $plugin = basename( \PodloveSubscribeButton\PLUGIN_DIR ) . '/' . \PodloveSubscribeButton\PLUGIN_FILE_NAME; |
| 89 | 89 | $blogids = $wpdb->get_col( "SELECT blog_id FROM " . $wpdb->blogs ); |
| 90 | 90 | |
| 91 | - if ( ! is_array( $blogids ) ) |
|
| 92 | - return; |
|
| 91 | + if ( ! is_array( $blogids ) ) { |
|
| 92 | + return; |
|
| 93 | + } |
|
| 93 | 94 | |
| 94 | 95 | foreach ( $blogids as $blog_id ) { |
| 95 | 96 | switch_to_blog( $blog_id ); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace PodloveSubscribeButton; |
| 10 | 10 | |
| 11 | -Class Helpers { |
|
| 11 | +class Helpers { |
|
| 12 | 12 | |
| 13 | 13 | public static function get_path( $folder = '' ) { |
| 14 | 14 | |