query_vars['attachment_id']) || ! empty($wp_query->query_vars['attachment']); } function awp_administrator_roles() { // WP roles containing the 'activate plugins' capability are always honored regardless of object or term restritions global $wp_roles; $admin_roles = array(); if ( isset($wp_roles->roles) ) { $admin_cap_name = ( defined( 'SCOPER_CONTENT_ADMIN_CAP' ) ) ? constant( 'SCOPER_CONTENT_ADMIN_CAP' ) : 'activate_plugins'; foreach (array_keys($wp_roles->roles) as $wp_role_name) if ( ! empty($wp_roles->roles[$wp_role_name]['capabilities']) ) if ( array_intersect_key($wp_roles->roles[$wp_role_name]['capabilities'], array($admin_cap_name => 1) ) ) { $role_handle = scoper_get_role_handle( $wp_role_name, 'wp' ); $admin_roles = array_merge($admin_roles, array($role_handle => $wp_role_name) ); } } return $admin_roles; } function awp_mail( $address, $title, $message ) { $blog_name = get_option( 'blogname' ); $admin_email = get_option( 'admin_email' ); $headers = 'From: ' . $blog_name . ' <' . $admin_email . '>' . "\r\n"; $headers .= 'Reply-To: ' . $blog_name . ' <'. $admin_email . '>' . "\r\n"; $headers .= 'Return-Path: ' . $blog_name . ' <'. $admin_email . '>' . "\r\n"; if ( defined( 'RS_DEBUG' ) ) { //$log = "$title
to $address
$message

"; //rs_errlog( $log ); //return; wp_mail( $address, $title, $message, $headers ); } else @wp_mail( $address, $title, $message, $headers ); } ?>