Skip to content

Commit

Permalink
WPCIVIUX-104 Add checkPermissions parameter to workaround buggy APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
agileware-fj committed Aug 1, 2021
1 parent 195b6f4 commit d6514f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions civicrm-ux.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin Name: WP CiviCRM UX
* Plugin URI: https://github.com/agileware/wp-civicrm-ux
* Description: A better user experience for integrating WordPress and CiviCRM
* Version: 1.6.1
* Version: 1.6.2
* Author: Agileware
* Author URI: https://agileware.com.au/
* License: GPL-2.0+
Expand All @@ -24,7 +24,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
define( 'CIVICRM_UXVERSION', '1.6.1' );
define( 'CIVICRM_UXVERSION', '1.6.2' );

// If this file is called directly, abort.
if ( ! defined( 'WPINC' ) ) {
Expand Down
6 changes: 5 additions & 1 deletion shortcodes/civicrm/api4-get.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public function shortcode_callback( $atts = [], $content = null, $tag = '' ) {
}
}

$params = [];
// default checkPermissions as FALSE, assume that security is handled by appropriate API usage.
$params = [ 'checkPermissions' => FALSE ];

// Interpret attributes as where clauses.
foreach( $atts as $k => $v ) {
Expand All @@ -49,6 +50,9 @@ public function shortcode_callback( $atts = [], $content = null, $tag = '' ) {
case 'offset':
$params[$k] = (int) $v;
break;
case 'checkPermissions':
$params[$k] = (bool) $v;
break;
case 'sort':
case 'orderby':
list($sort, $dir) = explode(':', $v, 2);
Expand Down

0 comments on commit d6514f8

Please sign in to comment.