Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function custom_comment_logged_in_as($defaults) { //移除表头以xx身份登
</div>',
'comment_notes_after' => '',
'comment_notes_before' => '',
'fields' => apply_filters('comment_form_default_fields', array(
'fields' => (!is_user_logged_in()?apply_filters('comment_form_default_fields', array(
'avatar' => '<div class="cmt-info-container"><div class="comment-user-avatar">
<img alt="comment_user_avatar" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNy4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjUgRm9udGljb25zLCBJbmMuLS0+PHBhdGggZmlsbD0iIzgwODA4MCIgZD0iTTM5OSAzODQuMkMzNzYuOSAzNDUuOCAzMzUuNCAzMjAgMjg4IDMyMGwtNjQgMGMtNDcuNCAwLTg4LjkgMjUuOC0xMTEgNjQuMmMzNS4yIDM5LjIgODYuMiA2My44IDE0MyA2My44czEwNy44LTI0LjcgMTQzLTYzLjh6TTAgMjU2YTI1NiAyNTYgMCAxIDEgNTEyIDBBMjU2IDI1NiAwIDEgMSAwIDI1NnptMjU2IDE2YTcyIDcyIDAgMSAwIDAtMTQ0IDcyIDcyIDAgMSAwIDAgMTQ0eiIvPjwvc3ZnPg==">
<div class="socila-check qq-check"><i class="fa-brands fa-qq fa-xs"></i></div>
Expand All @@ -212,7 +212,7 @@ function custom_comment_logged_in_as($defaults) { //移除表头以xx身份登
</div></div>',
'qq' => '<input type="text" placeholder="QQ" name="new_field_qq" id="qq" value="' . esc_attr($comment_author_url) . '" style="display:none" autocomplete="off"/><!--此栏不可见-->',
'checks' => '<div class="comment-checks">' . ($comment_captcha ?? '') . ($private_ms ?? '') . ($mail_notify ?? '') ,//此处不闭合,和保存信息在一层级一起闭合
))
)):[]) // 用户登录则不显示任何字段
);

function comment_cookies_check_lable($field) {
Expand Down
17 changes: 17 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ function add_cache_control_header() { // 添加缓存策略
echo '<link rel="preload" href="' .$iro_css. '" as="style" onload="this.onload=null;this.rel=\'stylesheet\'">';
echo '<link rel="stylesheet" href="' . $iro_css . '">';
}, 9);

} else {
wp_enqueue_style('iro-css', $core_lib_basepath . '/style.css', array(), IRO_VERSION);
wp_enqueue_style('iro-codes', $core_lib_basepath . '/css/shortcodes.css', array(), IRO_VERSION);
Expand Down Expand Up @@ -608,6 +609,22 @@ function add_cache_control_header() { // 添加缓存策略
}
add_action('wp_enqueue_scripts', 'sakura_scripts');

add_action("after_setup_theme",function(){
if(iro_opt("poi_pjax",true)==true){
// 禁用wp6.9按需加载
add_filter( 'wp_should_load_separate_core_block_assets', '__return_false' );
add_filter( 'should_load_separate_core_block_assets', '__return_false', 1 );
add_filter( 'should_load_block_assets_on_demand', '__return_false', 1 );
add_filter( 'enqueue_empty_block_content_assets', '__return_true' );

// 全量加载wordpress区块和原生组件样式
wp_enqueue_style( 'wp-block-library' );
wp_enqueue_style( 'wp-block-library-theme' );
wp_enqueue_style( 'wp-block-library-comments' );
wp_enqueue_style( 'wp-block-library-widgets' );
}
});

/**
* load .php.
*/
Expand Down