As far I understood you want to assign the order number like $order_number = order_generator($email) inside the widget class.
Yes, you can do it that way unless the order_generator is in another class. If you order_generator function is in another class then first you need to instantiate the class then call the method like $instance_of_your_class->order_generator($email).
Hope that helps.
Related Posts:
- How to store the_title() into a variable to reutrn the value, not just echo it
- How do I make my function add variables/values to the $post object?
- How to get the registered sidebar’s name by its id?
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- display most popular tags in two columns
- How do I know what variables are passed in a filter/action and what their meaning is?
- WordPress menu deletes when trying to add a hook
- Get widget settings function?
- javaScript in section of WP API
- Add before_content and after_content to register_sidebar
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Count the number of times the search form template gets included on a page
- Get value from shortcode to do something
- Adding a widget function into the php theme file
- Widget back end radio button issue
- Creating WordPress Shortcode with Variable
- My website is not showing Footer section
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- How to reference PHP in Javascript
- Overide Variable in Child Theme
- How to get post category list as select in front-end?
- Show different website layout if no sidebar added
- Add a select-option to the default widgets
- How to send a php var to jQuery Ajax call with two different file
- How a HTML form can trigger a PHP function?
- Custom global variable not working in function
- Best way to use variables in multiple functions?
- Trying to add some custom text into WordPress Post title via function.php
- How do I fix Undefined variable using $_POST in function?
- is_user_logged_in() not working in homepage
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- Add disclaimer before certain posts and pages
- Pulling a variable into the wp_nav_menu function
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Where can I find the declaration of `$_wp_theme_features`?
- WordPress – registering sidebar and adding a button directly after .textwidget
- List sibling pages widget, exclude current page
- WP Debug enabled Undefined index error in a widget
- How to access admin menu labels and links on front-end?
- How to get default variation ID (woocommerce)
- Get check box values inside array for use in posting form data
- How to register images uploaded via FTP in media library?
- how to get permalink structure with php
- Woocommerce auto cancel On-Hold after X days
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- Enqueue less file not working in child theme?
- Show last 5 posts from specific category
- How can I loop into two different DIVS without repeating the DIVs
- Removing unnecessary wordpress files
- Change links automatically to affiliate links
- Use is_product_category() properly
- Theme Options: If There is No Input, Don’t Display?
- Placing raw HTML inside a WordPress shortcode
- Changing Woocommerce flat rate every nth number of items
- Convert all images to PNG on file upload
- If search results empty then execute certain code
- Way to querry data (tags) from a wordpress database?
- Automatically adding new post categories to menu
- Get post id in a function when edit/add a post
- function to assign user role based on a field from usermeta
- get author_name from queried post
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Alter required message using comment form api
- Why does this update_post_meta function not delete the custom field itself?
- WordPress function and string as variable?
- Detecting if parent page has gallery
- Help with WordPress function inside a shortcode
- Get access to variable from previous pageview, excluding ajax-calls
- Removing “Powered by” footer using child theme PHP [closed]
- Store and Change Session variable – PHP SESSION VARIABLE
- How to style injected code in header section?
- Include a file that has a function in it
- Execute Jquery when a specific page in my plugin is loading
- SQL error with custom query
- How do you create a custom category widget that you can style?
- How to preload header logo image in WordPress? like what’s the code and where do I put it?
- Contain multiple page templates in one PHP custom template file in WordPress?
- How do I reopen the (Popup Maker) after entering the correct password for a password protected page?
- Display metabox galleries on specific page template in admin editor
- Custom plugin: how do I call a PHP file if settings option is set to true?
- Inserting a class on before_widget if checkbox is checked
- How to put 2 php codes in functions.php without site crashing
- dashboard widget form not submit mails
- How to change order inside foreach using wp_enqueue_script?
- How do I get the value of a current user’s custom field?
- Adding extra data to shortcode attributes and pass it to JS with wp_localize_script
- How to make a “page-option” in WordPress
- Allow Comments by Default for Multiple Post Types
- How to get User Avatar Image with link to Author and User name in Html Title tag?
- WP HTTP API call response
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- How to get all users by user_login as a json_encode array?
- Postmeta not saving
- Hide the content before the more tag in the “single page”
- how to loop through blog posts in php
- Add multiple HTML attributes to an Elementor button
- /page/2/ redirect to 404
- How to pass value to add_filter wpcf7_form_tag from another function?
- require used as a function to load theme dependencies?
- Filtering with Attributes – how to display all non-queried products below query