Answers.Body: <p>PCPs don't have an API currently - but I just wrote one in about 15 minutes.  I didn't write unit tests, so I can't submit it upstream - maybe this is something you can help with to make CiviCRM better?</p>
  
  <p>Paste the contents of this file into "Pcp.php" in your <code>civicrm/api/v3</code> folder: <a href="http://pastebin.com/cvzqfq69">http://pastebin.com/cvzqfq69</a></p>
  
  <p>There's some odd line of hyphens at the bottom, leave that off!
  Next, in <code>civicrm/api/v3/util.php</code>, you should see a part that looks like:</p>
  
  <pre><code>  // FIXME: DAO names should follow CamelCase convention
    if ($name == 'Im' || $name == 'Acl') {
      $name = strtoupper($name);
    }
  </code></pre>
  
  <p>Change that "if" statement to:</p>
  
  <pre><code>  if ($name == 'Im' || $name == 'Acl' || $name == 'Pcp') {
  </code></pre>
  
  <p>That should get you a working PCP API!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-17T14:32:59.343Z
Answers.Text: Why not make a Pull Request for it.
Answers.UserDisplayName: Emeka Mbah
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-17T14:40:20.570Z
Answers.Text: APIs aren't accepted without a unit test - and I literally made this API in response to this question!  I can justify spending 15 minutes, but not several hours for writing tests.
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-17T14:48:16.447Z
Answers.Text: its all about giving back to the community :)
Answers.UserDisplayName: Emeka Mbah
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-17T14:52:36.053Z
Answers.Text: Agreed - but I spend several hours a week giving back to the community!  In fact, I wrote both the StatusPreference and Soft Credit APIs as a volunteer.  I have a running list of "community improvements", and unfortunately this isn't very near the top :)
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-05T01:57:02.837Z
Answers.LastActivityDate: 2015-06-05T01:57:02.837Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>I'm trying to write some plugins to incorporate PCPs (mainly lists of them) into my Wordpress sites. I did not see in the API explorer any coverage of PCPs. (I could be blind, please feel free to correct me.)</p>
  
  <p>I'd like to build a search feature, so that a visitor could search by multiple variables, like pcp owner name, or contribution campaign, etc. I'm also thinking of listing top fundraisers for a campaign.</p>
  
  <p>I think I could write something using mysql queries but was wondering if there is a better way to go about it.</p>
  
Tags: <civicontribute><api><pcp>
Title: Incoporating PCPs in Wordpress
ThreadText: # Incoporating PCPs in Wordpress
  
  (Asked by: username_0 on 2015-06-04)
  
  I'm trying to write some plugins to incorporate PCPs (mainly lists of them) into my Wordpress sites. I did not see in the API explorer any coverage of PCPs. (I could be blind, please feel free to correct me.)
  
  I'd like to build a search feature, so that a visitor could search by multiple variables, like pcp owner name, or contribution campaign, etc. I'm also thinking of listing top fundraisers for a campaign.
  
  I think I could write something using mysql queries but was wondering if there is a better way to go about it.
  
  **Tags:** civicontribute, api, pcp
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-06-05. Score: 7
  
  PCPs don't have an API currently - but I just wrote one in about 15 minutes.  I didn't write unit tests, so I can't submit it upstream - maybe this is something you can help with to make CiviCRM better?
  Paste the contents of this file into "Pcp.php" in your civicrm/api/v3 folder: http://pastebin.com/cvzqfq69
  There's some odd line of hyphens at the bottom, leave that off!
  Next, in civicrm/api/v3/util.php, you should see a part that looks like:
    // FIXME: DAO names should follow CamelCase convention
    if ($name == 'Im' || $name == 'Acl') {
      $name = strtoupper($name);
    }
  
  Change that "if" statement to:
    if ($name == 'Im' || $name == 'Acl' || $name == 'Pcp') {
  
  That should get you a working PCP API!
  
  > **Comments:**
  > **username_2**: Why not make a Pull Request for it.  
  > **username_1**: APIs aren't accepted without a unit test - and I literally made this API in response to this question!  I can justify spending 15 minutes, but not several hours for writing tests.  
  > **username_2**: its all about giving back to the community :)  
  > **username_1**: Agreed - but I spend several hours a week giving back to the community!  In fact, I wrote both the StatusPreference and Soft Credit APIs as a volunteer.  I have a running list of "community improvements", and unfortunately this isn't very near the top :)  
  
  ---
  
  