Forum Replies Created
-
In reply to: Font Awesome breaks ajax on delete link
It’s the jquery in global.js
The ‘target’ becomes the icon rather than the a tag.
Soif ( target.hasClass('delete-activity')fails.Changing to this gets the right target:
if ( target.hasClass('icon-trash') {And then you need to change:
var link_href = target.attr('href');to:
var link_href = target.closest("a").attr("href");otherwise the nonce won’t be found and the ajax will fail.
Note: why is global.js being loaded from BuddyPress Default Theme when BP Legacy Theme is being used? Don’t know, but something is funky in this particular client’s installation.
Rather than filter it, prevent the entry from being created.
Try this in your theme/functions.php or plugins/bp-custom.php
It won’t remove existing entries, but should stop new ones.function victor_dont_save_join_group_activity( $activity_object ) { $exclude = array( 'joined_group' ); if( in_array( $activity_object->type, $exclude ) ) $activity_object->type = false; } add_action('bp_activity_before_save', 'victor_dont_save_join_group_activity', 1, 1 );In reply to: Font Awesome breaks ajax on delete linkThis issue gets stranger the farther I dig…
1. We aren’t using the BP Default theme, so why is the activity stream using global.js instead of buddypress.js from the legacy theme?
2. in either /js, this click handler is never triggered if an image is used in the < a > tag for activity->delete or activity->fav
jq('div.activity').click( function(event) {Always grep in the BP plugin folder first.
bp_group_create_button()
bp-groups\bp-groups-template.php ~L. 1890In reply to: Font Awesome breaks ajax on delete linkReplacing the text with a basic img tag has the same effect; when clicked, the activity item is deleted but on a page reload instead of via ajax.
So I don’t think it’s specific to font awesome.
In reply to: [Resolved] Limited Checkbox Selectionformat got messed up, so look here for a non-jQuery approach: http://pastebin.com/0afNVh3e
In reply to: [Resolved] Limited Checkbox Selectionjavascript:
function checkboxlimit(checkgroup, limit){ for (var i=0; i<checkgroup.length; i++){ checkgroup[i].onclick=function(){ var checkedcount=0 for (var i=0; i<checkgroup.length; i++) checkedcount+=(checkgroup[i].checked)? 1 : 0 if (checkedcount>limit){ alert("You can select a maximum of "+limit+" boxes.") this.checked=false } } } } checkboxlimit(document.forms.your_form_name_or_id['field_name[]'], 5);>In the original function, there’s no return statement only echo.
The original function is not a filter hooked function.
echo $tab; is not a return.
Read up on WordPress functions, actions and filters.I’m surprised your code works.
Filter should always return something.This is unfinished but outlines another approach, probably more ‘correct’:
function custom_bp_profile_group_tabs( $tabs, $groups, $group_name ) { tab_names = array('Base', 'GroupProfile' ); // add to as necessary foreach ( (array) $tabs as $tab ) { // loop thru tab_names using something like strpos() to check for matches // if you find a match, use str_replace to add 'Edit ' } return $tabs; } add_filter('xprofile_filter_profile_group_tabs','custom_bp_profile_group_tabs', 1, 3);In bp_profile_group_tabs, there is a filter hook:
$tabs = apply_filters( 'xprofile_filter_profile_group_tabs', $tabs, $groups, $group_name );Write a filter function and do a string search & replace for each tab.
ex. Search for ‘Base’ and replace it with ‘Edit Base’.In reply to: Custom Component HelpMight be related to your component, but probably just the usual cpt issues.
Do you have a theme template called single-music.php so that WP can display it?
Do you have a pre_get_posts filter in your theme/functions.php or plugin file so that WP knows you want a cpt?
// so music cpt is included in cat or tag calls function stoi_query_post_type($query) { if(is_category() || is_tag()) { $post_type = get_query_var('post_type'); if($post_type) $post_type = $post_type; else $post_type = array('post','music'); $query->set('post_type',$post_type); return $query; } } add_filter('pre_get_posts', 'stoi_query_post_type');In reply to: Member Total when excluding subscribersTry using the bp_pre_user_query_construct hook
codex exampleIn reply to: Creating an iOS accompaniment to my siteThere are various plugins and services for turning a WP site into an app – google it.
Here’s one: appPresserRemember that you don’t need to use WP/BP to call the database.
Often times, devs create apps that only use a subset of the data.
So rolling your own app is feasible and probably the best approach.In reply to: Create custom notificationsThe bbpress example is a good one.
But just fyi – the BuddyPress codex page is here: bp_notifications_add_notification page.
In reply to: Duplicate BuddyPress activityThat might be tricky to track down, given that ajax is involved.
Your best bet is to ask Headway.In reply to: Duplicate BuddyPress activity>where both want to display the posts hence the duplication
It’s not a display problem, although that’s how it manifests.
Two entries are being created when an update is created.
http://boyabouttown.net/members/jenifusion/activity/58/
http://boyabouttown.net/members/jenifusion/activity/57/Did you switch to a WP theme ( 2013, etc ) and then create an activity update?
In reply to: Sanitize Input – groups_update_groupmetaEasy enough to test with some ‘bad’ data, but groups_update_groupmeta uses update_metadata which runs the value thru things like sanitize_meta, so you should be fine.
In reply to: NSFW: Please review my theme | BBFacelookIt looks fine and is usable.
I like the stripped down listings on pages like ‘members’But the only opinions that count are those of your users.
In reply to: [Resolved] New users only visible after logging inThey aren’t visible because they have no last_activity field.
Going forward, this should add it for new members – untested, goes in theme/functions.phpfunction pilon_add_timestamp( $user_id ) { bp_update_user_last_activity( $user_id ); } add_action('user_register', 'pilon_add_timestamp', 10 , 1);For existing members with no last_activity, you could write a script that gathers those member ids and then run them thru the function above.
In reply to: [Resolved] Display groups a user is member ofNice. And thanks for the link to the discussion.
This is the file:
buddypress\bp-templates\bp-legacy\buddypress\activity\entry.phpCreate a template overload before you change it.
In reply to: How to Limit Personal Activity Feed Postsbuddypress\bp-templates\bp-legacy\buddypress\activity\activity-loop.php
In reply to: Integrating BuddyPress with WP Job ManagerYou could use the approach in the codex page you’ve referenced.
Probably easier to use this hook from WP Job manager: ‘job_manager_save_job_listing’
In the function that you create for that hook, use bp_activity_add.