Advertisement
arie_cristianD

allow other user to delete attachments

Feb 6th, 2024
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. /* allow other user to delete attachments */
  2.  
  3. add_action(
  4.     'init',
  5.     function () {
  6.         if ( class_exists( '\JNews_Frontend_Template' ) ) {
  7.             remove_action( 'delete_attachment', array( \JNews_Frontend_Template::getInstance(), 'disable_delete_attachment' ) );
  8.         }
  9.         if ( class_exists( '\JNEWS_VIDEO\Frontend\Frontend_Video_Endpoint' ) ) {
  10.             remove_action( 'delete_attachment', array( \JNEWS_VIDEO\Frontend\Frontend_Video_Endpoint::getInstance(), 'disable_delete_attachment' ) );
  11.         }
  12.  
  13.         if ( class_exists( '\JNEWS_VIDEO\Playlist\Playlist_Dashboard' ) ) {
  14.             remove_action( 'delete_attachment', array( \JNEWS_VIDEO\Playlist\Playlist_Dashboard::class, 'disable_delete_attachment' ) );
  15.         }
  16.         remove_action( 'delete_attachment', array( JNews\AccountPage::getInstance(), 'disable_delete_attachment' ) );
  17.     },
  18. );
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement