Categories
Web

Hide Pages from WordPress Dashboard Editor View by User Capability

I’m building a multi-user WordPress environment where users are grouped by specific privileges, primarily concerning access to the dashboard. The goal is to restrict users from editing pages they shouldn’t touch.

While role and capability plugins like Members handle permissions well, they don’t allow fine-grained control over which pages appear in the dashboard. Most available plugins focus on hiding posts/pages from the public site, and those few that affect the backend – like Manage Your Posts – are limited to showing only an author’s own posts, which doesn’t apply when editors need access to others’ content.

function edit_page_per_capability($query) {
if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit-pages.php' ) !== false ) {
   if (current_user_can('organizer')) {
      $query->set('post__in', array(184,186) );
   }
   elseif ( current_user_can( 'instructor' ) ) {
      $query->set('page_id', '186');
   }
   elseif ( current_user_can( 'office' ) ) {
      $query->set('page_id', '8');
   }
}
}
add_filter('pre_get_posts','edit_page_per_capability');

By modifying the core function from Manage Your Posts, I created a filter that limits the Pages list in the dashboard to only those allowed for each user group. Capabilities are still managed via Members, and the filtering uses page IDs mapped to each group’s permissions.

To make this work with WordPress 3.0+, update the admin URL to /wp-admin/edit.php?post_type=page. For better readability, consider using query_posts() with slugs instead of numeric IDs.

To implement, drop the code into your theme’s functions.php file and tailor it to your access structure.

Categories
Music

Music Composition for a Promotional Video

The piece was composed for a promotional video I also sound designed, promoting a wooden stair design and construction company; wooden instruments were chosen to reflect the company’s craft in the melody.

Categories
Art

Ambient Music Piece Controlled by Light

Laterna Magica Light to Sound PerformanceThe ambient piece served as the musical introduction to a discussion titled My Body and I – Synchronic Image, Vision and Sound, featuring photographer Victoria Schultz, psychoanalyst Heikki Majava, and myself as sound explorer. Using two light-dependent resistors housed in handheld enclosures, I controlled the pitches by moving through light and shadow within the Laterna Magica gallery, where Victoria’s photos were exhibited.

The light-responsive audio device, connected to a laptop running modular sound software, transformed oscillator pitches into synthesizer control messages, blending textured and solo sounds to bridge visual and auditory media in the performance.

 

Categories
Visual

High-Resolution Nature Desktop Backgrounds

Dew in the morning

Sun in the morning

Categories
Visual

Poster for a Humanitarian Campaign

Poverty is in your handsPoverty is in your hands

We all influence the flow of giving and sharing. When this flow breaks, those at the bottom suffer first.

Power lies with each of us. You should be free to use it as you wish. So why can’t we give from what we have? Is it because we feel too poor, are selfish, or barely survive ourselves?

Yet, so much is wasted. Those at the bottom often live off this waste. Balancing the flow means less waste, more giving, and a better life for all.

Poverty affects everyone, not just the poor. Its existence means we are all impoverished. The true wealth belongs to those who give.

This poster calls for action and reflects today’s harsh reality — but there is hope.

Visit the campaign website and, if you have Facebook, vote (like) this image in the competition album until August 31st.