Forum Replies Created
-
… Just the last comment, the add_action works fine this way (last line, moved from the bp-example-admin.php to bp-example.php):
function bp_example_check_installed() {
global $wpdb, $bp;
if ( !is_site_admin() )
return false;
/***
* If you call your admin functionality here, it will only be loaded when the user is in the
* wp-admin area, not on every page load.
*/
require ( WP_PLUGIN_DIR . '/bp-example/bp-example-admin.php' );
/* Need to check db tables exist, activate hook no-worky in mu-plugins folder. */
if ( get_site_option('bp-example-db-version') < BP_EXAMPLE_DB_VERSION )
bp_example_install();
}
add_action( 'admin_menu', 'bp_example_check_installed' );
add_action( 'admin_menu', 'bp_example_add_admin_menu' );same here, same fix
Hi Jeff
The add_submenu_page works fine. The problem it’s focused at add_action. It does not work at the example plugin, nor at my plugin. I do a workaround calling the …_add_admin_menu functions, but the add_action/filter_actions does not execute the paired function (here I’m just reporting or asking if anyoneelse has the same issue with the Admin side from Skeleton 1.2.2 component).
If, as you state, I place both, the functions and add_action in the main file, they work fine.
I was looking to build/fix the base for my plugins and make them wpmu/bp-future-proof.
Thank you so much Jeff!
I’ve seen that this:
bp-example-admin.php:
add_action( 'admin_menu', 'bp_example_add_admin_menu' );
This add_action is right after the definition of the same bp_example_add_admin_menu function.
From my understanding, once the require at the bp-example page is called, the add_action executes the function, am I right ? if so this doesn’t work, however, if I call bp_example_add_admin_menu right after the require it works fine loading the menu option right under the BuddyPress pane.
This is the propper behaviour ?
… by the way, the skeleton/example admin options should appear under the WPMU > BuddyPress pane, right ?
Thanks Jeff. I’m using the new folder and structure. The WP_PLUGIN_DIR is just what comes along with the skeleton 1.2.2.
I’m working on this (I have a workaround working) and feedback again once I have it absolutely clear.
further investigation lead me to:
function bp_example_check_installed() {
...
/***
* If you call your admin functionality here, it will only be loaded when the user is in the
* wp-admin area, not on every page load.
*/
require ( WP_PLUGIN_DIR . '/bp-example/bp-example-admin.php' );Checking WP_PLUGIN_DIR returns a full path that looks like it’s the key of all the problem. If I use just
require ( 'bp-example/bp-example-admin.php' );
the require looks to work …… still looking at this …
yep
Your path seems wrong. From v1.0 mine is:
/wp-content/plugins/buddypress/bp-languages
3 files inside:
buddypress.pot
buddypress-es_ES.mo
buddypress-es_ES.po
… err … sorry fot the spam, but I see that also the upgrade deletes a custom plug-in I placed inside the buddypress folder
Just to be even more clear and to confirm the issue once I repeated it, in my case I just placed again:
buddypress-es_ES.po
buddypress-es_ES.mo
only that, placed again the POT and PO/MO pair files
Same here.
As you said, I checked the languages folder and found that the MO files were missing, I guess deleted by the upgrade (!!). Once restored the translation has worked again.
You should edit ‘wp-content/bp-themes/your-theme/plugin-template.php’
But gives you little flexibility to edit the layout. I’m seriously thinking to edit the core files or try t oextract those function funcionallity to my own theme functions (don’t know how to, but …)
Hi again
I made some mistakes:
– asume that the upgrade from RCx to v1 was simply copying files over the old ones and didn’t noticed the change in the setup procedure to /wp-content/plugins/buddypress
– Also is posible that as my MU base was 2.7 it messed a bit too
– Tampering the themes fields in the db with a non ortodox setup
I started the intall process all over and it works fine again.
As a final test I tried to swap the old DB for the new one but I get again messages like the BP_PLUGIN_DIR path.
Just if helps …
Regards,
I’m having the same issue but with Activities when starting up in:
Fatal error: require() [function.require]: Failed opening required ‘BP_PLUGIN_DIR/bp-activity/bp-activity-classes.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) …www/wp-content/mu-plugins/bp-activity.php on line 14
I “ugraded” from RC1 to v1 but failed. Then I removed everything except WPMU & wp-config.php, as the DB was ok. Copied BP, moved the themes and got the message.
I tried to reset the themes in db to bpmember and bphome without success.