
大柱
2°

大柱
2°
文章内外部链接添加nofollow
/*
* WordPress给文章外链添加nofollow有助于seo优化
*/
add_filter('the_content','web589_the_content_nofollow',999);
function web589_the_content_nofollow($content){
preg_match_all('/href="(.*?)" rel="external nofollow" rel="external nofollow" /',$content,$match

大柱
3°
宝塔 Linux面板 7.9.10 开心版
Linux面板 7.9.10 升级企业版命令 1(7.9.10 官方版 / 7.9.8 开心版 可以执行这个升级到 7.9.10 开心版):
curl https://io.bt.sy/install/update_panel.sh|bash
curl http://io.bt.sy/install/update6.sh|bash
如果不想再用开心版了,就可以用下面的命令一键还原到官方的最新版本
curl http://download.bt.cn/install/update6.sh|ba

if
2°

大柱
1°
上传图片自动重命名
//自动上传图片命名
add_action( 'add_attachment', 'my_set_image_meta_upon_image_upload' );
function my_set_image_meta_upon_image_upload( $post_ID ) {
// 检查上传的文件是否为图像,否则不执行任何操作
if ( wp_attachment_is_image( $post_ID ) ) {
$my_image_title = get_post( $post_ID )->post_title;
// 清理标题:删除连字符、下划线和额外空格:
$my_image_title = preg_replace( '%\s*[-_\s]+\s*%', ' ', $my_image_title );
// 清理标题:将每个单词的第一个字母大写(其他字母小写):
$my_image_title = ucwords( strtolower( $my_image_title ) );
// 创建一个包含要更新的图像元(标题、标题、说明)的数组
// 注意:如果不需要,请注释掉摘录/标题或内容/描述行
$my_image_meta = array(
'ID' => $post_ID, // 指定要更新的图像(ID)
'post_title' => $my_image_title, // 将图像标题设置为已清除标题
'post_excerpt' => $my_image_title, // 将图像标题(节选)设置为净化标题
'post_content' => $my_image_title, // 将图像描述(内容)设置为已清除标题
);
// 将图像设置为Alt文本
update_post_meta( $post_ID, '_wp_attachment_image_alt', $my_image_title );
// 设置图像元(例如标题、摘录、内容)
wp_update_post( $my_image_meta );
}
}

大柱
1°
轻松一键获取B站视频地址可以加入浏览器收藏夹方便日常使用
功能很简单,之前在一个博主的网站上发现的一段有意思的代码,直到我今天特别需要用的时候,找了很久都没有找到,还是在以前的旧系统盘当中找到的这段代码。
使用非常的简单,在浏览器当中新建收藏夹,然后地址栏(URL)当中将代码粘贴进去,再到B站看视频想要下载的时候,点击一下,就能很轻松的获取到视频的默认地址了。
- javascript:(()=>{const info = "made by ourongxing(即刻,B站,Github)";try{const link = `https://video-direct-link.vercel.app/bili.mp4?aid=${aid}&bvid=${bvid}&cid=${cid}`;const res = prompt("Command/Ctrl + C 复制,点击确定后直接跳转\n"+info,link);res&&window.open(link)}catch{window.alert("请在 B 站播放界面点击该书签\n"+info)}})()

大柱
1°