This file contains hidden or 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
<!-- Checkbox inputs, before changes --> | |
<div class="editfield field_2 field_core-makeup optional-field visibility-public alt field_type_checkbox"> | |
<div class="checkbox"> | |
<label for="field_2">Core makeup</label> | |
<label for="field_11_0"><input name="field_2[]" id="field_11_0" value="Goat" type="checkbox">Goat</label> | |
<label for="field_12_1"><input name="field_2[]" id="field_12_1" value="Rhinoceros" type="checkbox">Rhinoceros</label> | |
<label for="field_13_2"><input name="field_2[]" id="field_13_2" value="Slow Loris" type="checkbox">Slow Loris</label> | |
</div> | |
</div> |
This file contains hidden or 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 { |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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(); |