小编Dan*_*ves的帖子

使用Cropper js 裁剪后图像质量降低

我克服了很多解决方案和建议,但对我没有任何作用。我正在使用 dropzone 进行图像上传和cropper js 来裁剪图像。但是每次裁剪图像后,图像质量都会降低(模糊)

实际图像

https://i.stack.imgur.com/UsVqz.jpg

裁剪图像
https://i.stack.imgur.com/snAuB.png

   //This is my cropper js code, As per the documentation I have set max height, max width, imageSmoothingQuality etc. But still image qualty get reduced after crop.
   var $cropperModal = $("<div>Company Logo</div>");
   $cropperModal.modal('show').on("shown.bs.modal", function() {
     var $image = $('#img-' + c);
     var cropper = $image.cropper({
       aspectRatio: 1//,
     }).on('hidden.bs.modal', function() {
       $image.cropper('destroy');
     });

     //After I uploaded the image, Below code allow me to crop the image

     $cropperModal.on('click', '.crop-upload', function() {
       $image.cropper('getCroppedCanvas', { …
Run Code Online (Sandbox Code Playgroud)

javascript jquery ruby-on-rails cropperjs

2
推荐指数
1
解决办法
3594
查看次数

如何为 wp 中的某些用户隐藏特定页面(来自 wp-admin)?

我的形象

在此处输入图片说明

我只是想为某些用户隐藏特定页面。

function remove_menus(){
    // get current login user's role
    $roles = wp_get_current_user()->roles;
    // test role
    if( in_array('administrator',$roles)){
        remove_menu_page( 'edit-comments.php' ); //Posts
        remove_menu_page( 'tools.php' );
        remove_menu_page('edit.php');
        remove_menu_page('wpcf7');
    }
     
    }
    add_action( 'admin_menu', 'remove_menus' , 100 );
Run Code Online (Sandbox Code Playgroud)

这是我现在尝试过的,并且在所有页面上都可以正常工作。

我的问题是我不想显示主页 - 首页(请看我的图片)如果登录用户不是管理员。而且我想隐藏添加新的

php wordpress wordpress-theming custom-wordpress-pages wordpress-admin

1
推荐指数
1
解决办法
1699
查看次数