Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Dana Skallman
CiviCRM Groups Sync
Commits
5124e01b
Commit
5124e01b
authored
Mar 06, 2019
by
Christian Wach
⚽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add methods to retrieve "Groups" group data with CiviCRM group IDs
parent
12715f66
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
includes/civicrm-groups-sync-wordpress.php
includes/civicrm-groups-sync-wordpress.php
+57
-0
No files found.
includes/civicrm-groups-sync-wordpress.php
View file @
5124e01b
...
@@ -373,6 +373,63 @@ class CiviCRM_Groups_Sync_WordPress {
...
@@ -373,6 +373,63 @@ class CiviCRM_Groups_Sync_WordPress {
/**
* Get a "Groups" group using a CiviCRM group ID.
*
* @since 0.1
*
* @param int $civicrm_group_id The ID of the CiviCRM group.
* @return array|bool $wp_group The "Groups" group data, or false on failure.
*/
public
function
group_get_by_civicrm_id
(
$civicrm_group_id
)
{
// Get the ID of the "Groups" group.
$wp_group_id
=
$this
->
plugin
->
civicrm
->
group_get_wp_id_by_civicrm_id
(
$civicrm_group_id
);
// Sanity check.
if
(
empty
(
$wp_group_id
)
)
{
return
false
;
}
// Get full group data.
$wp_group
=
Groups_Group
::
read
(
$wp_group_id
);
// --<
return
$wp_group
;
}
/**
* Get a "Groups" group ID using a CiviCRM group ID.
*
* @since 0.1
*
* @param int $civicrm_group_id The ID of the CiviCRM group.
* @return int|bool $group_id The "Groups" group ID, or false on failure.
*/
public
function
group_get_wp_id_by_civicrm_id
(
$civicrm_group_id
)
{
// Get the "Groups" group.
$wp_group
=
$this
->
group_get_by_civicrm_id
(
$civicrm_group_id
);
// Sanity check.
if
(
empty
(
$wp_group
)
)
{
return
false
;
}
// --<
return
$wp_group
[
'group_id'
];
}
//##########################################################################
/**
/**
* Filter the Add Group form.
* Filter the Add Group form.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment