diff --git a/lib/Form/Block/Radio.php b/lib/Form/Block/Radio.php index e1255c7424..4eccf1aa5f 100644 --- a/lib/Form/Block/Radio.php +++ b/lib/Form/Block/Radio.php @@ -25,18 +25,24 @@ class Radio extends Base { $html .= 'name="'.$field_name.'" '; - $html .= 'value="'.esc_attr($option['value']).'" '; + if(is_array($option['value'])) { + $value = key($option['value']); + $label = reset($option['value']); + } else { + $value = $option['value']; + $label = $option['value']; + } + + $html .= 'value="'.esc_attr($value).'" '; $html .= ( (isset($option['is_checked']) && $option['is_checked']) || - (self::getFieldValue($block) === $option['value']) + (self::getFieldValue($block) === $value) ) ? 'checked="checked"' : ''; $html .= $field_validation; - - $html .= ' /> '.esc_attr($option['value']); - + $html .= ' /> '.esc_attr($label); $html .= ''; } diff --git a/lib/Form/Block/Select.php b/lib/Form/Block/Select.php index 58e66ae9e0..89e62025c2 100644 --- a/lib/Form/Block/Select.php +++ b/lib/Form/Block/Select.php @@ -18,7 +18,12 @@ class Select extends Base { $html .= ''; } - foreach($block['params']['values'] as $option) { + $options = (!empty($block['params']['values']) + ? $block['params']['values'] + : array() + ); + + foreach($options as $option) { $is_selected = ( (isset($option['is_checked']) && $option['is_checked']) || diff --git a/lib/Settings/Pages.php b/lib/Settings/Pages.php index 7ef6c5ed30..58608efc83 100644 --- a/lib/Settings/Pages.php +++ b/lib/Settings/Pages.php @@ -67,8 +67,7 @@ class Pages { 'title' => $page->post_title, 'preview_url' => add_query_arg(array( 'preview' => 1 - ), get_permalink($page->ID)), - 'edit_url' => get_edit_post_link($page->ID) + ), get_permalink($page->ID)) ); } } \ No newline at end of file diff --git a/lib/Subscription/Pages.php b/lib/Subscription/Pages.php index 483be29f18..997dd85190 100644 --- a/lib/Subscription/Pages.php +++ b/lib/Subscription/Pages.php @@ -235,7 +235,7 @@ class Pages { ), array( 'id' => 'status', - 'type' => 'select', + 'type' => 'radio', 'params' => array( 'label' => __('Status'), 'values' => array( @@ -254,14 +254,6 @@ class Pages { 'is_checked' => ( $subscriber->status === Subscriber::STATUS_UNSUBSCRIBED ) - ), - array( - 'value' => array( - Subscriber::STATUS_UNCONFIRMED => __('Unconfirmed') - ), - 'is_checked' => ( - $subscriber->status === Subscriber::STATUS_UNCONFIRMED - ) ) ) ) diff --git a/views/settings.html b/views/settings.html index baa835afdf..ab9cd52a40 100644 --- a/views/settings.html +++ b/views/settings.html @@ -139,18 +139,6 @@ $(this).removeAttr('target'); } }); - - // page edit - $('.mailpoet_page_edit').on('click', function() { - var selection = $(this).siblings('.mailpoet_page_selection'); - if(selection.length > 0) { - $(this).attr('href', $(selection).find('option[value="'+$(selection).val()+'"]').data('edit-url')); - $(this).attr('target', '_blank'); - } else { - $(this).attr('href', 'javascript:;'); - $(this).removeAttr('target'); - } - }); }); }); diff --git a/views/settings/basics.html b/views/settings/basics.html index cf85308f69..6dd3b6329c 100644 --- a/views/settings/basics.html +++ b/views/settings/basics.html @@ -197,7 +197,7 @@ -