Skip to content

Commit f332ea3

Browse files
Kiril KirkovKiril Kirkov
authored andcommitted
hot fix
1 parent a37255c commit f332ea3

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

Includes/Admin/SettingsForm.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@
5757
<td>
5858
<label><?php esc_html_e( 'Client Secret', 'kirilkirkov-spotify-search' ); ?></label>
5959
<input type="text" name="<?php esc_attr_e($Config::INPUTS_PREFIX); ?>spotify_search_client_secret" value="<?php echo esc_attr(get_option( $Config::INPUTS_PREFIX.'spotify_search_client_secret' )); ?>" />
60+
61+
<?php if(!$this->has_public_permission) {
62+
// By default absolute positioned results is enabled on new installations
63+
?>
64+
<input type="hidden" name="<?php esc_attr_e($Config::INPUTS_PREFIX); ?>spotify_search_absolute_results" value="1">
65+
<?php } ?>
6066
</td>
6167
</tr>
6268

KirilKirkovSpotifySearch.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ private function init()
6262
add_action('wp_ajax_get_spotify_search_results', array($this, 'get_spotify_search_results') );
6363
add_action('wp_ajax_nopriv_get_spotify_search_results', array($this, 'get_spotify_search_results') );
6464

65-
register_activation_hook( __FILE__, array($this, 'plugin_activation') );
66-
6765
add_shortcode(Config::SHORTCODE, array($this, 'load_public_form'));
6866
}
6967

@@ -292,7 +290,7 @@ private function strip_param_from_url($url, $param)
292290
public function plugin_activation()
293291
{
294292
// Only set default if option doesn't exist (new installation)
295-
if (get_option(Config::INPUTS_PREFIX.'spotify_search_absolute_results') === false) {
293+
if (get_option(Config::INPUTS_PREFIX.'spotify_search_absolute_results') !== '0') {
296294
update_option(Config::INPUTS_PREFIX.'spotify_search_absolute_results', '1');
297295
}
298296
}

0 commit comments

Comments
 (0)