[wp-meta] [Making WordPress.org] #7037: Image upload issue on support comment box

Making WordPress.org noreply at wordpress.org
Wed Jun 7 09:23:49 UTC 2023


#7037: Image upload issue on support comment box
----------------------------+---------------------
 Reporter:  sumitsingh      |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:
Component:  Support Forums  |  Resolution:
 Keywords:                  |
----------------------------+---------------------

Comment (by sumitsingh):

 May be below the solution for disabling images for subscriber users?

 {{{#!php
 <?php
 function restrict_comment_block_types($allowed_block_types, $post) {
     // Check if a user is a subscriber
     if (current_user_can('subscriber')) {
         // Remove the "Image" block from the allowed block types
         $disallowed_blocks = array('core/image');
         $allowed_block_types = array_diff($allowed_block_types,
 $disallowed_blocks);
     }

     return $allowed_block_types;
 }
 add_filter('allowed_block_types', 'restrict_comment_block_types', 10, 2);

 }}}

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/7037#comment:3>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list