Title: [Plugin: Attachments] remove warning in WP debug mode
Last modified: August 19, 2016

---

# [Plugin: Attachments] remove warning in WP debug mode

 *  [Mad Max](https://wordpress.org/support/users/mad_max/)
 * (@mad_max)
 * [15 years ago](https://wordpress.org/support/topic/plugin-attachments-remove-warning-in-wp-debug-mode/)
 * Hi Jchristopher and thanks for this useful plugin. I’ve switched to debug mode
   on a WP project of mine that makes use of your plugin and found a warning about
   WP_ADMIN constant not defined on line 40 of attachments.php
 * I’ve corrected
 * `if( WP_ADMIN )`
 * to
 * `if( defined( 'WP_ADMIN' ) )`
 * Please update your code before releasing a new version.
    Thanks, Mad Max.
 * [http://wordpress.org/extend/plugins/attachments/](http://wordpress.org/extend/plugins/attachments/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [holden321](https://wordpress.org/support/users/holden321/)
 * (@holden321)
 * [15 years ago](https://wordpress.org/support/topic/plugin-attachments-remove-warning-in-wp-debug-mode/#post-2060581)
 * how about warning
    **Notice:** has_cap was called with an argument that is **
   deprecated** since version 2.0! Usage of user levels by plugins and themes is
   deprecated. Use roles and capabilities instead. in ..\wp-includes\functions.php
   on line **3387**
 *  [holden321](https://wordpress.org/support/users/holden321/)
 * (@holden321)
 * [15 years ago](https://wordpress.org/support/topic/plugin-attachments-remove-warning-in-wp-debug-mode/#post-2060582)
 * I noticed that when string #108 of
    plugins/attachments/attachments.php is removed,
   then the notice disappears
 * **add_options_page(‘Settings’, ‘Attachments’, 8, __FILE__, ‘attachments_options’);**
 * but there is no options on the options’ page of the plugin
    so maybe it’s nothing
   wrong to remove this string
 *  [holden321](https://wordpress.org/support/users/holden321/)
 * (@holden321)
 * [15 years ago](https://wordpress.org/support/topic/plugin-attachments-remove-warning-in-wp-debug-mode/#post-2060584)
 * changing
    8 to ‘administrator’ fixed the problem 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘[Plugin: Attachments] remove warning in WP debug mode’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/attachments_fafafa.svg)
 * [Attachments](https://wordpress.org/plugins/attachments/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/attachments/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/attachments/)
 * [Active Topics](https://wordpress.org/support/plugin/attachments/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/attachments/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/attachments/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [holden321](https://wordpress.org/support/users/holden321/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/plugin-attachments-remove-warning-in-wp-debug-mode/#post-2060584)
 * Status: not resolved