@@ -151,8 +151,9 @@ discard block |
||
| 151 | 151 | public static function build_models() { |
| 152 | 152 | // Build Databases |
| 153 | 153 | \PodloveSubscribeButton\Model\Button::build(); |
| 154 | - if ( is_multisite() ) |
|
| 155 | - \PodloveSubscribeButton\Model\NetworkButton::build(); |
|
| 154 | + if ( is_multisite() ) { |
|
| 155 | + \PodloveSubscribeButton\Model\NetworkButton::build(); |
|
| 156 | + } |
|
| 156 | 157 | |
| 157 | 158 | // Set Button "default" values |
| 158 | 159 | $default_values = array( |
@@ -178,8 +179,9 @@ discard block |
||
| 178 | 179 | } |
| 179 | 180 | |
| 180 | 181 | // Fetch the (network)button by it's name |
| 181 | - if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name($args['button']) ) |
|
| 182 | - return sprintf( __('Oops. There is no button with the ID "%s".', 'podlove-subscribe-button'), $args['button'] ); |
|
| 182 | + if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name($args['button']) ) { |
|
| 183 | + return sprintf( __('Oops. There is no button with the ID "%s".', 'podlove-subscribe-button'), $args['button'] ); |
|
| 184 | + } |
|
| 183 | 185 | |
| 184 | 186 | // Get button styling and options |
| 185 | 187 | $autowidth = self::interpret_width_attribute( self::get_array_value_with_fallback($args, 'width') ); |
@@ -211,8 +213,9 @@ discard block |
||
| 211 | 213 | } |
| 212 | 214 | |
| 213 | 215 | public static function get_array_value_with_fallback($args, $key) { |
| 214 | - if ( isset($args[$key]) ) |
|
| 215 | - return $args[$key]; |
|
| 216 | + if ( isset($args[$key]) ) { |
|
| 217 | + return $args[$key]; |
|
| 218 | + } |
|
| 216 | 219 | |
| 217 | 220 | return false; |
| 218 | 221 | } |
@@ -236,10 +239,12 @@ discard block |
||
| 236 | 239 | * @return string |
| 237 | 240 | */ |
| 238 | 241 | private static function interpret_width_attribute( $width_attribute = null ) { |
| 239 | - if ( $width_attribute == 'auto' ) |
|
| 240 | - return 'on'; |
|
| 241 | - if ( $width_attribute && $width_attribute !== 'auto' ) |
|
| 242 | - return 'off'; |
|
| 242 | + if ( $width_attribute == 'auto' ) { |
|
| 243 | + return 'on'; |
|
| 244 | + } |
|
| 245 | + if ( $width_attribute && $width_attribute !== 'auto' ) { |
|
| 246 | + return 'off'; |
|
| 247 | + } |
|
| 243 | 248 | |
| 244 | 249 | return get_option( 'podlove_subscribe_button_default_autowidth', 'on' ); |
| 245 | 250 | } |