Commit 520ad6e9 authored by lechuck's avatar lechuck Committed by lucha

Upgraded Buddypress to 2.2.3

parent c912100c
......@@ -78,3 +78,9 @@
.column-action {
width: 12%;
}
@media screen and (max-width: 782px) {
body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
display: table-cell;
}
}
\ No newline at end of file
.akismet-status{float:left}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
.akismet-status{float:left}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:left;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:right;margin-left:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-right:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
\ No newline at end of file
......@@ -78,3 +78,9 @@
.column-action {
width: 12%;
}
@media screen and (max-width: 782px) {
body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column) {
display: table-cell;
}
}
\ No newline at end of file
.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}
\ No newline at end of file
.akismet-status{float:right}.akismet-status a{color:#AAA;font-style:italic}.akismet-history{margin:13px}.akismet-history div{margin-bottom:13px}.akismet-history span{color:#999}#wp-bp-activities-wrap{padding:5px 0}#bp-activities{height:120px}#bp-replyhead{font-size:1em;line-height:1.4em;margin:0}#bp-replysubmit{margin:0;padding:0 0 3px;text-align:center}#bp-replysubmit .error{color:red;line-height:21px;text-align:center;vertical-align:center}#bp-replysubmit img.waiting{float:right;padding:4px 10px 0;vertical-align:top}#bp-activities-form .column-response img{float:left;margin-right:10px;margin-top:1px}.activity-errors{list-style-type:disc;margin-left:2em}#bp_activity_action div.inside,#bp_activity_content div.inside{line-height:0}#bp_activity_action h3,#bp_activity_content h3{cursor:auto}#bp_activity_action td.mceIframeContainer,#bp_activity_content td.mceIframeContainer{background-color:#fff}#post-body #bp-activities-action_resize,#post-body #bp-activities-content_resize{position:inherit;margin-top:-2px}#bp_activity_link input{width:99%}#bp-activities-primaryid{margin-bottom:1em}.column-action{width:12%}@media screen and (max-width:782px){body.toplevel_page_bp-activity .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.check-column){display:table-cell}}
\ No newline at end of file
/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
/*! buddypress - v2.3.3 - 2015-08-27 5:14:25 PM UTC - https://wordpress.org/plugins/buddypress/ */
!function(a){var b={init:function(){a(document).on("click",".row-actions a.reply",b.open),a(document).on("click","#bp-activities-container a.cancel",b.close),a(document).on("click","#bp-activities-container a.save",b.send),a(document).on("keyup","#bp-activities:visible",function(a){27===a.which&&b.close()})},open:function(){var b=a("#bp-activities-container").hide();return a(this).parents("tr").after(b),b.fadeIn("300"),a("#bp-activities").focus(),!1},close:function(){return a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide()}),!1},send:function(){a("#bp-replysubmit .error").hide(),a("#bp-replysubmit .waiting").show();var c={};return c["_ajax_nonce-bp-activity-admin-reply"]=a('#bp-activities-container input[name="_ajax_nonce-bp-activity-admin-reply"]').val(),c.action="bp-activity-admin-reply",c.content=a("#bp-activities").val(),c.parent_id=a("#bp-activities-container").prev().data("parent_id"),c.root_id=a("#bp-activities-container").prev().data("root_id"),a.ajax({data:c,type:"POST",url:ajaxurl,error:function(a){b.error(a)},success:function(a){b.show(a)}}),!1},error:function(b){var c=b.statusText;a("#bp-replysubmit .waiting").hide(),b.responseText&&(c=b.responseText.replace(/<.[^<>]*?>/g,"")),c&&a("#bp-replysubmit .error").html(c).show()},show:function(c){var d,e,f;return"string"==typeof c?(b.error({responseText:c}),!1):(f=wpAjax.parseAjaxResponse(c),f.errors?(b.error({responseText:wpAjax.broken}),!1):(f=f.responses[0],void a("#bp-activities-container").fadeOut("200",function(){a("#bp-activities").val("").blur(),a("#bp-replysubmit .error").html("").hide(),a("#bp-replysubmit .waiting").hide(),a("#bp-activities-container").before(f.data),e=a("#activity-"+f.id),d=e.closest(".widefat").css("backgroundColor"),e.animate({backgroundColor:"#CEB"},300).animate({backgroundColor:d},300)})))}};a(document).ready(function(){b.init(),a("#bp_activity_action h3, #bp_activity_content h3").unbind("click"),"undefined"!=typeof postboxes&&postboxes.add_postbox_toggles(bp_activity_admin_vars.page)})}(jQuery);
\ No newline at end of file
......@@ -1197,6 +1197,7 @@ class BP_Activity_List_Table extends WP_List_Table {
$this->get_columns(),
array(),
$this->get_sortable_columns(),
$this->get_default_primary_column_name(),
);
return $this->_column_headers;
......@@ -1219,7 +1220,7 @@ class BP_Activity_List_Table extends WP_List_Table {
function display() {
$this->display_tablenav( 'top' ); ?>
<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
<table class="wp-list-table <?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0">
<thead>
<tr>
<?php $this->print_column_headers(); ?>
......@@ -1411,6 +1412,37 @@ class BP_Activity_List_Table extends WP_List_Table {
<?php
}
/**
* Override WP_List_Table::row_actions().
*
* Basically a duplicate of the row_actions() method, but removes the
* unnecessary <button> addition.
*
* @since 2.3.3
* @access protected
*
* @param array $actions The list of actions
* @param bool $always_visible Whether the actions should be always visible
* @return string
*/
protected function row_actions( $actions, $always_visible = false ) {
$action_count = count( $actions );
$i = 0;
if ( !$action_count )
return '';
$out = '<div class="' . ( $always_visible ? 'row-actions visible' : 'row-actions' ) . '">';
foreach ( $actions as $action => $link ) {
++$i;
( $i == $action_count ) ? $sep = '' : $sep = ' | ';
$out .= "<span class='$action'>$link$sep</span>";
}
$out .= '</div>';
return $out;
}
/**
* Checkbox column markup.
*
......@@ -1730,4 +1762,16 @@ class BP_Activity_List_Table extends WP_List_Table {
return $tree;
}
/**
* Get name of default primary column
*
* @since BuddyPress (2.3.3)
* @access protected
*
* @return string
*/
protected function get_default_primary_column_name() {
return 'author';
}
}
......@@ -41,6 +41,9 @@ function bp_activity_mentions_script() {
wp_style_add_data( 'bp-mentions-css', 'suffix', $min );
}
// If the script has been enqueued, let's attach our mentions TinyMCE init callback.
add_filter( 'tiny_mce_before_init', 'bp_add_mentions_on_tinymce_init', 10, 2 );
/**
* Fires at the end of the Activity Mentions script.
*
......@@ -53,3 +56,22 @@ function bp_activity_mentions_script() {
}
add_action( 'bp_enqueue_scripts', 'bp_activity_mentions_script' );
add_action( 'bp_admin_enqueue_scripts', 'bp_activity_mentions_script' );
/**
* Bind the mentions listener to a wp_editor instance when TinyMCE initializes.
*
* @since BuddyPress (2.3.3)
*
* @param array $settings An array with TinyMCE config.
* @param string $editor_id Unique editor identifier, e.g. 'content'.
*
* @return array $mceInit An array with TinyMCE config.
*/
function bp_add_mentions_on_tinymce_init( $settings, $editor_id ) {
// We only apply the mentions init to the visual post editor in the WP dashboard.
if ( 'content' === $editor_id ) {
$settings['init_instance_callback'] = 'window.bp.mentions.tinyMCEinit';
}
return $settings;
}
(function( $, undefined ) {
/* global bp */
window.bp = window.bp || {};
( function( bp, $, undefined ) {
var mentionsQueryCache = [],
mentionsItem;
bp.mentions = bp.mentions || {};
bp.mentions.users = window.bp.mentions.users || [];
if ( typeof window.BP_Suggestions === 'object' ) {
bp.mentions.users = window.BP_Suggestions.friends || bp.mentions.users;
}
/**
* Adds BuddyPress @mentions to form inputs.
*
......@@ -228,34 +239,17 @@
};
$( document ).ready(function() {
var loadMentionsInTinyMCE,
loadAttempts = 0,
users = [];
if ( typeof window.BP_Suggestions === 'object' ) {
users = window.BP_Suggestions.friends || users;
}
// Dashboard post 'visual' editor.
loadMentionsInTinyMCE = function() {
if ( loadAttempts < 4 || ! $( 'body' ).hasClass( 'wp-admin' ) ) {
loadAttempts++;
if ( typeof window.tinyMCE === 'undefined' || window.tinyMCE.activeEditor === null || typeof window.tinyMCE.activeEditor === 'undefined' ) {
setTimeout( loadMentionsInTinyMCE, 500 );
return;
}
}
// Activity/reply, post comments, dashboard post 'text' editor.
$( '.bp-suggestions, #comments form textarea, .wp-editor-area' ).bp_mentions( bp.mentions.users );
});
bp.mentions.tinyMCEinit = function() {
if ( typeof window.tinyMCE === 'undefined' || window.tinyMCE.activeEditor === null || typeof window.tinyMCE.activeEditor === 'undefined' ) {
return;
} else {
$( window.tinyMCE.activeEditor.contentDocument.activeElement )
.atwho( 'setIframe', $( '#content_ifr' )[0] )
.bp_mentions( users );
};
// Activity/reply, post comments, dashboard post 'text' editor.
$( '.bp-suggestions, #comments form textarea, .wp-editor-area' ).bp_mentions( users );
// Dashboard post 'visual' editor.
loadMentionsInTinyMCE();
});
})( jQuery );
.bp_mentions( bp.mentions.users );
}
};
})( bp, jQuery );
\ No newline at end of file
/*! buddypress - v2.3.1 - 2015-06-05 1:48:13 PM UTC - https://wordpress.org/plugins/buddypress/ */
!function(a){var b,c=[];a.fn.bp_mentions=function(d){a.isArray(d)&&(d={data:d});var e={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f>e;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(b){var c,d,e,f,g=a("#atwho-ground-"+this.id+" .atwho-view"),h=a("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=a(i.iframe).offset(),"undefined"!==e&&(c.left+=e.left,c.top+=e.top)):c=this.$inputor.caret("offset"),c.left>h.width()/2?(g.addClass("right"),f=c.left-b.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-b.left+1),h.width()<=400&&a(document).scrollTop(c.top-6),d=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),(!d||5>d)&&(d=19),b.top=c.top+d,b.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(d,e){var f=a(this),g={};return b=c[d],"object"==typeof b?void e(b):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:d,type:"members"},a.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=a.getJSON(ajaxurl,g).done(function(b){if(b.success){var f=a.map(b.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});c[d]=f,e(f)}})))}},data:a.map(d.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=a.extend(!0,{},e,f,d);return a.fn.atwho.call(this,g)},a(document).ready(function(){var b,c=0,d=[];"object"==typeof window.BP_Suggestions&&(d=window.BP_Suggestions.friends||d),b=function(){return(4>c||!a("body").hasClass("wp-admin"))&&(c++,"undefined"==typeof window.tinyMCE||null===window.tinyMCE.activeEditor||"undefined"==typeof window.tinyMCE.activeEditor)?void setTimeout(b,500):void a(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",a("#content_ifr")[0]).bp_mentions(d)},a(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(d),b()})}(jQuery);
\ No newline at end of file
/*! buddypress - v2.3.3 - 2015-08-27 5:14:25 PM UTC - https://wordpress.org/plugins/buddypress/ */
window.bp=window.bp||{},function(a,b){var c,d=[];a.mentions=a.mentions||{},a.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(a.mentions.users=window.BP_Suggestions.friends||a.mentions.users),b.fn.bp_mentions=function(a){b.isArray(a)&&(a={data:a});var e={delay:200,hide_without_suffix:!0,insert_tpl:"</>${atwho-data-value}</>",limit:10,start_with_space:!1,suffix:"",callbacks:{filter:function(a,b,c){var d,e,f,g=[],h=new RegExp("^"+a+"| "+a,"ig");for(e=0,f=b.length;f>e;e++)d=b[e],d[c].toLowerCase().match(h)&&g.push(d);return g},highlighter:function(a,b){if(!b)return a;var c=new RegExp(">(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+b.replace("+","\\+")+")([\\w ]*)\\s*<","ig");return a.replace(c,function(a,b,c,d){return">"+b+"<strong>"+c+"</strong>"+d+"<"})},before_reposition:function(a){var c,d,e,f,g=b("#atwho-ground-"+this.id+" .atwho-view"),h=b("body"),i=this.$inputor.data("atwho");"undefined"!==i&&"undefined"!==i.iframe&&null!==i.iframe?(c=this.$inputor.caret("offset",{iframe:i.iframe}),e=b(i.iframe).offset(),"undefined"!==e&&(c.left+=e.left,c.top+=e.top)):c=this.$inputor.caret("offset"),c.left>h.width()/2?(g.addClass("right"),f=c.left-a.left-this.view.$el.width()):(g.removeClass("right"),f=c.left-a.left+1),h.width()<=400&&b(document).scrollTop(c.top-6),d=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),(!d||5>d)&&(d=19),a.top=c.top+d,a.left+=f},inserting_wrapper:function(a,b,c){return""+b+c}}},f={callbacks:{remote_filter:function(a,e){var f=b(this),g={};return c=d[a],"object"==typeof c?void e(c):(f.xhr&&f.xhr.abort(),g={action:"bp_get_suggestions",term:a,type:"members"},b.isNumeric(this.$inputor.data("suggestions-group-id"))&&(g["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),void(f.xhr=b.getJSON(ajaxurl,g).done(function(c){if(c.success){var f=b.map(c.data,function(a){return a.search=a.search||a.ID+" "+a.name,a});d[a]=f,e(f)}})))}},data:b.map(a.data,function(a){return a.search=a.search||a.ID+" "+a.name,a}),at:"@",search_key:"search",tpl:'<li data-value="@${ID}"><img src="${image}" /><span class="username">@${ID}</span><small>${name}</small></li>'},g=b.extend(!0,{},e,f,a);return b.fn.atwho.call(this,g)},b(document).ready(function(){b(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(a.mentions.users)}),a.mentions.tinyMCEinit=function(){"undefined"!=typeof window.tinyMCE&&null!==window.tinyMCE.activeEditor&&"undefined"!=typeof window.tinyMCE.activeEditor&&b(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",b("#content_ifr")[0]).bp_mentions(a.mentions.users)}}(bp,jQuery);
\ No newline at end of file
......@@ -397,8 +397,8 @@ function bp_core_admin_available_tools_intro() {
$page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php' ;
$url = add_query_arg( $query_arg, bp_get_admin_url( $page ) );
?>
<div class="tool-box">
<h3 class="title"><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h3>
<div class="card tool-box">
<h3><?php esc_html_e( 'BuddyPress Tools', 'buddypress' ) ?></h3>
<p>
<?php esc_html_e( 'BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress' ); ?>
<?php printf( esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ), '<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Tools', 'buddypress' ) . '</a>' ); ?>
......
......@@ -24,6 +24,48 @@ body.index_page_bp-about span.dashicons {
text-align: center;
}
/* About Page - since 2.3.3 (WP 4.3) */
.about-wrap .two-col > div {
position: relative;
width: 47.6%;
margin-left: 4.799999999%;
float: right;
}
.about-wrap [class$=col] .last-feature {
margin-left: 0;
}
.about-wrap .feature-list.finer-points h4,
.about-wrap .feature-list.finer-points p {
margin-right: 115px;
}
@media screen and ( max-width: 782px ) {
.about-wrap .two-col > div {
width: 100%;
margin: 30px 0 0;
padding: 0 0 30px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.dashboard_page_bp-about span.dashicons,
body.index_page_bp-about span.dashicons {
font-size: 55px;
line-height: 70px;
height: 70px;
width: 70px;
}
.about-wrap .feature-list h2 {
margin: 30px 0 0;
text-align: center;
}
.about-wrap .feature-list.finer-points h4,
.about-wrap .feature-list.finer-points p {
margin-right: 90px;
}
}
/* User's Lists
------------------------------------------------------------------------------*/
......@@ -417,6 +459,17 @@ body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title sp
left: 0;
}
/* About Page - since 2.3.3 (WP 4.3) */
@media only screen and (max-width: 500px) {
.about-wrap .bp-badge {
position: relative;
margin: 10px auto;
top: auto;
left: auto;
}
}
/* HiDPI
------------------------------------------------------------------------------*/
......
......@@ -24,6 +24,48 @@ body.index_page_bp-about span.dashicons {
text-align: center;
}
/* About Page - since 2.3.3 (WP 4.3) */
.about-wrap .two-col > div {
position: relative;
width: 47.6%;
margin-right: 4.799999999%;
float: left;
}
.about-wrap [class$=col] .last-feature {
margin-right: 0;
}
.about-wrap .feature-list.finer-points h4,
.about-wrap .feature-list.finer-points p {
margin-left: 115px;
}
@media screen and ( max-width: 782px ) {
.about-wrap .two-col > div {
width: 100%;
margin: 30px 0 0;
padding: 0 0 30px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
body.dashboard_page_bp-about span.dashicons,
body.index_page_bp-about span.dashicons {
font-size: 55px;
line-height: 70px;
height: 70px;
width: 70px;
}
.about-wrap .feature-list h2 {
margin: 30px 0 0;
text-align: center;
}
.about-wrap .feature-list.finer-points h4,
.about-wrap .feature-list.finer-points p {
margin-left: 90px;
}
}
/* User's Lists
------------------------------------------------------------------------------*/
......@@ -417,6 +459,17 @@ body.branch-3-7.settings_page_bp-components tr.members.active td.plugin-title sp
right: 0;
}
/* About Page - since 2.3.3 (WP 4.3) */
@media only screen and (max-width: 500px) {
.about-wrap .bp-badge {
position: relative;
margin: 10px auto;
top: auto;
right: auto;
}
}
/* HiDPI
------------------------------------------------------------------------------*/
......
......@@ -848,9 +848,16 @@ function bp_setup_nav_menu_item( $menu_item ) {
return $menu_item;
}
// Prevent a notice error when using the customizer
$menu_classes = $menu_item->classes;
if ( is_array( $menu_classes ) ) {
$menu_classes = implode( ' ', $menu_item->classes);
}
// We use information stored in the CSS class to determine what kind of
// menu item this is, and how it should be treated
preg_match( '/\sbp-(.*)-nav/', implode( ' ', $menu_item->classes), $matches );
preg_match( '/\sbp-(.*)-nav/', $menu_classes, $matches );
// If this isn't a BP menu item, we can stop here
if ( empty( $matches[1] ) ) {
......@@ -904,7 +911,12 @@ function bp_setup_nav_menu_item( $menu_item ) {
} else {
$current = bp_get_requested_url();
if ( strpos( $current, $menu_item->url ) !== false ) {
$menu_item->classes[] = 'current_page_item';
if ( is_array( $menu_item->classes ) ) {
$menu_item->classes[] = 'current_page_item';
$menu_item->classes[] = 'current-menu-item';
} else {
$menu_item->classes = array( 'current_page_item', 'current-menu-item' );
}
}
}
......@@ -912,6 +924,68 @@ function bp_setup_nav_menu_item( $menu_item ) {
}
add_filter( 'wp_setup_nav_menu_item', 'bp_setup_nav_menu_item', 10, 1 );
/**
* Populate BuddyPress user nav items for the customizer
*
* @since BuddyPress (2.3.3)
*
* @param array $items The array of menu items
* @param string $type The requested type
* @param string $object The requested object name
* @param integer $page The page num being requested
* @return array The paginated BuddyPress user nav items.
*/
function bp_customizer_nav_menus_get_items( $items = array(), $type = '', $object = '', $page = 0 ) {
if ( 'bp_loggedin_nav' === $object ) {
$bp_items = bp_nav_menu_get_loggedin_pages();
} elseif ( 'bp_loggedout_nav' === $object ) {
$bp_items = bp_nav_menu_get_loggedout_pages();
} else {
return $items;
}
foreach ( $bp_items as $bp_item ) {
$items[] = array(
'id' => "bp-{$bp_item->post_excerpt}",
'title' => html_entity_decode( $bp_item->post_title, ENT_QUOTES, get_bloginfo( 'charset' ) ),
'type' => $type,
'url' => esc_url_raw( $bp_item->guid ),
'classes' => "bp-menu bp-{$bp_item->post_excerpt}-nav",
'type_label' => _x( 'Custom Link', 'customizer menu type label', 'buddypress' ),
'object' => $object,
'object_id' => -1,
);
}
return array_slice( $items, 10 * $page, 10 );
}
add_filter( 'customize_nav_menu_available_items', 'bp_customizer_nav_menus_get_items', 10, 4 );
/**
* Set BuddyPress item navs for the customizer
*
* @since BuddyPress (2.3.3)
*
* @param array $item_types an associative array structured for the customizer
*/
function bp_customizer_nav_menus_set_item_types( $item_types = array() ) {
$item_types = array_merge( $item_types, array(
'bp_loggedin_nav' => array(
'title' => _x( 'BuddyPress (logged-in)', 'customizer menu section title', 'buddypress' ),
'type' => 'bp_nav',
'object' => 'bp_loggedin_nav',
),
'bp_loggedout_nav' => array(
'title' => _x( 'BuddyPress (logged-out)', 'customizer menu section title', 'buddypress' ),
'type' => 'bp_nav',
'object' => 'bp_loggedout_nav',
),
) );
return $item_types;
}
add_filter( 'customize_nav_menu_available_item_types', 'bp_customizer_nav_menus_set_item_types', 10, 1 );
/**
* Filter SQL query strings to swap out the 'meta_id' column.
*
......
......@@ -813,7 +813,7 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
$truncate = '';
// Find all the tags and HTML comments and put them in a stack for later use
preg_match_all( '/(<\/?([\w!].+?)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
preg_match_all( '/(<\/?([\w+!]+)[^>]*>)?([^<>]*)/', $text, $tags, PREG_SET_ORDER );
foreach ( $tags as $tag ) {
// Process tags that need to be closed
......@@ -865,21 +865,70 @@ function bp_create_excerpt( $text, $length = 225, $options = array() ) {
// If $exact is false, we can't break on words
if ( empty( $r['exact'] ) ) {
$spacepos = mb_strrpos( $truncate, ' ' );
if ( false !== $spacepos ) {
if ( $r['html'] ) {
$bits = mb_substr( $truncate, $spacepos );
preg_match_all( '/<\/([a-z]+)>/', $bits, $droppedTags, PREG_SET_ORDER );
if ( !empty( $droppedTags ) ) {
foreach ( $droppedTags as $closingTag ) {
if ( !in_array( $closingTag[1], $openTags ) ) {
array_unshift( $openTags, $closingTag[1] );
}
// Find the position of the last space character not part of a tag.
preg_match_all( '/<[a-z\!\/][^>]*>/', $truncate, $_truncate_tags, PREG_OFFSET_CAPTURE );
// Rekey tags by the string index of their last character.
$truncate_tags = array();
if ( ! empty( $_truncate_tags[0] ) ) {
foreach ( $_truncate_tags[0] as $_tt ) {
$_tt['start'] = $_tt[1];
$_tt['end'] = $_tt[1] + strlen( $_tt[0] );
$truncate_tags[ $_tt['end'] ] = $_tt;
}
}
$truncate_length = mb_strlen( $truncate );
$spacepos = $truncate_length + 1;
for ( $pos = $truncate_length - 1; $pos >= 0; $pos-- ) {
// Word boundaries are spaces and the close of HTML tags, when the tag is preceded by a space.
$is_word_boundary = ' ' === $truncate[ $pos ];
if ( ! $is_word_boundary && isset( $truncate_tags[ $pos - 1 ] ) ) {
$preceding_tag = $truncate_tags[ $pos - 1 ];
if ( ' ' === $truncate[ $preceding_tag['start'] - 1 ] ) {
$is_word_boundary = true;
break;
}
}
if ( ! $is_word_boundary ) {
continue;
}
// If there are no tags in the string, the first space found is the right one.
if ( empty( $truncate_tags ) ) {
$spacepos = $pos;
break;
}
// Look at each tag to see if the space is inside of it.