Title: PHP Warning message
Last modified: March 20, 2019

---

# PHP Warning message

 *  [sbaron](https://wordpress.org/support/users/sbaron/)
 * (@sbaron)
 * [7 years ago](https://wordpress.org/support/topic/php-warning-message-6/)
 * First off I am not very good at programming (rudimentary at best) I learn by 
   taking snippets of code and piece them together watch the errors and then try
   to figure out how to resolve them. My latest attempt seems to be getting the 
   best of me however as I can not seem to understand where I am running astray.
 * The error I am receiving is:
    PHP Warning: Use of undefined constant plugins_url–
   assumed ‘plugins_url’ (this will throw an Error in a future version of PHP)
 * It seems line #18 (the last IF statement) is where I am going wrong. I am hoping
   someone can show me the corrected syntax and provide a simplistic explanation
   so I can hopefully understand it.
 * The code I am attempting to use:
 *     ```
       <?php
   
       if ( ! defined( 'WP_CONTENT_URL' ) )
           define( 'WP_CONTENT_URL', get_option( 'siteurl' ) . '/wp-content' );
   
       if ( ! defined( 'WP_CONTENT_DIR' ) )
           define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
   
       if ( ! defined( 'WP_PLUGIN_URL' ) )
           define( 'WP_PLUGIN_URL', WP_CONTENT_URL. '/plugins' );
   
       if ( ! defined( 'WP_PLUGIN_DIR' ) )
           define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' );
   
       if ( ! function_exists(plugins_url) ) {
       	function plugins_url($location) {
       		return WP_PLUGIN_DIR.$location;
       	}
       }
       ```
   
 * Thanx in advanced…

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

 *  [Dion](https://wordpress.org/support/users/diondesigns/)
 * (@diondesigns)
 * [7 years ago](https://wordpress.org/support/topic/php-warning-message-6/#post-11333122)
 * The first line of your code should be this:
 * `if ( !function_exists('plugins_url') ) {`
 * The function name must be enclosed with single quotes.
 *  Thread Starter [sbaron](https://wordpress.org/support/users/sbaron/)
 * (@sbaron)
 * [7 years ago](https://wordpress.org/support/topic/php-warning-message-6/#post-11335445)
 * I can’t believe I missed that… Thank you!

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

The topic ‘PHP Warning message’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [sbaron](https://wordpress.org/support/users/sbaron/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/php-warning-message-6/#post-11335445)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
