How can I find the hook I need to rewrite a function?

BuddyPress defines a class named BP_Group_Extension which can be used by plugins or themes as an API for creating group extensions. This base class is located in buddypress/bp-groups/bp-groups-classes.php, and there is documentation on how to use it in the file at the beginning of the class definition (starting at line 1742). bbPress uses this BuddyPress … Read more

Filtering the post list in the admin area

I would suggest using post_submitbox_misc_actions action as shown in the below example to provide an option for Publish meta-box. <?php add_action( ‘post_submitbox_misc_actions’, ‘my_post_submitbox_misc_actions’ ); function my_post_submitbox_misc_actions(){ ?> <div class=”misc-pub-section my-options”> <label for=”my_custom_post_action”>My Option</label><br /> <select id=”my_custom_post_action” name=”my_custom_post_action”> <option value=”1″>First Option goes here</option> <option value=”2″>Second Option goes here</option> </select> </div> <?php } ?> Once used for … Read more

The Hook registration_errors was not called

You are not using the registration_errors hook properly. It should look like this: add_filter( ‘registration_errors’, ‘reg_user_register’, 10, 3); function reg_user_register($errors, $sanitized_user_login, $user_email){ $custom_reg_field1 = $_POST[“custom_reg_field1”]; // add error checking here if ( empty($custom_reg_field1) ) { $errors->add(‘custom_reg_field1’, __( ‘Please enter a reg_field1.’ ) ); } return $errors; }

how to customize rss feed tags using hooks?

Removing the tag altogether would be inconvenient since it’s hardcoded in feed-rss2.php template file. You could replace the calling function in do_feed_rss2 hook, but still would need to fork whole template. It is, however, easy to cancel out content there. get_post_comments_feed_link() passes output through the filter, so something like this should do it (not tested): … Read more

Howto check version of another plugin and then add a submenu page to it

Ok i got it. The solution is to use an earlier hook for checking plugins. But then the function get_plugins() is not available so i have to include it for using. The working code: class acf_multisite_sync { function __construct() { add_action(‘plugins_loaded’, array($this, ‘acf_sync_init’)); } function acf_sync_init() { if (!function_exists(‘get_plugins’)) { require_once ABSPATH . ‘wp-admin/includes/plugin.php’; } … Read more