@@ -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 ); |
@@ -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 | } |
@@ -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 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | parent::__construct( |
| 28 | 28 | 'podlove_subscribe_button_wp_plugin_widget', |
| 29 | 29 | ( Helpers::is_podlove_publisher_active() ? 'Podlove Subscribe Button (WordPress plugin)' : 'Podlove Subscribe Button' ), |
| 30 | - array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ), ) |
|
| 30 | + array( 'description' => __( 'Adds a Podlove Subscribe Button to your Sidebar', 'podlove-subscribe-button' ),) |
|
| 31 | 31 | ); |
| 32 | 32 | |
| 33 | 33 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function widget( $args, $instance ) { |
| 36 | 36 | // Fetch the (network)button by it's name |
| 37 | 37 | if ( ! $button = \PodloveSubscribeButton\Model\Button::get_button_by_name( $instance[ 'button' ] ) ) { |
| 38 | - return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args['button'] ); |
|
| 38 | + return sprintf( __( 'Oops. There is no button with the ID "%s".', 'podlove-subscribe-button' ), $args[ 'button' ] ); |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | echo $args[ 'before_widget' ]; |
@@ -58,14 +58,14 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | public function form( $instance ) { |
| 61 | - $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; |
|
| 62 | - $button = isset( $instance[ 'button' ] ) ? $instance[ 'button' ] : ''; |
|
| 63 | - $size = isset( $instance[ 'size' ] ) ? $instance[ 'size' ] : 'big'; |
|
| 64 | - $style = isset( $instance[ 'style' ] ) ? $instance[ 'style' ] : 'filled'; |
|
| 65 | - $format = isset( $instance[ 'format' ] ) ? $instance[ 'format' ] : 'cover'; |
|
| 61 | + $title = isset( $instance[ 'title' ] ) ? $instance[ 'title' ] : ''; |
|
| 62 | + $button = isset( $instance[ 'button' ] ) ? $instance[ 'button' ] : ''; |
|
| 63 | + $size = isset( $instance[ 'size' ] ) ? $instance[ 'size' ] : 'big'; |
|
| 64 | + $style = isset( $instance[ 'style' ] ) ? $instance[ 'style' ] : 'filled'; |
|
| 65 | + $format = isset( $instance[ 'format' ] ) ? $instance[ 'format' ] : 'cover'; |
|
| 66 | 66 | $autowidth = isset( $instance[ 'autowidth' ] ) ? $instance[ 'autowidth' ] : true; |
| 67 | - $infotext = isset( $instance[ 'infotext' ] ) ? $instance[ 'infotext' ] : ''; |
|
| 68 | - $color = isset( $instance[ 'color' ] ) ? $instance[ 'color' ] : '#75ad91'; |
|
| 67 | + $infotext = isset( $instance[ 'infotext' ] ) ? $instance[ 'infotext' ] : ''; |
|
| 68 | + $color = isset( $instance[ 'color' ] ) ? $instance[ 'color' ] : '#75ad91'; |
|
| 69 | 69 | |
| 70 | 70 | $buttons = \PodloveSubscribeButton\Model\Button::all(); |
| 71 | 71 | if ( is_multisite() ) { |
@@ -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 | } |
@@ -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'; |
@@ -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 |