Warning: Declaration of relatedpostsCPWidget::update($new_instance) should be compatible with WP_Widget::update($new_instance, $old_instance) in /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 649

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 666

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 673

Warning: Cannot modify header information - headers already sent by (output started at /home/nrtechweb/public_html/wp-content/plugins/related-post-widget-side/related-post-widget-side.php:53) in /home/nrtechweb/public_html/wp-content/plugins/cleantalk-spam-protect/cleantalk.php on line 679
Control wp media files by specific user - NR Tech Web Solution | NR Tech Web Solution

Blog

Control wp media files by specific user

As my previous post , i explained  how to use WordPress media file uploader. with this script you can WordPress media uploader manager as per your requirement but in that  post you can not control the files by specific users.

Now we can control WordPress media file manager and images and files by user specific.For that we have to use hook up the pre_post_query  that  is action that filter WP Query Object.We have to just pass current logged in user’s ID in WP Query set. Copy and paste this script into your theme’s functions.php.

 

Note : This hook every where apply when a user is logged in means it will effect for wp query and this wp query used by post query , search query, fetch media files.So please use  page screen condition for this Hook.

Leave a Reply

Your email address will not be published. Required fields are marked *

Security *