I dont see anything wrong with the first part. The themes function.php might not be loaded when you create the user. I would put that code into a plugin instead of the theme. A quick way to do that is to create a mu-plugin. For example drop that code into: /wp-content/mu-plugins/mymuplugin.php
I do see a problem with your test. You edited wpmu_signup_user_notification() and removed the apply_filter(), that is why your filter is not called.
Related Posts:
- How to add headers to outgoing email?
- Editing ‘Password Reset’ E-mail
- wp_mail – Remove sitename from email subject
- How to disable all WordPress emails modularly and programatically?
- Customize user account activation message
- Is it possible to put the add-filter()-hook into a function?
- How can I change the email that is inside the default email texts of wordpress?
- Help with filter for wp_notify_moderator()
- Error using wp_mail inside custom function
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Email Obfuscation: Is antispambot() Acceptable? [closed]
- arguments for comment_notification_text filter
- Would like to use hook or filters to customize email templates
- Filter wp_mail based on content type
- Changing WooCommerce Display Price Based on User Role & Category [closed]
- LESS CSS enqueue_style with add_filter to change rel attribute
- Remove Editor From Homepage
- Remove description from on Home
- What do add_filters() and apply_filter() do?
- How can I detect if a user changes their password?
- What to use instead of the content_save_pre filter?
- Moving sharedaddy buttons (in Jetpack) to the top of a post?
- How can I customize the wp_list_categories
- Setting title using wp_title filter
- 4.0 remove_filter for WordPress core function not working for me
- What functions are included in apply_filter(‘the_content’)
- Filtering admin entries for custom post type
- What hook/filter can I use to add/edit/show/hide the title under (on hover) links on the table view?
- option_active_plugins filter not working
- How do we check if the user is logging in or registering?
- Anonymous function is executed twice in wp_head while added from the_posts filter?
- add_filter return value
- Hide content editor for posts after approriate date
- Why my admin doesn’t work after adding rest_prepare_post filter?
- Buddypress: Edit activity when new blog post [closed]
- How to make a button?
- How do I filter title and alt attributes in the gallery shortcode?
- Same Conditionals Not Working on Two Different Hooks
- remove_action in plugin file
- How to apply filter at search of woocommerce products?
- Filter get_template_part() $args array
- Modify a Filters Second Parameter
- Filtering post-formats from the loop using new WP-Query();
- Insert term when page is published – avoid duplicates after edits
- Filter Media by Featured on Admin
- How to add a filter to get_the_author_meta?
- Change wp-signup.php Page Template
- page_attributes_dropdown_pages_args filter does not work
- What different ways can a plugin add a filter to a WordPress site?
- How to access plugin variables from theme templates without using globals?
- Make an array filterable per hook
- Make WP not format code, not insert line breaks in between tags
- add img class to native wordpress galleries
- Get Posts updated or published within the last x hours
- How to get a single hook from wp_head()?
- WP filter to alter admin CSS styles?
- preview_post_link for Custom Post Types
- Filter an array with a callback – for single & multidimensional arrays
- Detect when gutenberg editor title is available in Dom after editor load
- Why this filter hook is not working when passing parameters?
- Are href attributes of a elements filtered on output to add the current path?
- Add a filter to an action [closed]
- Change the template when the user is not logged in using page_template filter (it does not work)
- Regarding post text filtering
- Add Filter not working with get_posts
- How to Prevent WordPress to encode html in post?
- Why template_include filter does not work with WPML plugin?
- Hide Posts In Back-end/Admin Based On User’s (Pseudo) Privileges Controlled by ACF
- Filter posts by meta data using custom query
- Most performant/functional way to add actions/filters?
- Making an add_filter() call from within an add_filter() call
- Filter causing loss of _wp_attachment_metadata
- Action hook to control access to certain parts of my site
- Finding actual functions added to hooks and filters
- How to apply filter on get_the_post_thumbnail()
- How can I tranlslate post date in italian?
- Use alternative front page if cookie is set
- How do I check if I can use the allowed_block_types filter?
- Having wp-admin on different domain
- Use a functions in functions.php to remove a string for template theme
- Setting the page title in a plugin, but not outside my plugin
- how to output HTML tags in post_content and not as plain text
- Security question – Display a General Custom Login Error Message
- Add filter conditionally to a page
- Remove the post_content search from WHERE clause (and CONCAT sql function)
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- Post filter Month dropdown at front-end like wordpress backend
- changing size image within the content
- Remove action added from class
- How do I remove certain HTML elements with specific classes from the feed?
- Identify admin/logout and more filters
- Sanitizing a custom query’s clauses
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- confusion with add_filter
- How to create a list of terms who’s posts also have a predefined external term?
- Can you call a filter hook by “add_action”?
- Why isn’t this add_filter function working as expected?
- Adding filter to the Contact Form 7 response