@@ -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' ) ); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | parent::__construct( |
| 22 | 22 | 'podlove_subscribe_button_wp_plugin_widget', |
| 23 | 23 | ( self::is_podlove_publisher_active() ? 'Podlove Subscribe Button (WordPress plugin)' : 'Podlove Subscribe Button' ), |
| 24 | - array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ), ) |
|
| 24 | + array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ),) |
|
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | 27 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | public function widget( $args, $instance ) { |
| 39 | 39 | // Fetch the (network)button by it's name |
| 40 | 40 | if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $instance[ 'button' ] ) ) { |
| 41 | - return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args['button'] ); |
|
| 41 | + return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | echo $args[ 'before_widget' ]; |
@@ -98,8 +98,10 @@ |
||
| 98 | 98 | <optgroup label="<?php _e( 'Network', 'podlove-subscribe-button' ); ?>"> |
| 99 | 99 | <?php $buttons_as_options( $network_buttons ); ?> |
| 100 | 100 | </optgroup> |
| 101 | - <?php else : |
|
| 101 | + <?php else { |
|
| 102 | + : |
|
| 102 | 103 | $buttons_as_options( $buttons ); |
| 104 | +} |
|
| 103 | 105 | endif; ?> |
| 104 | 106 | </select> |
| 105 | 107 | <?php |
@@ -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 | } |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | $is_network = is_network_admin(); |
| 42 | 42 | |
| 43 | 43 | return "<div class='podlove-button-preview-container'>" |
| 44 | - . $button->render( |
|
| 44 | + . $button->render( |
|
| 45 | 45 | 'big', |
| 46 | 46 | 'false', |
| 47 | 47 | get_option( 'podlove_subscribe_button_default_style', 'filled' ), |
| 48 | 48 | 'rectangle' |
| 49 | 49 | ) |
| 50 | - . "</div>"; |
|
| 50 | + . "</div>"; |
|
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | |
@@ -35,8 +35,9 @@ |
||
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | public function column_button_preview( $button ) { |
| 38 | - if ( ! $button->feeds ) |
|
| 39 | - return; |
|
| 38 | + if ( ! $button->feeds ) { |
|
| 39 | + return; |
|
| 40 | + } |
|
| 40 | 41 | |
| 41 | 42 | $is_network = is_network_admin(); |
| 42 | 43 | |
@@ -113,16 +113,16 @@ |
||
| 113 | 113 | if ( isset( \PodloveSubscribeButton\MediaTypes::$audio[ $feed[ 'format' ] ][ 'extension' ] ) ) { |
| 114 | 114 | $new_feed = array( |
| 115 | 115 | 'type' => 'audio', |
| 116 | - 'format' => \PodloveSubscribeButton\MediaTypes::$audio[ $feed['format'] ]['extension'], |
|
| 117 | - 'url' => $feed['url'], |
|
| 116 | + 'format' => \PodloveSubscribeButton\MediaTypes::$audio[ $feed[ 'format' ] ][ 'extension' ], |
|
| 117 | + 'url' => $feed[ 'url' ], |
|
| 118 | 118 | 'variant' => 'high', |
| 119 | 119 | ); |
| 120 | 120 | |
| 121 | 121 | if ( isset( $feed[ 'itunesfeedid' ] ) && $feed[ 'itunesfeedid' ] > 0 ) { |
| 122 | - $new_feed['directory-url-itunes'] = "https://itunes.apple.com/podcast/id" . $feed['itunesfeedid']; |
|
| 122 | + $new_feed[ 'directory-url-itunes' ] = "https://itunes.apple.com/podcast/id" . $feed[ 'itunesfeedid' ]; |
|
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - $feeds[] = $new_feed; |
|
| 125 | + $feeds[ ] = $new_feed; |
|
| 126 | 126 | |
| 127 | 127 | } |
| 128 | 128 | } |
@@ -182,11 +182,13 @@ |
||
| 182 | 182 | * @return string |
| 183 | 183 | */ |
| 184 | 184 | private static function interpret_autowidth_attribute( $autowidth ) { |
| 185 | - if ( $autowidth == 'default' && get_option( 'podlove_subscribe_button_default_autowidth' ) !== 'on' ) |
|
| 186 | - return ''; |
|
| 185 | + if ( $autowidth == 'default' && get_option( 'podlove_subscribe_button_default_autowidth' ) !== 'on' ) { |
|
| 186 | + return ''; |
|
| 187 | + } |
|
| 187 | 188 | |
| 188 | - if ( $autowidth !== 'default' && $autowidth !== 'on' ) |
|
| 189 | - return ''; |
|
| 189 | + if ( $autowidth !== 'default' && $autowidth !== 'on' ) { |
|
| 190 | + return ''; |
|
| 191 | + } |
|
| 190 | 192 | |
| 191 | 193 | return ' auto'; |
| 192 | 194 | } |