• 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.