This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git bp-docs.php bp-docs.php | |
index ac74242..e21e733 100644 | |
--- bp-docs.php | |
+++ bp-docs.php | |
@@ -215,6 +215,10 @@ class BP_Docs { | |
// The slug used when deleting a doc | |
if ( !defined( 'BP_DOCS_UNTRASH_SLUG' ) ) | |
define( 'BP_DOCS_UNTRASH_SLUG', 'untrash' ); | |
+ | |
+ // The slug used when removing a doc from a group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git bp-docs.php bp-docs.php | |
index ac74242..e21e733 100644 | |
--- bp-docs.php | |
+++ bp-docs.php | |
@@ -215,6 +215,10 @@ class BP_Docs { | |
// The slug used when deleting a doc | |
if ( !defined( 'BP_DOCS_UNTRASH_SLUG' ) ) | |
define( 'BP_DOCS_UNTRASH_SLUG', 'untrash' ); | |
+ | |
+ // The slug used when removing a doc from a group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git tests/test-permissions.php tests/test-permissions.php | |
index a8f766f..9b44cad 100644 | |
--- tests/test-permissions.php | |
+++ tests/test-permissions.php | |
@@ -42,7 +42,7 @@ class BP_Docs_Tests_Permissions extends BP_Docs_TestCase { | |
* @group map_meta_cap | |
*/ | |
public function test_loggedin_user_can_bp_docs_create() { | |
- $u = $this->create_user(); | |
+ $u = $this->factory->user->create(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('posts_search', 'what_the_search', $priority = 10, $accepted_args = 2); | |
function what_the_search( $search, $query ){ | |
if ( $query->is_search ) { | |
$towrite = PHP_EOL . '$search: ' . print_r( $search, TRUE ); | |
// $search looks like: | |
// AND (((wp_posts.post_title LIKE '%walking%') OR (wp_posts.post_content LIKE '%walking%'))) AND (wp_posts.post_password = '') | |
$fp = fopen('what_the_search.txt', 'a'); | |
fwrite($fp, $towrite); | |
fclose($fp); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'groups_group_after_save', 'bp_45123590' ); | |
function bp_45123590( $group_args ) { | |
$towrite = PHP_EOL . 'newly created group args: ' . print_r( $group_args, TRUE ); | |
$fp = fopen('groups_group_after_save_args.txt', 'a'); | |
fwrite($fp, $towrite); | |
fclose($fp); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function bp_docs_upgrade_script_1_9() { | |
global $wpdb; | |
$bp = buddypress(); | |
// Clean the meta_values that got grossed up in BP 2.0 | |
$wpdb->update( $bp->groups->table_name_groupmeta, | |
array( 'meta_key' => 'bp-docs' ), | |
array( 'meta_key' => 'bpdocs' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Utility filter to see what's attached to a filter: | |
function dc_wp_show_hooked_filters() { | |
// Set the hook name you're checking out here. | |
$hook_name = 'pre_get_posts'; | |
global $wp_filter; | |
echo '<pre class="filter-dump">'; | |
var_dump( $wp_filter[$hook_name] ); | |
echo '</pre>'; | |
} | |
add_action( 'wp_head', 'dc_wp_show_hooked_filters' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dc_wp_show_hooked_filters(){ | |
global $wp_filter; | |
$filter_name = 'bp_core_fetch_avatar_no_grav'; | |
echo '<pre class="filter-dump">'; | |
var_dump( $wp_filter[$filter_name] ); | |
echo '</pre>'; | |
} | |
add_action( 'wp_head', 'dc_wp_show_hooked_filters' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( bp_docs_enable_folders() ) { | |
echo PHP_EOL . "Folders are enabled generally."; | |
} else { | |
echo PHP_EOL . "Folders are disabled generally."; | |
} | |
if ( bp_docs_enable_folders_for_current_context() ) { | |
echo PHP_EOL . "Folders are enabled for current context."; | |
} else { |
OlderNewer