Help with action variables and catching a URL
-
I’m adding an action to a simple plugin, and BP seems not to be catching the URL (WP returns a 404). Here’s what I’m trying to do:
User clicks on the link to perform the action. The anchor has the url:
http://site.com/members/username/library/delete-map/57/2/value?_wpnonce=cc13d43458The link returns a 404 page, but I’m able to check that the component, action and variable look like this:
Array ( [component] => library [action] => delete-map [action_variables] => Array ( [0] => 57 [1] => 2 [2] => value ) )
The function to catch the URL:
function bp_library_pane_do_something() { if ( bp_is_current_component( 'library' ) && bp_is_current_action( 'delete-map' ) ) { //Code here. For testing, I've been using bp_core_redirect( bp_displayed_user_domain() ); } } add_action( 'bp_actions', 'bp_library_pane_do_something' );
If I need to post any other pieces of code to explain, please let me know. Thanks in advance for your help.
-David
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Help with action variables and catching a URL’ is closed to new replies.