Advertisement
Guest User

Accept Restrictions Automatically

a guest
May 27th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. if ( class_exists( 'Autoremove_Attachments' ) ) {
  2.     function autoremove_attachments_accept_restrictions() {
  3.         $autoremove_attachments = get_option( 'autoremove_attachments' );
  4.  
  5.         if ( ! isset( $autoremove_attachments['usage-restrictions'] ) || ( isset( $autoremove_attachments['usage-restrictions'] ) && $autoremove_attachments['usage-restrictions'] != 'accept' ) ) {
  6.             $autoremove_attachments['usage-restrictions'] = 'accept';
  7.             update_option( 'autoremove_attachments', $autoremove_attachments );
  8.         }
  9.     }
  10.     add_action( 'admin_init', 'autoremove_attachments_accept_restrictions' );
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement