aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/metastrings.php
diff options
context:
space:
mode:
authorBrett Profitt <brett.profitt@gmail.com>2012-05-10 20:09:15 -0700
committerBrett Profitt <brett.profitt@gmail.com>2012-05-10 20:09:15 -0700
commit1c810fd7d66e3b5121edeba1bf5bf7d118625931 (patch)
tree229814a5b3691b96fb62962ce6808f3e9285916d /engine/lib/metastrings.php
parent25b1a1ea11182b6fc195f4cca76ec4788d79c65e (diff)
downloadelgg-1c810fd7d66e3b5121edeba1bf5bf7d118625931.tar.gz
elgg-1c810fd7d66e3b5121edeba1bf5bf7d118625931.tar.bz2
Fixes #4512. Passing inc_offset only for deleting / disabling callbacks in metastring functions.
Diffstat (limited to 'engine/lib/metastrings.php')
-rw-r--r--engine/lib/metastrings.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/engine/lib/metastrings.php b/engine/lib/metastrings.php
index 0c858c9d3..cf6dd4d98 100644
--- a/engine/lib/metastrings.php
+++ b/engine/lib/metastrings.php
@@ -718,21 +718,21 @@ function elgg_set_metastring_based_object_enabled_by_id($id, $enabled, $type) {
*
* @warning This returns null on no ops.
*
- * @param array $options An options array. {@See elgg_get_metastring_based_objects()}
- * @param string $callback The callback to pass each result through
- * @return mixed
+ * @param array $options An options array. {@See elgg_get_metastring_based_objects()}
+ * @param string $callback The callback to pass each result through
+ * @param bool $inc_offset Increment the offset? Pass false for callbacks that delete / disable
+ *
+ * @return bool|null true on success, false on failure, null if no objects are found.
* @since 1.8.0
* @access private
*/
-function elgg_batch_metastring_based_objects(array $options, $callback) {
+function elgg_batch_metastring_based_objects(array $options, $callback, $inc_offset = true) {
if (!$options || !is_array($options)) {
return false;
}
- $batch = new ElggBatch('elgg_get_metastring_based_objects', $options, $callback, 50, false);
- $r = $batch->callbackResult;
-
- return $r;
+ $batch = new ElggBatch('elgg_get_metastring_based_objects', $options, $callback, 50, $inc_offset);
+ return $batch->callbackResult;
}
/**