Title: added function not working
Last modified: August 30, 2016

---

# added function not working

 *  [andy3000](https://wordpress.org/support/users/andy3000/)
 * (@andy3000)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/added-function-not-working/)
 * I added a function to functions.php to stop non admins from deleting media(after
   allowing uploads with ‘role capablities’. For some reason it is not working. (
   I also tried adding it in core.init.php, I’m confused by how both these files
   require each other) Here is the functions file:
 *     ```
       <?php
       /*
   
       	THEME INITIALIZATION
   
       	This file loads the core framework for Platform which handles everything. 
   
       	This theme copyright (C) 2008-2010 PageLines
   
       */
   
       require_once(TEMPLATEPATH . "/includes/core.init.php");
       add_action('media_row_actions','users_own_attachments', 2, 1);
       function users_own_attachments( $wp_query_obj ) {
           if( !current_user_can( 'delete_plugins' ) ){
               unset($wp_query_obj['delete']);
               return $wp_query_obj;
           }
       }
       ```
   

The topic ‘added function not working’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/pagelines/1.4.6/screenshot.png)
 * PageLines
 * [Support Threads](https://wordpress.org/support/theme/pagelines/)
 * [Active Topics](https://wordpress.org/support/theme/pagelines/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/pagelines/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/pagelines/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [andy3000](https://wordpress.org/support/users/andy3000/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/added-function-not-working/)
 * Status: not resolved