Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
/** Give User Role Editor to Access All Media */ function give_user_role_editor_to_access_all_media() { /* Check if user is editor role or not */ if ( in_array( 'editor', (array) wp_get_current_user()->roles ) && ! current_user_can( 'manage_options' ) ) { /* For Show ALl Media in Grid View */ add_filter( 'ajax_query_attachments_args', 'show_all_media_for_editor_child', 99 ); /** Grid View */ function show_all_media_for_editor_child( $query ) { $query['author'] = ''; return $query; } /* For Show ALl Media in List View */ remove_action( 'pre_get_posts', array( JNews\AccountPage::getInstance(), 'users_own_attachments' ) ); } } add_action( 'init', 'give_user_role_editor_to_access_all_media' );
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)