I simply used the wrong hook for my function.
I replaced:
add_action( 'school_order_completed', 'user_role_change_superadmin' );
with:
add_action( 'woocommerce_order_status_completed', 'user_role_change_superadmin' );
And this fixed the problem
Thanks @Jacob Peattie
Related Posts:
- Edit Yoast SEO breadcrumbs output [closed]
- Redirect to another page using contact form 7? [closed]
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- Customizing subject in comment notification e-mails
- How to Loop Plugin Option Field Set?
- Saving Plugin settings to the database
- Post source link plugin – small modification
- Add CSS animation as Preloader to WordPress
- How to list the Hooks and order of execution in current loading page? [duplicate]
- HELP: Integrating WP with raw PHP code once published button is hit
- Modifying Footnote Plugin for Descriptive Title Attributes
- I would like to use create a function in my custom plugin to tell WP to use a different header
- How to Replace Words with Hypertext Link But Ignore Previously Existed Links?
- Scope for PHP Variables Assigned in functions.php or a plugin
- WordPress Plugin Page is Loading in Admin Content Container Instead of Separate Page
- wordpress plugin is not activating from widget
- How would I go about creating a user ranked post popularity page?
- How to fetch products with the price in a page on woocommerce using a form or live search with php
- Conditional attributes and logic per product category
- WordPress get_avatar function not correct working
- Check if variable is set in filter
- execute function after one completed
- Plugin onclick button activate other plugin
- Loop in elementor custom widget not working
- Why is it important to check for isset and is_array before checking in_array in this example?
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- Calling a save function from a “submit” button
- same user role or copy the user role to be same as the other role
- Different registration form for different roles
- More gentle way to hook WordPress custom url
- How to add custom function to pluggable.php
- Checkbox show / hide output result
- How to keep plugin (media-sync) running even the tab is closed?
- implement custom roles in custom plugin
- Allow a particular user to access a particular plugin?
- Cookie value changes back to previous value after changing
- Post source link plugin – small modification
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- adding dynamic/multiple slug values in ‘option_none_value’
- Adding discount functionality to the cart
- How to assign a specific service to a specific provider based on location
- Precheck fields when I add a new post
- Rename a folder via HTML POST request
- Move plugin pages from dashboard to front-end
- Is admin section completely customizable in terms of styling?
- Woocommerce list variations that are added already to cart in Single Product
- register_activation_hook doesn’t fire at all
- My ajax request don´t work and return 0
- WordPress environment not loading properly
- Populate select option with JSON file
- Saving an array to get_options
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- How to add a handler for a button in plugin?
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Doing action based on input from options menu
- How use Dynamic hyperlink on each wordpress post?
- What can I do to customize a widget provided with this plugin? from where have I to start?
- WordPress: code structure
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- How to make a Template page to show the information of different things Shop and Product page?
- Mixed results with is_page() WordPress function, when using $this, or self
- Read page- or post-content across different builder-plugins
- Remove and strip html tag values
- Using require_once in a Plugin?
- New Plugin: Post update pushes a copy as a revision
- Placement of Code in Plugin for hooking `save_post`
- WooCommerce get_price returning wrong price when used via ajax
- Open Post Thumbnail in New Child Theme File in WordPress
- Add keywords meta to index.php page
- Executing my function once on a specific time
- What are the specifics of WordPress development I need to know? [closed]
- How to create a custom post type that contains another custom post type?
- WP Query. Is there a maximum size?
- Which file of wordpress manage plugins functionalities?
- JQuery prepend a function
- How to create plugin/ page that reads from database
- I am trying to make a field show and save from quickedit screen
- Send email with list of active plugins upon activation/deactivation
- Add the_post_thumbnail_url to a shortcode in function.php
- Adding a Tag Parameter / Filter to My Shortcode
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- How to upload large media file in chunks, without any plugin?
- How to create admin setting for this small plugin
- How to create algorithm for ordering posts in WordPress?
- How to use Datatable with Ajax when creating plugin on WordPress?
- Showing how many times is plugin activated or deactivated
- Return function results within shortcode
- Form tries to download a file on submit
- insert multiple entries in database using a loop issue
- How to echo a plugin’s function into a template?
- Theme editor removes backslashes
- It possible to implement an adhoc php web application with wordpress?
- Plugin Hook: Get posts
- Multiselect value in wp_query
- How to Overwrite validate_plugin function
- date function not correctly returning date
- I want to remove the register/login WordPress top bar from my website
- How to prevent page load on form submission
- Send email notification when meet the condition