# Code Notes 导出 ## #7 手动重设WordPress自增值 - 标签: WordPress - 创建时间: 2025-05-29 01:43:36 ```sql ALTER TABLE wp_posts AUTO_INCREMENT = 51; ``` --- ## #6 Ubuntu改主机名 - 标签: Ubuntu - 创建时间: 2025-05-28 18:50:03 ```bash sudo hostnamectl set-hostname my-server ``` 然后重启 ```bash sudo reboot ``` --- ## #5 Ubuntu安装宝塔面板 - 标签: Ubuntu,宝塔面板 - 创建时间: 2025-05-28 18:47:34 ```bash wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh && sudo bash install_panel.sh ed8484bec ``` --- ## #4 Westlife主题更新用户昵称 - 标签: Westlife,WordPress - 创建时间: 2025-05-26 22:17:27 ```php function westlife_update_comment_author_name() { $comments = get_comments( array( 'user_id' => get_current_user_id() ) ); // 获取当前用户的所有评论 foreach ( $comments as $comment ) { $user = get_userdata( $comment->user_id ); if ( $user && $user->display_name !== $comment->comment_author ) { $comment_data = array( 'comment_ID' => $comment->comment_ID, 'comment_author' => $user->display_name, ); wp_update_comment( $comment_data ); } } } add_action( 'init', 'westlife_update_comment_author_name' ); ``` --- ## #3 重载 Nginx配置 - 标签: - 创建时间: 2025-05-26 19:00:22 ```bash nginx -t && nginx -s reload ``` --- ## #2 屏蔽 WordPress 自动草稿 - 标签: WordPress - 创建时间: 2025-05-26 11:00:20 ```php // functions.php 添加: remove_action('admin_init', 'wp_schedule_auto_draft_delete'); add_filter('wp_insert_post_data', function($data){ if ($data['post_status'] === 'auto-draft') { $data['post_status'] = 'draft'; } return $data; }); ``` --- ## #1 Debian安装BT面板 - 标签: 宝塔面板,Debian - 创建时间: 2025-05-26 10:39:37 ```bash wget -O install_panel.sh https://download.bt.cn/install/install_panel.sh && bash install_panel.sh ed8484bec ``` ---