Skip to content

Instantly share code, notes, and snippets.

@dcavins
dcavins / comment-logic-nesting.diff
Created November 16, 2016 15:52
Fix for allowing competing comment access settings to coexist peaceably.
diff --git includes/templates/docs/single/comments.php includes/templates/docs/single/comments.php
index b11ff29..8b5d42d 100644
--- includes/templates/docs/single/comments.php
+++ includes/templates/docs/single/comments.php
@@ -21,35 +21,44 @@ foreach ( (array)$comments as $comment ) {
?>
-<?php if ( current_user_can( 'bp_docs_read_comments' ) ) : ?>
+<?php if ( current_user_can( 'bp_docs_read_comments' ) || current_user_can( 'bp_docs_post_comments' ) ) : ?>
@dcavins
dcavins / toggle-example.html
Created February 21, 2017 16:20
Example of toggled content structure on Community Commons
<div class="toggle-container toggle-closed">
<span class="arrow"></span><a href="https://www.communitycommons.org/cchelp/how-do-i-add-a-picture-to-my-member-profile/" class="toggle-trigger">This is probably the most common example of a toggle.</a>
<div class="toggle-content border-left">
<p>It includes the arrow toggle-state indicator and the content block gets the nice little left border and indent.</p>
<p>&hellip;</p>
</div>
</div>
@dcavins
dcavins / commons-tooltip-example.html
Last active February 21, 2017 16:34
Example HTML for setting up tooltips on Community Commons
<span class="add-tooltip" data-tooltip-text="Tooltip message to show">Target text</span>
<span class="icon-mime-type video"></span><a href="#video">Video</a>
@dcavins
dcavins / two-thirds-block-example.html
Last active February 21, 2017 16:35
Two-thirds-block structure example
<div class="content-row clear">
<div class="third-block spans-2">
Suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key, and Alice's first thought was that it might belong to one of the doors of the hall.
</div>
<div class="third-block">
Suddenly she came upon a little three-legged table, all made of solid glass; there was nothing on it except a tiny golden key.
</div>
</div>
@dcavins
dcavins / quarter-block-example.html
Last active February 21, 2017 16:35
Quarter-block structure example
<div class="content-row clear">
<div class="quarter-block">
Suddenly she came upon a little three-legged table...
</div>
<div class="quarter-block">
Suddenly she came upon a little three-legged table...
</div>
<div class="quarter-block">
Suddenly she came upon a little three-legged table...
</div>
@dcavins
dcavins / third-block-example.html
Last active February 21, 2017 16:35
Third-block structure example
<div class="content-row clear">
<div class="third-block">
Suddenly she came upon a little three-legged table...
</div>
<div class="third-block">
Suddenly she came upon a little three-legged table...
</div>
<div class="third-block">
Suddenly she came upon a little three-legged table...
</div>
@dcavins
dcavins / half-block-example.html
Last active February 21, 2017 16:36
Half-block structure example
<div class="content-row clear">
<div class="half-block">
Suddenly she came upon a little three-legged table...
</div>
<div class="half-block">
Suddenly she came upon a little three-legged table...
</div>
</div>
@dcavins
dcavins / test-bp-docs-delete-cb.php
Last active March 16, 2017 15:38
A testing function for seeing where a BP Docs delete is going wrong.
<?php
// Remove the default
remove_action( 'bp_actions', 'bp_docs_process_folder_delete_cb' );
// Add the troubleshooting version
add_action( 'bp_actions', 'my_tshoot_bp_docs_process_folder_delete_cb' );
/**
* Catch a request to delete a folder.
*
* @since 1.9.0
@dcavins
dcavins / one-third-columns-med-break.html
Last active September 22, 2017 16:55
Three column layout that breaks to a single column on medium-width screens and smaller.
<div class="Grid Grid--guttersLg Grid--full med-Grid--fit">
<div class="Grid-cell">
1/3
</div>
<div class="Grid-cell">
1/3
</div>
<div class="Grid-cell">
1/3
</div>