From 2dad2b26a4e0a1b59ba0720d6e843554487d7b35 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Sun, 14 Sep 2014 23:37:41 -0400 Subject: [PATCH] api/explorer - Add support for andyw's wp-cli integration (See also: https://github.com/civicrm/civicrm-wordpress/pull/55 ) --- templates/CRM/Admin/Page/APIExplorer.js | 4 +++- templates/CRM/Admin/Page/APIExplorer.tpl | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Admin/Page/APIExplorer.js b/templates/CRM/Admin/Page/APIExplorer.js index 3f9942f0f4..7f2ec390bf 100644 --- a/templates/CRM/Admin/Page/APIExplorer.js +++ b/templates/CRM/Admin/Page/APIExplorer.js @@ -327,7 +327,8 @@ smarty: "{crmAPI var='result' entity='" + entity + "' action='" + action + "'", php: "$result = civicrm_api3('" + entity + "', '" + action + "'", json: "CRM.api3('" + entity + "', '" + action + "'", - drush: "drush civicrm-api " + entity + '.' + action + ' ', + drush: "drush cvapi " + entity + '.' + action + ' ', + wpcli: "wp cv api " + entity + '.' + action + ' ', rest: CRM.config.resourceBase + "extern/rest.php?entity=" + entity + "&action=" + action + "&json=" + JSON.stringify(params) + "&api_key=yoursitekey&key=yourkey" }; smartyStub = false; @@ -343,6 +344,7 @@ q.json += " \"" + key + '": ' + js; q.smarty += ' ' + key + '=' + smartyFormat(js, key); q.drush += key + '=' + js + ' '; + q.wpcli += key + '=' + js + ' '; }); if (i) { q.php += ")"; diff --git a/templates/CRM/Admin/Page/APIExplorer.tpl b/templates/CRM/Admin/Page/APIExplorer.tpl index d6c3da8d16..6fbf0306d6 100644 --- a/templates/CRM/Admin/Page/APIExplorer.tpl +++ b/templates/CRM/Admin/Page/APIExplorer.tpl @@ -131,6 +131,9 @@ {if $config->userSystem->is_drupal} Drush

       {/if}
+      {if $config->userSystem->is_wordpress}
+        WP-CLI

+      {/if}
     
   
   
-- 
2.25.1