Forum Replies Created
-
In reply to: Cacheing plugin recommendations
WP super Cache but do not cache any page that updates via ajax.
In reply to: Add links to specific profile fieldsIf you look at this snippet for allowing youtube link to embed instead of showing a link you can wrap a function in an if this field is X then don’t remove link.
In reply to: Creating New PluginsLooks good. One more suggestion per WP standards. Place all add_actions right below it’s function unless the action is inside a function in that case you place that actions function below the function the add action is inside. It’s to keep the code easier to manage when you have really long file and scrolling up and down gets tedious.
/*** Make sure BuddyPress is loaded ********************************/ function private_community_for_bp_lite_bp_check() { if ( !class_exists( 'BuddyPress' ) ) { add_action( 'admin_notices', 'private_community_for_bp_lite_install_buddypress_notice' ); } } add_action('plugins_loaded', 'private_community_for_bp_lite_bp_check', 999); function private_community_for_bp_lite_install_buddypress_notice() { echo '<div id="message" class="error fade"><p style="line-height: 150%">'; _e('<strong>Private Community For BP Lite</strong></a> requires the BuddyPress plugin to work. Please <a href="https://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private Community For BP Lite</a>.'); echo '</p></div>'; } function private_community_for_bp_lite_init() { require( dirname( __FILE__ ) . '/private-community-for-bp-lite.php' ); } add_action( 'bp_include', 'private_community_for_bp_lite_init' );In reply to: Charge a fee to upload mediaYou can use s2 member or restrict content pro plugins to charge for a certain membership but then you would have to custom code the only allow those paid members to upload content.
In reply to: Creating New PluginsSince last year plugin reviews are getting stricter to avoid useless and or badly coded plugins for the benefit of not having to filter through crap when searching the repo.
In reply to: Creating New PluginsYou got rejected and asked why, I explained with code examples and you think It’s not necessary. Why ask for help to only reject the suggestions? Also, this type of response will get you rejected from repo.
The WordPress community is about sharing knowledge and helping each other better the code whether it’s your plugin or core code. No one singled you out. Everyone gets their olugin reviewed and if something can be better then be thankful the volunteers on the repo suggested something. Your users will thank you for having a plugin that doesn’t break their site.
In reply to: Creating New PluginsYou really need to wrap the if class in a function that loads after all plugins just to be on the safe side. The reason it works is because your plugin name is alphabetically after BuddyPress so it loads after but the proper way is to wait until all plugins are loaded and then give the error notice.
In reply to: Creating New PluginsThe reason of my last suggestion is you can not test if BuddyPress class if you do not call it after plugins_loaded. Previous code doesn’t work right because plugins load in the order they are listed in the admin. If your plugin is above BuddyPress then the BP class hasn’t loaded and the error notice will show even if BuddyPress is active. The last code fixes that by running function after all plugins are loaded.
In reply to: Creating New PluginsActually just wrap notice check in if class because bp_include won’t run if bp isn’t active.
add_action( ‘bp_include’, ‘private_community_for_bp_lite_init’ );
function private_community_for_bp_lite_bp_check() { if ( !class_exists( 'BuddyPress' ) ) { add_action( 'admin_notices', 'private_community_for_bp_lite_install_buddypress_notice' ); } } add_action('plugins_loaded', 'private_community_for_bp_lite_bp_check', 999);In reply to: Creating New PluginsYou can also wrap everything in a class. Look at bp-loader.php to get an idea of how to do that. I’m guilty of not following the best way out of laziness but I always go over my code and try and perfect as much as possible. I look at how BuddyPress core code is written and look over others plugins that I feel are doing it right.
In reply to: Creating New Pluginsthis: require_once( ABSPATH . ‘/wp-admin/includes/plugin.php’ );
The review proccess can and will point out better coding practices. If they see a cleaner way to write it then they will say something. If you ever submit a theme for review you will have this happen 10 fold.
The plugin review team is actually easy on the reviews.
In reply to: Creating New PluginsMika and John were just pointing out you didn’t need to load that extra file to check for BuddyPress. The code you were using has been copy & pasted over the years from some early plugins.
In reply to: Creating New Pluginsnot a requirement. my suggestion is just another possible way to check if BP is active.
In reply to: Creating New Plugins/*** Make sure BuddyPress is loaded ********************************/ if ( class_exists( 'BuddyPress' ) ) { add_action( 'bp_include', 'private_community_for_bp_lite_init' ); } else { add_action( 'admin_notices', 'private_community_for_bp_lite_install_buddypress_notice' ); } function private_community_for_bp_lite_init() { require( dirname( __FILE__ ) . '/private-community-for-bp-lite.php' ); } function private_community_for_bp_lite_install_buddypress_notice() { echo '<div id="message" class="error fade"><p style="line-height: 150%">'; _e('<strong>Private Community For BP Lite</strong></a> requires the BuddyPress plugin to work. Please <a href="https://buddypress.org/download">install BuddyPress</a> first, or <a href="plugins.php">deactivate Private Community For BP Lite</a>.'); echo '</p></div>'; }In reply to: Creating New PluginsIt all depends on how the plugin functions. if you have WP options saved and then use bp_include to load plugin your settings won’t load fast enough for BuddyPress to use options.
bp_include is used for code that accesses BuddyPress code. So you know that BuddyPress is loaded before you execute code. It should not be used to detect if BuddyPress is active.
you can use https://codex.wordpress.org/Function_Reference/is_plugin_active
or check if ( class_exists( ‘BuddyPress’ ) )
glad it worked out!
if ( !bp_current_component() ) { //anything here will show on non BuddyPress pages }So you could wrap you nav code with that statement
copy page.php and rename it buddypress.php
copy header.php and rename it header-buddypress.php
inside buddypress.php change get_header() to get_header(“buddypress”)
remove the header image from header-buddypress.php
In reply to: Join a Private Group by Password?Don’t think that exists but sounds like a good plugin.
In reply to: buddypress.org themes pageAlmost any theme is BuddyPress compatibly so singling out a few themes isn’t required.
Header images an every page only satisfies the designer of a site and does nothing for a site user. for usability sake remove it or create and trimmed down header image for user pages.
In reply to: Login widget not showing in sidebardownload a login widget plugin from wp.org
In reply to: Designing BuddyPresss2member works well with BuddyPress. When you use BP with multisite only one site on the network contains BP. However, any member of any site on the network is added to BuddyPress. BP consolidates blog postings from the entire multisite into a list.
Alot of WP plugins work with BP. Search BuddyPlug in wordpress.org repo. Also bpinspire.com to see full sites using BuddyPress
BuddyPress core has no API for external communication.
There are however, a few 3rd party API plugins.
https://github.com/tweichart/JSON-API-for-BuddyPress
https://github.com/modemlooper/BuddyData
https://wordpress.org/plugins/buddypress-xml-rpc-receiverBuddyPress Android app: https://play.google.com/store/apps/details?id=org.yuttadhammo.buddydroid
BuddyMobile web app: https://wordpress.org/plugins/buddymobile
There is a WordPress json API project happening and I may rewriting BuddyData to have buddyPress endpoints to work with that API. https://github.com/rmccue/WP-API
In reply to: Help with action variables and catching a URLtry hooking to bp_init instead of bp_actions