Skip to content

Commit

Permalink
✨ 增加配置拖拽排序及兼容优化
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Oct 27, 2022
1 parent 4ec6644 commit ce10466
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 77 deletions.
2 changes: 1 addition & 1 deletion assets/dist/setting/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 76 additions & 64 deletions assets/dist/setting/index.js

Large diffs are not rendered by default.

20 changes: 11 additions & 9 deletions inc/fun/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,17 +136,19 @@ function pk_is_pjax()
}

//判断阅读数量是否需要增加并进行操作
function the_views_add($post_ID, $count, $key, $ajax = false)
{
if (is_single() || is_page() || $ajax) {
if ($count == '') {
add_post_meta($post_ID, $key, '0');
} else {
update_post_meta($post_ID, $key, $count + 1);
$count++;
if(!function_exists('the_views_add')){
function the_views_add($post_ID, $count, $key, $ajax = false)
{
if (is_single() || is_page() || $ajax) {
if ($count == '') {
add_post_meta($post_ID, $key, '0');
} else {
update_post_meta($post_ID, $key, $count + 1);
$count++;
}
}
return $count;
}
return $count;
}

//获取当前的阅读数量与自增
Expand Down
7 changes: 4 additions & 3 deletions inc/setting/options/OptionCarousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function get_fields(): array
'icon' => 'dashicons-format-gallery',
'fields' => [
[
'id'=>'-',
'type'=>'info',
'tips'=>'说明:幻灯片尺寸建议统一为2:1的比例,例如800*400,另外所有的幻灯片尺寸必须完全一致,否则会出现高度不一的情况!',
'id' => '-',
'type' => 'info',
'tips' => '说明:幻灯片尺寸建议统一为2:1的比例,例如800*400,另外所有的幻灯片尺寸必须完全一致,否则会出现高度不一的情况!',
],
[
'id' => 'index_carousel',
Expand All @@ -28,6 +28,7 @@ function get_fields(): array
'label' => '首页幻灯片列表',
'type' => 'dynamic-list',
'sdt' => [],
'draggable' => true,
'dynamicModel' => [
['id' => 'title', 'label' => '幻灯标题', 'std' => ''],
['id' => 'img', 'label' => '幻灯图片', 'std' => '', 'type' => 'img'],
Expand Down
2 changes: 2 additions & 0 deletions inc/setting/options/OptionCompany.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function get_fields(): array
'label' => '产品列表',
'type' => 'dynamic-list',
'sdt' => [],
'draggable' => true,
'dynamicModel'=>[
['id' => 'title', 'label' => '标题', 'std' => ''],
['id' => 'img', 'label' => '图片', 'std' => '', 'type' => 'img'],
Expand All @@ -38,6 +39,7 @@ function get_fields(): array
'label' => '做什么-列表',
'type' => 'dynamic-list',
'sdt' => [],
'draggable' => true,
'dynamicModel'=>[
['id' => 'title', 'label' => '标题', 'std' => ''],
['id' => 'icon', 'label' => '图标', 'std' => ''],
Expand Down
1 change: 1 addition & 0 deletions inc/setting/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function loadWpContentHeight() {
loadWpContentHeight()
})

window.puockSettingId = "puock-theme-options-global";
window.puockSettingMetaInfo = {
version: "V<?php echo PUOCK_CUR_VER_STR ?>",
description:'简单/方便/高颜值',
Expand Down

0 comments on commit ce10466

Please sign in to comment.