I can’t find where a hook is being defined in a plugin – Easy Digital Downloads

I’ve been reading the code of the plugin “Easy Digital Downloads” in order to learn more about plugin development techniques. I’m getting crazy because of a hook I can’t manage to find where is being defined.

add_action( 'edd_edit_user_profile', 'edd_process_profile_editor_updates' );

Located in: includes/shortcodes.php
Line: 918

I know edd_process_profile_editor_updates is the function used to process the profile updates (duh, obvious), and edd_edit_user_profile is the hook location that triggers the function, but I haven’t been able to find where is being defined do_action('edd_edit_user_profile')

Yes, I did a full search for edd_edit_user_profile in the whole plugin but this is the only line that mention this hook.

Thanks in advance!

1 Answer
1

in

includes/actions.php

there’s

function edd_post_actions() {
    $key = ! empty( $_POST['edd_action'] ) ? sanitize_key( $_POST['edd_action'] ) : false;
    if ( ! empty( $key ) ) {
        do_action( "edd_{$key}", $_POST );
    }
}
add_action( 'init', 'edd_post_actions' );

in

templates/shortcode-profile-editor.php

there’s

..input type="hidden" name="edd_action" value="edit_user_profile" ..

which, if the two are used together, would make

do_action( 'edd_edit_user_profile', $_POST );

As I said in my comment on your post – its very common in WP for actions to be dynamic, so you need to be less specific on your search, exempting the prefix, variable actions, or just remove the key and search a large do_action query instead.

Leave a Comment