Title: plugin function call onClick
Last modified: August 19, 2016

---

# plugin function call onClick

 *  [liamgoldstein](https://wordpress.org/support/users/liamgoldstein/)
 * (@liamgoldstein)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-function-call-onclick/)
 * Hey.
 * I’ve been having a go at creating a custom plugin (simplified code below).
 * I have my plugin file (counter.php) which has 2 function in it called
 *     ```
       displayCount() {
           // output count and a link to add 1
           echo '<a href="XXX">Add One</a>';
       }
       ```
   
 * AND
 *     ```
       addOne() {
           $count = $count + 1;
       }
       ```
   
 * My question is what to I replace XXX with or how do I call addOne function from
   my post page?
 * Thanks

The topic ‘plugin function call onClick’ is closed to new replies.

## Tags

 * [call](https://wordpress.org/support/topic-tag/call/)
 * [function](https://wordpress.org/support/topic-tag/function/)
 * [onclick](https://wordpress.org/support/topic-tag/onclick/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [liamgoldstein](https://wordpress.org/support/users/liamgoldstein/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-function-call-onclick/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
