Replies
- Brajesh Singh on August 22, 2016 at 8:12 pm in reply to: [Resolved] How do you get all the available values for a xprofile field (checkbox or select #5233
Hi Jaume,
I am glad it did 🙂 You are most welcome John 🙂
Hi John,
Thank you for the details.I have slightly modified your code
function change_default_settings_tab() { $bp = buddypress(); bp_core_new_nav_default( array( 'parent_slug' => $bp->settings->slug, 'subnav_slug' => 'accountdetails', 'screen_function' => 'your_function_that_loads_templates' //change it ) ); } add_action( 'bp_settings_setup_nav', 'change_default_settings_tab', 5 );Note the ‘screen_function’ key. Please make sure to pass your screen function that loads the template( which you used while registering the nav item). Also, subnav slug only needs the slug not the complete parent/child.
Please let me know if it worked for you or not?
Thank you
BrajeshHi John,
Can you please post the complete code? Use bp_get_template_part instead. bp_core_load_template calls exit so it only loads the first template.Here is a way to do it
1. Use bp_core_load_template to load our custom file
2. In the custom file use bp_get_template_part to load both the files.Hope that helps.
Regards
Brajesh- Brajesh Singh on August 22, 2016 at 7:10 pm in reply to: How to Use Third Party Lightbox Plugin to Open Images #5225
Hi Simon,
No problem.
I will post it as a small plugin on github today/tomorrow. - Brajesh Singh on August 22, 2016 at 6:25 pm in reply to: [Resolved] Extended Code for Private Site #5224
Hi Hans,
Thank you for posting.To be honest, I will not recommend in going to that direction and I will explain why.
1. If you want to prevent images from being visible to anyone, we can either move images to outside the webroot or use htaccess to disable the webserver rendering it.
2. Once we do the above step, we will need php to read the image file depending on who is accessing them(using some sort of route) and that is highly resource intensive and inefficient.
Even Facebook does not do it. Yes, you can access private media directly if you have access to the correct url.
I will rather recommend file name obfuscation(there are many plugins) and using seo plugins to avoid indexing of media files.
Hi Dandy,
Thank you. We will have the Featured widget in a week available. I will find some time this weekend and look at the integration of the above tool. As far as I see, It should be doable.- Brajesh Singh on August 22, 2016 at 5:59 pm in reply to: [Resolved] How do you get all the available values for a xprofile field (checkbox or select #5222
Hi Jaume,
Welcome back.
It’s a good question. Since there does not exist any functions, I wrote one for you
/** * @param int $field_id Field ID * * @return array of options */ function buddydev_xprofile_get_field_options( $field_id ) { $field = xprofile_get_field( $field_id ); $options = $field->get_children(); return wp_list_pluck( $options, 'name' ); }You can put this function in your bp-custom.php or functions.php and then call it like this
print_r( buddydev_xprofile_get_field_options ( 17 ) );17 is field id. Change it with your own field. In case of non multi field, It will give you an empty array.
Hope that helps.
Regards
Brajesh - Brajesh Singh on August 22, 2016 at 3:59 pm in reply to: bbPress based "Task Manager" / To-do List for BuddyPress #5215
Hi Hans,
I will be taking over it in next 2 week. Actually, It can be quiet useful for our own forum and I wanted to add some features here. So I think your topic is a good start for that.Let us keep it open and I will keep you updated.
Hi Dandy,
Thank you.1. I am completely in favor of this. I am not sure how will we allow users to mark a media as featured though. using buttons? on Edit Gallery page? or on Media List page?
2. It is easily doable. Here are the steps(but dependent on your provider)
a). Get the final drawing from the user. Convert it to png and save it to WordPress media library. Once in the library, Mark the media as MediaPress media(I will provide code for the last step). If the drawing tools support this kind of export using js(I used fabricjs in past and It supported this), It can be accomplished.
Regards
Brajesh