feat: add smtp test function (#141)

pull/155/head
Seaton Jiang 2020-02-23 15:03:21 +08:00
parent ad7cd532e8
commit c26ab00926
6 changed files with 352 additions and 317 deletions

View File

@ -62,6 +62,7 @@ class Options_Framework_Admin {
// Displays notice after options save
add_action( 'optionsframework_after_validate', array( $this, 'save_options_notice' ) );
add_action( 'optionsframework_after_sendmail', array( $this, 'send_mail_notice' ) );
}
public function add_top_options_page()
@ -252,20 +253,27 @@ class Options_Framework_Admin {
}
}
// Hook to run after validation
do_action( 'optionsframework_after_validate', $clean );
return $clean;
if ( isset( $_POST['sendmail'] ) ) {
wp_mail( get_bloginfo( 'admin_email' ) ,__('[测试]邮件服务配置成功', 'kratos'),__('恭喜您 SMTP 邮件服务配置成功!', 'kratos'));
do_action( 'optionsframework_after_sendmail', $clean );
return $clean;
} else {
do_action( 'optionsframework_after_validate', $clean );
return $clean;
}
}
/**
* Display message when options have been saved
*/
function save_options_notice() {
add_settings_error( 'options-framework', 'save_options', __( '保存成功', 'kratos' ), 'updated fade' );
}
function send_mail_notice() {
add_settings_error( 'options-framework', 'send_mail', __( '发送完成,请留意邮箱:' . get_bloginfo( 'admin_email' ), 'kratos' ), 'updated fade' );
}
/**
* Get the default values for all the theme options
*

View File

@ -7,281 +7,284 @@
* @copyright 2010-2014 WP Theming
*/
class Options_Framework_Interface {
class Options_Framework_Interface
{
/**
* Generates the tabs that are used in the options menu
*/
static function optionsframework_tabs() {
$counter = 0;
$options = & Options_Framework::_optionsframework_options();
$menu = '';
/**
* Generates the tabs that are used in the options menu
*/
public static function optionsframework_tabs()
{
$counter = 0;
$options = &Options_Framework::_optionsframework_options();
$menu = '';
foreach ( $options as $value ) {
// Heading for Navigation
if ( $value['type'] == "heading" ) {
$counter++;
$class = '';
$class = ! empty( $value['id'] ) ? $value['id'] : $value['name'];
$class = preg_replace( '/[^a-zA-Z0-9._\-]/', '', strtolower($class) ) . '-tab';
$menu .= '<a id="options-group-'. $counter . '-tab" class="nav-tab ' . $class .'" title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#options-group-'. $counter ) . '">' . esc_html( $value['name'] ) . '</a>';
}
}
foreach ($options as $value) {
// Heading for Navigation
if ($value['type'] == "heading") {
$counter++;
$class = '';
$class = !empty($value['id']) ? $value['id'] : $value['name'];
$class = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($class)) . '-tab';
$menu .= '<a id="options-group-' . $counter . '-tab" class="nav-tab ' . $class . '" title="' . esc_attr($value['name']) . '" href="' . esc_attr('#options-group-' . $counter) . '">' . esc_html($value['name']) . '</a>';
}
}
return $menu;
}
return $menu;
}
/**
* Generates the options fields that are used in the form.
*/
static function optionsframework_fields() {
/**
* Generates the options fields that are used in the form.
*/
public static function optionsframework_fields()
{
global $allowedtags;
global $allowedtags;
$options_framework = new Options_Framework;
$option_name = $options_framework->get_option_name();
$settings = get_option( $option_name );
$options = & Options_Framework::_optionsframework_options();
$options_framework = new Options_Framework;
$option_name = $options_framework->get_option_name();
$settings = get_option($option_name);
$options = &Options_Framework::_optionsframework_options();
$counter = 0;
$menu = '';
$counter = 0;
$menu = '';
foreach ( $options as $value ) {
foreach ($options as $value) {
$val = '';
$select_value = '';
$output = '';
$val = '';
$select_value = '';
$output = '';
// Wrap all options
if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) && ( $value['type'] != "about" ) ) {
// Wrap all options
if (($value['type'] != "heading") && ($value['type'] != "info") && ($value['type'] != "about")) {
// Keep all ids lowercase with no spaces
$value['id'] = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['id']) );
// Keep all ids lowercase with no spaces
$value['id'] = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($value['id']));
$id = 'section-' . $value['id'];
$id = 'section-' . $value['id'];
$class = 'section';
if ( isset( $value['type'] ) ) {
$class .= ' section-' . $value['type'];
}
if ( isset( $value['class'] ) ) {
$class .= ' ' . $value['class'];
}
$class = 'section';
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div id="' . esc_attr( $id ) .'" class="' . esc_attr( $class ) . '">'."\n";
if ( isset( $value['name'] ) ) {
$output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
}
if ( $value['type'] != 'editor' ) {
$output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
}
else {
$output .= '<div class="option">' . "\n" . '<div>' . "\n";
}
}
$output .= '<div id="' . esc_attr($id) . '" class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
$output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n";
}
if ($value['type'] != 'editor') {
$output .= '<div class="option">' . "\n" . '<div class="controls">' . "\n";
} else {
$output .= '<div class="option">' . "\n" . '<div>' . "\n";
}
}
// Set default value to $val
if ( isset( $value['std'] ) ) {
$val = $value['std'];
}
// Set default value to $val
if (isset($value['std'])) {
$val = $value['std'];
}
// If the option is already saved, override $val
if ( ( $value['type'] != 'heading' ) && ( $value['type'] != 'info') && ( $value['type'] != "about" ) ) {
if ( isset( $settings[($value['id'])]) ) {
$val = $settings[($value['id'])];
// Striping slashes of non-array options
if ( !is_array($val) ) {
$val = stripslashes( $val );
}
}
}
// If the option is already saved, override $val
if (($value['type'] != 'heading') && ($value['type'] != 'info') && ($value['type'] != "about")) {
if (isset($settings[($value['id'])])) {
$val = $settings[($value['id'])];
// Striping slashes of non-array options
if (!is_array($val)) {
$val = stripslashes($val);
}
}
}
// If there is a description save it for labels
$explain_value = '';
if ( isset( $value['desc'] ) ) {
$explain_value = $value['desc'];
}
// If there is a description save it for labels
$explain_value = '';
if (isset($value['desc'])) {
$explain_value = $value['desc'];
}
// Set the placeholder if one exists
$placeholder = '';
if ( isset( $value['placeholder'] ) ) {
$placeholder = ' placeholder="' . esc_attr( $value['placeholder'] ) . '"';
}
// Set the placeholder if one exists
$placeholder = '';
if (isset($value['placeholder'])) {
$placeholder = ' placeholder="' . esc_attr($value['placeholder']) . '"';
}
if ( has_filter( 'optionsframework_' . $value['type'] ) ) {
$output .= apply_filters( 'optionsframework_' . $value['type'], $option_name, $value, $val );
}
if (has_filter('optionsframework_' . $value['type'])) {
$output .= apply_filters('optionsframework_' . $value['type'], $option_name, $value, $val);
}
switch ($value['type']) {
switch ( $value['type'] ) {
// Basic text input
case 'text':
$output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="text" value="' . esc_attr($val) . '"' . $placeholder . ' />';
break;
// Basic text input
case 'text':
$output .= '<input id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" type="text" value="' . esc_attr( $val ) . '"' . $placeholder . ' />';
break;
// Password input
case 'password':
$output .= '<input id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" type="password" value="' . esc_attr($val) . '" />';
break;
// Password input
case 'password':
$output .= '<input id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" type="password" value="' . esc_attr( $val ) . '" />';
break;
// Textarea
case 'textarea':
$rows = '8';
// Textarea
case 'textarea':
$rows = '8';
if (isset($value['settings']['rows'])) {
$custom_rows = $value['settings']['rows'];
if (is_numeric($custom_rows)) {
$rows = $custom_rows;
}
}
if ( isset( $value['settings']['rows'] ) ) {
$custom_rows = $value['settings']['rows'];
if ( is_numeric( $custom_rows ) ) {
$rows = $custom_rows;
}
}
$val = stripslashes($val);
$output .= '<textarea id="' . esc_attr($value['id']) . '" class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" rows="' . $rows . '"' . $placeholder . '>' . esc_textarea($val) . '</textarea>';
break;
$val = stripslashes( $val );
$output .= '<textarea id="' . esc_attr( $value['id'] ) . '" class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" rows="' . $rows . '"' . $placeholder . '>' . esc_textarea( $val ) . '</textarea>';
break;
// Select Box
case 'select':
$output .= '<select class="of-input" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '">';
// Select Box
case 'select':
$output .= '<select class="of-input" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '">';
foreach ($value['options'] as $key => $option) {
$output .= '<option' . selected($val, $key, false) . ' value="' . esc_attr($key) . '">' . esc_html($option) . '</option>';
}
$output .= '</select>';
break;
foreach ($value['options'] as $key => $option ) {
$output .= '<option'. selected( $val, $key, false ) .' value="' . esc_attr( $key ) . '">' . esc_html( $option ) . '</option>';
}
$output .= '</select>';
break;
// Radio Box
case "radio":
$name = $option_name . '[' . $value['id'] . ']';
foreach ($value['options'] as $key => $option) {
$id = $option_name . '-' . $value['id'] . '-' . $key;
$output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr($name) . '" id="' . esc_attr($id) . '" value="' . esc_attr($key) . '" ' . checked($val, $key, false) . ' /><label for="' . esc_attr($id) . '">' . esc_html($option) . '</label>';
}
break;
// Image Selectors
case "images":
$name = $option_name . '[' . $value['id'] . ']';
foreach ($value['options'] as $key => $option) {
$selected = '';
if ($val != '' && ($val == $key)) {
$selected = ' of-radio-img-selected';
}
$output .= '<input type="radio" id="' . esc_attr($value['id'] . '_' . $key) . '" class="of-radio-img-radio" value="' . esc_attr($key) . '" name="' . esc_attr($name) . '" ' . checked($val, $key, false) . ' />';
$output .= '<div class="of-radio-img-label">' . esc_html($key) . '</div>';
$output .= '<img src="' . esc_url($option) . '" alt="' . $option . '" class="of-radio-img-img' . $selected . '" onclick="document.getElementById(\'' . esc_attr($value['id'] . '_' . $key) . '\').checked=true;" />';
}
break;
// Radio Box
case "radio":
$name = $option_name .'['. $value['id'] .']';
foreach ($value['options'] as $key => $option) {
$id = $option_name . '-' . $value['id'] .'-'. $key;
$output .= '<input class="of-input of-radio" type="radio" name="' . esc_attr( $name ) . '" id="' . esc_attr( $id ) . '" value="'. esc_attr( $key ) . '" '. checked( $val, $key, false) .' /><label for="' . esc_attr( $id ) . '">' . esc_html( $option ) . '</label>';
}
break;
// Checkbox
case "checkbox":
$output .= '<input id="' . esc_attr($value['id']) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" ' . checked($val, 1, false) . ' />';
$output .= '<label class="explain" for="' . esc_attr($value['id']) . '">' . wp_kses($explain_value, $allowedtags) . '</label>';
break;
// Image Selectors
case "images":
$name = $option_name .'['. $value['id'] .']';
foreach ( $value['options'] as $key => $option ) {
$selected = '';
if ( $val != '' && ($val == $key) ) {
$selected = ' of-radio-img-selected';
}
$output .= '<input type="radio" id="' . esc_attr( $value['id'] .'_'. $key) . '" class="of-radio-img-radio" value="' . esc_attr( $key ) . '" name="' . esc_attr( $name ) . '" '. checked( $val, $key, false ) .' />';
$output .= '<div class="of-radio-img-label">' . esc_html( $key ) . '</div>';
$output .= '<img src="' . esc_url( $option ) . '" alt="' . $option .'" class="of-radio-img-img' . $selected .'" onclick="document.getElementById(\''. esc_attr($value['id'] .'_'. $key) .'\').checked=true;" />';
}
break;
// Color picker
case "color":
$default_color = '';
if (isset($value['std'])) {
if ($val != $value['std']) {
$default_color = ' data-default-color="' . $value['std'] . '" ';
}
// Checkbox
case "checkbox":
$output .= '<input id="' . esc_attr( $value['id'] ) . '" class="checkbox of-input" type="checkbox" name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" '. checked( $val, 1, false) .' />';
$output .= '<label class="explain" for="' . esc_attr( $value['id'] ) . '">' . wp_kses( $explain_value, $allowedtags) . '</label>';
break;
// Color picker
case "color":
$default_color = '';
if ( isset($value['std']) ) {
if ( $val != $value['std'] )
$default_color = ' data-default-color="' .$value['std'] . '" ';
}
$output .= '<input name="' . esc_attr( $option_name . '[' . $value['id'] . ']' ) . '" id="' . esc_attr( $value['id'] ) . '" class="of-color" type="text" value="' . esc_attr( $val ) . '"' . $default_color .' />';
}
$output .= '<input name="' . esc_attr($option_name . '[' . $value['id'] . ']') . '" id="' . esc_attr($value['id']) . '" class="of-color" type="text" value="' . esc_attr($val) . '"' . $default_color . ' />';
break;
break;
// Uploader
case "upload":
$output .= Options_Framework_Media_Uploader::optionsframework_uploader( $value['id'], $val, null );
// Uploader
case "upload":
$output .= Options_Framework_Media_Uploader::optionsframework_uploader($value['id'], $val, null);
break;
break;
case "info":
$id = '';
$class = 'section';
if ( isset( $value['id'] ) ) {
$id = 'id="' . esc_attr( $value['id'] ) . '" ';
}
if ( isset( $value['type'] ) ) {
$class .= ' section-' . $value['type'];
}
if ( isset( $value['class'] ) ) {
$class .= ' ' . $value['class'];
}
case "info":
$id = '';
$class = 'section';
if (isset($value['id'])) {
$id = 'id="' . esc_attr($value['id']) . '" ';
}
if (isset($value['type'])) {
$class .= ' section-' . $value['type'];
}
if (isset($value['class'])) {
$class .= ' ' . $value['class'];
}
$output .= '<div ' . $id . 'class="' . esc_attr( $class ) . '">' . "\n";
if ( isset($value['name']) ) {
$output .= '<h4 class="heading">' . esc_html( $value['name'] ) . '</h4>' . "\n";
}
if ( isset( $value['desc'] ) ) {
$output .= $value['desc'] . "\n";
}
$output .= '</div>' . "\n";
break;
$output .= '<div ' . $id . 'class="' . esc_attr($class) . '">' . "\n";
if (isset($value['name'])) {
$output .= '<h4 class="heading">' . esc_html($value['name']) . '</h4>' . "\n";
}
if (isset($value['desc'])) {
$output .= $value['desc'] . "\n";
}
$output .= '</div>' . "\n";
break;
case "about":
global $wp_version;
$version = $wp_version;
$output .= '<div class="section section-info">
<div class="about-content">
<img src="'. get_template_directory_uri() .'/inc/options-framework/images/about.png">
<h4>'. __('基础信息','kratos') .'</h3>
case "about":
global $wp_version;
$version = $wp_version;
$output .= '<div class="about-content">
<img src="' . get_template_directory_uri() . '/inc/options-framework/images/about.png">
<h4>' . __('基础信息', 'kratos') . '</h3>
<ul>
<li>'. __('PHP 版本:','kratos') . PHP_VERSION .'</li>
<li>'. __('Kratos 版本:','kratos') . THEME_VERSION .'</li>
<li>'. __('WordPress 版本:','kratos') . $version .'</li>
<li>'. __('User Agent 信息:','kratos') . $_SERVER['HTTP_USER_AGENT'] .'</li>
<li>' . __('PHP 版本:', 'kratos') . PHP_VERSION . '</li>
<li>' . __('Kratos 版本:', 'kratos') . THEME_VERSION . '</li>
<li>' . __('WordPress 版本:', 'kratos') . $version . '</li>
<li>' . __('User Agent 信息:', 'kratos') . $_SERVER['HTTP_USER_AGENT'] . '</li>
</ul>
<p class="notices">'. __('提示:在提交主题相关问题反馈时,请将上面「基础信息」中的内容复制到环境信息中。','kratos') .'</p>
<h4>'. __('资料文档','kratos') .'</h3>
<p class="notices">' . __('提示:在提交主题相关问题反馈时,请将上面「基础信息」中的内容复制到环境信息中。', 'kratos') . '</p>
<h4>' . __('资料文档', 'kratos') . '</h3>
<ul>
<li>'. __('说明文档:','kratos') .'<a href="https://www.vtrois.com/" target="_blank">https://www.vtrois.com/</a></li>
<li>'. __('代码托管:','kratos') .'<a href="https://github.com/vtrois/kratos" target="_blank">https://github.com/vtrois/kratos</a></li>
<li>'. __('问题反馈:','kratos') .'<a href="https://github.com/vtrois/kratos/issues" target="_blank">https://github.com/vtrois/kratos/issues</a></li>
<li>'. __('更新日志:','kratos') .'<a href="https://github.com/vtrois/kratos/releases" target="_blank">https://github.com/vtrois/kratos/releases</a></li>
<li>' . __('说明文档:', 'kratos') . '<a href="https://www.vtrois.com/" target="_blank">https://www.vtrois.com/</a></li>
<li>' . __('代码托管:', 'kratos') . '<a href="https://github.com/vtrois/kratos" target="_blank">https://github.com/vtrois/kratos</a></li>
<li>' . __('问题反馈:', 'kratos') . '<a href="https://github.com/vtrois/kratos/issues" target="_blank">https://github.com/vtrois/kratos/issues</a></li>
<li>' . __('更新日志:', 'kratos') . '<a href="https://github.com/vtrois/kratos/releases" target="_blank">https://github.com/vtrois/kratos/releases</a></li>
</ul>
<h4>'. __('讨论交流','kratos') .'</h3>
<p>'. __('欢迎使用 Kratos 主题开始文章创作,诚邀您加入主题交流 QQ 群:<a href="https://shang.qq.com/wpa/qunwpa?idkey=18a1de727037e3e8b9b49bfc7a410139e5db736106ef07292f07a62ff5eef9a2" target="_blank">734508</a>','kratos') .'</p>
<h4>'. __('版权声明','kratos') .'</h3>
<p>'. __('主题源码使用 <a href="https://github.com/Vtrois/Kratos/blob/master/LICENSE" target="_blank">MIT 协议</a> 进行许可,说明文档使用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a> 进行许可。','kratos') .'</p>
<h4>'. __('打赏支持','kratos') .'</h3>
<img src="'. get_template_directory_uri() .'/inc/options-framework/images/donate.png">
<p class="tips">'. __('项目的发展需要您的支持和鼓励,打赏时请确认作者姓名为<b>姜学栋</b>','kratos') .'</p>
</div>
</div>';
break;
<h4>' . __('讨论交流', 'kratos') . '</h3>
<p>' . __('欢迎使用 Kratos 主题开始文章创作,诚邀您加入主题交流 QQ 群:<a href="https://shang.qq.com/wpa/qunwpa?idkey=18a1de727037e3e8b9b49bfc7a410139e5db736106ef07292f07a62ff5eef9a2" target="_blank">734508</a>', 'kratos') . '</p>
<h4>' . __('版权声明', 'kratos') . '</h3>
<p>' . __('主题源码使用 <a href="https://github.com/Vtrois/Kratos/blob/master/LICENSE" target="_blank">MIT 协议</a> 进行许可,说明文档使用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a> 进行许可。', 'kratos') . '</p>
<h4>' . __('打赏支持', 'kratos') . '</h3>
<img src="' . get_template_directory_uri() . '/inc/options-framework/images/donate.png">
<p class="tips">' . __('项目的发展需要您的支持和鼓励,打赏时请确认作者姓名为<b>姜学栋</b>', 'kratos') . '</p>
</div>';
break;
// Heading for Navigation
case "heading":
$counter++;
if ( $counter >= 2 ) {
$output .= '</div>'."\n";
}
$class = '';
$class = ! empty( $value['id'] ) ? $value['id'] : $value['name'];
$class = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($class) );
$output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">';
$output .= '<h3>' . esc_html( $value['name'] ) . '</h3>' . "\n";
break;
}
case "sendmail":
$output .= '<input type="submit" name="sendmail" class="button-secondary" value="' . __('测试邮件', 'kratos') . '">';
break;
if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) && ( $value['type'] != "about" ) ) {
$output .= '</div>';
if ( ( $value['type'] != "checkbox" ) && ( $value['type'] != "editor" ) ) {
$output .= '<div class="explain">' . wp_kses( $explain_value, $allowedtags) . '</div>'."\n";
}
$output .= '</div></div>'."\n";
}
// Heading for Navigation
case "heading":
$counter++;
if ($counter >= 2) {
$output .= '</div>' . "\n";
}
$class = '';
$class = !empty($value['id']) ? $value['id'] : $value['name'];
$class = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($class));
$output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">';
$output .= '<h3>' . esc_html($value['name']) . '</h3>' . "\n";
break;
}
echo $output;
}
if (($value['type'] != "heading") && ($value['type'] != "info") && ($value['type'] != "about")) {
$output .= '</div>';
if (($value['type'] != "checkbox") && ($value['type'] != "editor")) {
$output .= '<div class="explain">' . wp_kses($explain_value, $allowedtags) . '</div>' . "\n";
}
$output .= '</div></div>' . "\n";
}
// Outputs closing div if there tabs
if ( Options_Framework_Interface::optionsframework_tabs() != '' ) {
echo '</div>';
}
}
echo $output;
}
}
// Outputs closing div if there tabs
if (Options_Framework_Interface::optionsframework_tabs() != '') {
echo '</div>';
}
}
}

View File

@ -32,6 +32,7 @@ jQuery(document).ready(function($) {
jQuery('#section-m_port').fadeToggle(400);
jQuery('#section-m_username').fadeToggle(400);
jQuery('#section-m_passwd').fadeToggle(400);
jQuery('#section-m_sendmail').fadeToggle(400);
});
if (jQuery('#m_smtp:checked').val() !== undefined) {
@ -40,6 +41,7 @@ jQuery(document).ready(function($) {
jQuery('#section-m_port').show();
jQuery('#section-m_username').show();
jQuery('#section-m_passwd').show();
jQuery('#section-m_sendmail').show();
}
// Loads the color pickers

View File

@ -3,7 +3,7 @@
* 主题选项
* @author Seaton Jiang <seaton@vtrois.com>
* @license MIT License
* @version 2020.02.15
* @version 2020.02.23
*/
function getrobots()
@ -326,6 +326,12 @@ function kratos_options()
'type' => 'password',
);
$options[] = array(
'id' => 'm_sendmail',
'class' => 'hidden',
'type' => 'sendmail',
);
$options[] = array(
'name' => __('顶部配置', 'kratos'),
'type' => 'heading',

View File

@ -3,7 +3,7 @@
* 侧栏小工具
* @author Seaton Jiang <seaton@vtrois.com>
* @license MIT License
* @version 2020.02.22
* @version 2020.02.23
*/
// 添加小工具

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
"Project-Id-Version: Kratos\n"
"POT-Creation-Date: 2020-02-22 15:03+0800\n"
"POT-Creation-Date: 2020-02-23 15:01+0800\n"
"PO-Revision-Date: 2020-02-14 23:32+0800\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -66,84 +66,96 @@ msgstr ""
msgid "搜点什么呢?"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:70
#: inc/options-framework/includes/class-options-framework-admin.php:71
#: inc/options-framework/includes/class-options-framework-admin.php:84
#: inc/options-framework/includes/class-options-framework-admin.php:72
#: inc/options-framework/includes/class-options-framework-admin.php:85
#: inc/options-framework/includes/class-options-framework-admin.php:86
msgid "主题设置"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:180
#: inc/options-framework/includes/class-options-framework-admin.php:181
msgid "保存配置"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:181
#: inc/options-framework/includes/class-options-framework-admin.php:182
msgid "恢复默认"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:181
#: inc/options-framework/includes/class-options-framework-admin.php:182
msgid "单击「确定」进行恢复,但所有的配置都将丢失!"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:212
#: inc/options-framework/includes/class-options-framework-admin.php:213
msgid "恢复完成"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:266
#: inc/options-framework/includes/class-options-framework-admin.php:257
msgid "[测试]邮件服务配置成功"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:257
msgid "恭喜您 SMTP 邮件服务配置成功!"
msgstr ""
#: inc/options-framework/includes/class-options-framework-admin.php:270
msgid "保存成功"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:229
#: inc/options-framework/includes/class-options-framework-admin.php:274
msgid "发送完成,请留意邮箱:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:230
msgid "基础信息"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:231
#: inc/options-framework/includes/class-options-interface.php:232
msgid "PHP 版本:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:232
#: inc/options-framework/includes/class-options-interface.php:233
msgid "Kratos 版本:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:233
#: inc/options-framework/includes/class-options-interface.php:234
msgid "WordPress 版本:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:234
#: inc/options-framework/includes/class-options-interface.php:235
msgid "User Agent 信息:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:236
#: inc/options-framework/includes/class-options-interface.php:237
msgid ""
"提示:在提交主题相关问题反馈时,请将上面「基础信息」中的内容复制到环境信息"
"中。"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:237
#: inc/options-framework/includes/class-options-interface.php:238
msgid "资料文档"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:239
#: inc/options-framework/includes/class-options-interface.php:240
msgid "说明文档:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:240
#: inc/options-framework/includes/class-options-interface.php:241
msgid "代码托管:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:241
#: inc/options-framework/includes/class-options-interface.php:242
msgid "问题反馈:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:242
#: inc/options-framework/includes/class-options-interface.php:243
msgid "更新日志:"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:244
#: inc/options-framework/includes/class-options-interface.php:245
msgid "讨论交流"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:245
#: inc/options-framework/includes/class-options-interface.php:246
msgid ""
"欢迎使用 Kratos 主题开始文章创作,诚邀您加入主题交流 QQ 群:<a href="
"\"https://shang.qq.com/wpa/qunwpa?"
@ -151,11 +163,11 @@ msgid ""
"target=\"_blank\">734508</a>"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:246
#: inc/options-framework/includes/class-options-interface.php:247
msgid "版权声明"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:247
#: inc/options-framework/includes/class-options-interface.php:248
msgid ""
"主题源码使用 <a href=\"https://github.com/Vtrois/Kratos/blob/master/LICENSE"
"\" target=\"_blank\">MIT 协议</a> 进行许可,说明文档使用 <a href=\"https://"
@ -163,14 +175,18 @@ msgid ""
"4.0</a> 进行许可。"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:248
#: inc/options-framework/includes/class-options-interface.php:249
msgid "打赏支持"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:250
#: inc/options-framework/includes/class-options-interface.php:251
msgid "项目的发展需要您的支持和鼓励,打赏时请确认作者姓名为<b>姜学栋</b>"
msgstr ""
#: inc/options-framework/includes/class-options-interface.php:256
msgid "测试邮件"
msgstr ""
#: inc/options-framework/includes/class-options-media-uploader.php:62
msgid "没有选择任何文件"
msgstr ""
@ -457,7 +473,7 @@ msgstr ""
msgid "个人昵称"
msgstr ""
#: inc/theme-options.php:271 inc/theme-widgets.php:146
#: inc/theme-options.php:271 inc/theme-widgets.php:140
msgid "个人简介"
msgstr ""
@ -513,123 +529,123 @@ msgstr ""
msgid "填写邮箱密码"
msgstr ""
#: inc/theme-options.php:330
#: inc/theme-options.php:336
msgid "顶部配置"
msgstr ""
#: inc/theme-options.php:335
#: inc/theme-options.php:341
msgid "顶部图片"
msgstr ""
#: inc/theme-options.php:342
#: inc/theme-options.php:348
msgid "副标题"
msgstr ""
#: inc/theme-options.php:349
#: inc/theme-options.php:355
msgid "标题描述"
msgstr ""
#: inc/theme-options.php:356
#: inc/theme-options.php:362
msgid "页脚配置"
msgstr ""
#: inc/theme-options.php:361
#: inc/theme-options.php:367
msgid "选择需要开启的社交图标"
msgstr ""
#: inc/theme-options.php:362
#: inc/theme-options.php:368
msgid "国内平台"
msgstr ""
#: inc/theme-options.php:367
#: inc/theme-options.php:373
msgid "新浪微博"
msgstr ""
#: inc/theme-options.php:380
#: inc/theme-options.php:386
msgid "哔哩哔哩"
msgstr ""
#: inc/theme-options.php:393
#: inc/theme-options.php:399
msgid "CODING"
msgstr ""
#: inc/theme-options.php:406
#: inc/theme-options.php:412
msgid "码云 Gitee"
msgstr ""
#: inc/theme-options.php:419
#: inc/theme-options.php:425
msgid "海外平台"
msgstr ""
#: inc/theme-options.php:424
#: inc/theme-options.php:430
msgid "Twitter"
msgstr ""
#: inc/theme-options.php:437
#: inc/theme-options.php:443
msgid "Telegram"
msgstr ""
#: inc/theme-options.php:450
#: inc/theme-options.php:456
msgid "LinkedIn"
msgstr ""
#: inc/theme-options.php:463
#: inc/theme-options.php:469
msgid "YouTube"
msgstr ""
#: inc/theme-options.php:476
#: inc/theme-options.php:482
msgid "Github"
msgstr ""
#: inc/theme-options.php:489
#: inc/theme-options.php:495
msgid "Stack Overflow"
msgstr ""
#: inc/theme-options.php:502
#: inc/theme-options.php:508
msgid "其他"
msgstr ""
#: inc/theme-options.php:507
#: inc/theme-options.php:513
msgid "电子邮箱"
msgstr ""
#: inc/theme-options.php:520
#: inc/theme-options.php:526
msgid "工信部备案信息"
msgstr ""
#: inc/theme-options.php:527
#: inc/theme-options.php:533
msgid "公安网备案信息"
msgstr ""
#: inc/theme-options.php:534
#: inc/theme-options.php:540
msgid "公安网备案连接"
msgstr ""
#: inc/theme-options.php:541
#: inc/theme-options.php:547
msgid "版权信息"
msgstr ""
#: inc/theme-options.php:548
#: inc/theme-options.php:554
msgid "广告配置"
msgstr ""
#: inc/theme-options.php:553
#: inc/theme-options.php:559
msgid "文章页面广告"
msgstr ""
#: inc/theme-options.php:554
#: inc/theme-options.php:560
msgid "开启顶部广告"
msgstr ""
#: inc/theme-options.php:567 inc/theme-options.php:587
#: inc/theme-options.php:573 inc/theme-options.php:593
msgid "选填广告连接,如果不填则只显示图片"
msgstr ""
#: inc/theme-options.php:574
#: inc/theme-options.php:580
msgid "开启底部广告"
msgstr ""
#: inc/theme-options.php:594
#: inc/theme-options.php:600
msgid "关于主题"
msgstr ""
@ -695,92 +711,92 @@ msgstr ""
msgid "侧边栏工具"
msgstr ""
#: inc/theme-widgets.php:77
#: inc/theme-widgets.php:71
msgid "图片广告"
msgstr ""
#: inc/theme-widgets.php:78
#: inc/theme-widgets.php:72
msgid "显示自定义图片广告的工具"
msgstr ""
#: inc/theme-widgets.php:94 inc/theme-widgets.php:116
#: inc/theme-widgets.php:88 inc/theme-widgets.php:110
msgid "广告"
msgstr ""
#: inc/theme-widgets.php:122
#: inc/theme-widgets.php:116
msgid "副标题:"
msgstr ""
#: inc/theme-widgets.php:126
#: inc/theme-widgets.php:120
msgid "链接地址:"
msgstr ""
#: inc/theme-widgets.php:130
#: inc/theme-widgets.php:124
msgid "广告图片:"
msgstr ""
#: inc/theme-widgets.php:132 inc/theme-widgets.php:196
#: inc/theme-widgets.php:126 inc/theme-widgets.php:190
msgid "选择图片"
msgstr ""
#: inc/theme-widgets.php:147
#: inc/theme-widgets.php:141
msgid "可跳转后台的个人简介展示工具"
msgstr ""
#: inc/theme-widgets.php:194
#: inc/theme-widgets.php:188
msgid "背景图片:"
msgstr ""
#: inc/theme-widgets.php:208 inc/theme-widgets.php:231
#: inc/theme-widgets.php:202 inc/theme-widgets.php:225
msgid "标签聚合"
msgstr ""
#: inc/theme-widgets.php:209
#: inc/theme-widgets.php:203
msgid "文章标签的展示工具"
msgstr ""
#: inc/theme-widgets.php:254
#: inc/theme-widgets.php:248
msgid "显示数量:"
msgstr ""
#: inc/theme-widgets.php:258
#: inc/theme-widgets.php:252
msgid "显示排序:"
msgstr ""
#: inc/theme-widgets.php:260
#: inc/theme-widgets.php:254
msgid "降序"
msgstr ""
#: inc/theme-widgets.php:261
#: inc/theme-widgets.php:255
msgid "升序"
msgstr ""
#: inc/theme-widgets.php:262 inc/theme-widgets.php:292
#: inc/theme-widgets.php:297
#: inc/theme-widgets.php:256 inc/theme-widgets.php:286
#: inc/theme-widgets.php:291
msgid "随机"
msgstr ""
#: inc/theme-widgets.php:275
#: inc/theme-widgets.php:269
msgid "文章聚合"
msgstr ""
#: inc/theme-widgets.php:276
#: inc/theme-widgets.php:270
msgid "展示最热、随机、最新文章的工具"
msgstr ""
#: inc/theme-widgets.php:290 inc/theme-widgets.php:295
#: inc/theme-widgets.php:284 inc/theme-widgets.php:289
msgid "最新"
msgstr ""
#: inc/theme-widgets.php:291 inc/theme-widgets.php:296
#: inc/theme-widgets.php:285 inc/theme-widgets.php:290
msgid "热点"
msgstr ""
#: inc/theme-widgets.php:334
#: inc/theme-widgets.php:328
msgid "展示数量:"
msgstr ""
#: inc/theme-widgets.php:338
#: inc/theme-widgets.php:332
msgid "统计天数:"
msgstr ""