Skip to content

Instantly share code, notes, and snippets.

View paulgibbs's full-sized avatar

Paul Wong-Gibbs paulgibbs

View GitHub Profile
diff --git a/src/bp-core/bp-core-caps.php b/src/bp-core/bp-core-caps.php
index 2ee08a9..a52c9a2 100644
--- a/src/bp-core/bp-core-caps.php
+++ b/src/bp-core/bp-core-caps.php
@@ -275,6 +275,54 @@ function bp_current_user_can( $capability, $args = array() ) {
}
/**
+ * Check whether the specified user has a given capability on a given site.
+ *
class BP_Core_BP_Options_Nav_BackCompat#451 (3) {
protected $parent_slug =>
string(0) ""
public $backcompat_nav =>
array(0) {
}
public $component =>
string(7) "members"
}
@paulgibbs
paulgibbs / bookmark.js
Created March 18, 2016 11:08
Google AMP bookmarklet
javascript:void((function(){var loc = location.href; loc.indexOf("?") == -1 ? (location.href = loc+"?amp=1#development=1") : (location.href = loc+"&amp=1#development=1");})());
<?php
add_action( 'bp_phpmailer_init', 'swpsmtp_init_smtp' );
diff --git a/src/bp-core/admin/bp-core-admin-tools.php b/src/bp-core/admin/bp-core-admin-tools.php
index 2dd0813..98e8183 100644
--- a/src/bp-core/admin/bp-core-admin-tools.php
+++ b/src/bp-core/admin/bp-core-admin-tools.php
@@ -451,6 +451,19 @@ function bp_admin_reinstall_emails() {
}
}
+ // Make sure we have no orphaned email type terms.
+ $email_types = get_terms( bp_get_email_tax_type(), array(
@paulgibbs
paulgibbs / -
Created October 21, 2015 16:30
diff --git a/tests/phpunit/testcases/core/avatars.php b/tests/phpunit/testcases/core/avatars.php
index 30c4524..328fd8b 100644
--- a/tests/phpunit/testcases/core/avatars.php
+++ b/tests/phpunit/testcases/core/avatars.php
@@ -81,19 +81,23 @@ class BP_Tests_Avatars extends BP_UnitTestCase {
public function test_bp_core_fetch_avatar_parameter_conservation() {
// First, run the check with custom parameters, specifying no gravatar.
$this->params = array(
- 'item_id' => 1406,
- 'object' => 'custom_object',
diff --git a/tests/phpunit/includes/factory.php b/tests/phpunit/includes/factory.php
index 2264e9f..540a5b8 100644
--- a/tests/phpunit/includes/factory.php
+++ b/tests/phpunit/includes/factory.php
@@ -13,6 +13,9 @@ class BP_UnitTest_Factory extends WP_UnitTest_Factory {
$this->xprofile_field = new BP_UnitTest_Factory_For_XProfileField( $this );
$this->notification = new BP_UnitTest_Factory_For_Notification( $this );
$this->signup = new BP_UnitTest_Factory_For_Signup( $this );
+
+ // WP_UnitTest_Factory_For_Attachment changed in WP 4.4
@paulgibbs
paulgibbs / -
Created September 16, 2015 13:17
{
"ub-main": {
"mappings": {
"post": {
"post_content": {
"full_name": "post_content",
"mapping": {
"post_content": {
"type": "string",
"term_vector": "yes"
@paulgibbs
paulgibbs / -
Created September 16, 2015 12:57
{
"ub-main": {
"mappings": {
"post": {
"post_content": {
"full_name": "post_content",
"mapping": {
"post_content": {
"type": "string"
}
Host gitserv
Hostname remote.server.com
IdentityFile ~/.ssh/PRIVATE_KEY_FILENAME
IdentitiesOnly yes