Title: ShortCode in PHP?
Last modified: August 19, 2016

---

# ShortCode in PHP?

 *  Resolved [trebtreb](https://wordpress.org/support/users/trebtreb/)
 * (@trebtreb)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/shortcode-in-php/)
 * Im trying to use the [easy-contact plugin](http://wordpress.org/extend/plugins/easy-contact/)
   in the footer of my wordPress blog.
 * But I can’t work out how to do it, as it only supports shortCode.
 * **What i’ve found in the plugin:**
 *     ```
       // Register the shortcode to the function ec_shortcode()
       add_shortcode( 'easy-contact', 'ec_shortcode' );
       ```
   
 * **Which must mean that [easy-contact] = ec_shortcode()**
 * If I add **ec_shortcode()** to my footer I get this error:
    `Warning: Missing
   argument 1 for ec_shortcode(),` So I check how the function looks cause im obviously
   not passing it the right variable:
 *     ```
       // Finds [easy-contact] shortcode and produces the form in the content
       function ec_shortcode($attr) {
       	global $ec_form_fields;
       	// If we're processing $POST data without a problem, let's send an email
       	if ( ec_check_input() ) {
       ...etc...
       ```
   
 * By the looks of it I need to do this **ec_shortcode($attr)**, but $attr isn’t
   mentioned any where else in the entire plugin…
    What is it? **What do i need 
   to send to this function?**

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

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/shortcode-in-php/#post-1163151)
 * you do realize this plugin is only compatible up to ver. 2.6.1?
 *  Thread Starter [trebtreb](https://wordpress.org/support/users/trebtreb/)
 * (@trebtreb)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/shortcode-in-php/#post-1163160)
 * I didn’t. The Short-Code still seems to work in a post though.
 *  Thread Starter [trebtreb](https://wordpress.org/support/users/trebtreb/)
 * (@trebtreb)
 * [16 years, 9 months ago](https://wordpress.org/support/topic/shortcode-in-php/#post-1163179)
 * I think i got it to work with this:
    `<?php echo ec_shortcode('') ?>`

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

The topic ‘ShortCode in PHP?’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [trebtreb](https://wordpress.org/support/users/trebtreb/)
 * Last activity: [16 years, 9 months ago](https://wordpress.org/support/topic/shortcode-in-php/#post-1163179)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
