We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用 WordPress 的朋友应该都清楚,特别是喜欢图文并茂的网站,肯定离不开的就是 WordPress 文章编辑页面的“添加媒体”按钮,每次点击就能弹出一个插入多媒体的界面,然后页面默认就会列举加载所有最近的媒体库上传的文件,从而文件过多过大的请求下载,就可能造成页面的卡顿或假死,同时也会造成服务器带宽资源的浪费,严重影响网站内容的编辑和效率。
代码部分
//WordPress “添加媒体”文件时只显示上传到当前文章的附件 //add_action( 'wp_footer', 'fanly_mediapanel_lock_uploaded' );//让前台编辑器也生效 add_action( 'admin_footer-post-new.php', 'fanly_mediapanel_lock_uploaded' ); add_action( 'admin_footer-post.php', 'fanly_mediapanel_lock_uploaded' ); function fanly_mediapanel_lock_uploaded() { echo '<script type="text/javascript">var $i=0;jQuery(document).on("DOMNodeInserted", function(){if(jQuery("#media-attachment-filters").length>0&&$i==0){jQuery('select.attachment-filters [value="uploaded"]').attr('selected',true).parent().trigger('change');$i++;}});</script>'; }
The text was updated successfully, but these errors were encountered:
收到,我这里看一下。
Sorry, something went wrong.
功能已经添加了,下个版本更新即可。
feat: add image filter (#476)
4f88aa3
No branches or pull requests
使用 WordPress 的朋友应该都清楚,特别是喜欢图文并茂的网站,肯定离不开的就是 WordPress 文章编辑页面的“添加媒体”按钮,每次点击就能弹出一个插入多媒体的界面,然后页面默认就会列举加载所有最近的媒体库上传的文件,从而文件过多过大的请求下载,就可能造成页面的卡顿或假死,同时也会造成服务器带宽资源的浪费,严重影响网站内容的编辑和效率。
代码部分
//WordPress “添加媒体”文件时只显示上传到当前文章的附件
//add_action( 'wp_footer', 'fanly_mediapanel_lock_uploaded' );//让前台编辑器也生效
add_action( 'admin_footer-post-new.php', 'fanly_mediapanel_lock_uploaded' );
add_action( 'admin_footer-post.php', 'fanly_mediapanel_lock_uploaded' );
function fanly_mediapanel_lock_uploaded() {
echo '<script type="text/javascript">var $i=0;jQuery(document).on("DOMNodeInserted", function(){if(jQuery("#media-attachment-filters").length>0&&$i==0){jQuery('select.attachment-filters [value="uploaded"]').attr('selected',true).parent().trigger('change');$i++;}});</script>';
}
The text was updated successfully, but these errors were encountered: