I got it working with this! 🙂
function update_on_product_save($product_id) {
global $product;
$product = wc_get_product( $product_id );
$product_title = $product->get_name();
$product_image_id = $product->get_image_id();
Related Posts:
- Error Warning: Declaration of description_walker::start_el after PHP upgrade [duplicate]
- Mega Menu Walker
- Displaying Logged-In User Name in WordPress Menu
- Autoloading in Child Theme
- How to add a class to the attachment images
- Set media upload attachment link to none and hide it in WP v3.5
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- How to add default images into theme customizer image control?
- Is $hook a global variable in WordPress
- Successful or Error Message after running mysql code in functions.php
- How can one utilize a variable as a callback function name for add_settings_field
- Change logo based on incoming domain
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- Include a php file from functions.php only to homepage
- How to restrict page access to logged-in users?
- Count the number of times the search form template gets included on a page
- PHP code inside shortcodes
- Handling Body class based on Template
- Adding Default Settings to Theme My Login plugin
- Remove meta description on certain pages
- Image media upload metabox
- Get post id in a function when edit/add a post
- function to assign user role based on a field from usermeta
- Woocommerce related product text
- esc_html_e() is not translating string in wordpress [closed]
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- WordPress Gravatar filter is removing my custom attributes
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Limit 1 global comment per minute
- Remove echo from shortcode
- Copyright info change – Corporate Plus Theme PHP [closed]
- Inject class in body when particular page template is used
- Echo a function inside a function
- Use WordPress function in php file
- How to list posts from a plugin taxonomy?
- wp_force_remove_style’ not found
- Filtering a function’ output for a new continued function
- Pagination on Custom Post
- Shortcode to find and replace URL
- Deleting Certain terms from appearing on the front end as links
- first instantiated SimplePie object cosumes 5mb?
- Theme not calling Jquery properly
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- WordPress redirect redirecting too many times or not at all
- how to save checkbox data for custom setting?
- How to keep the capability of users and disable Gutenberg editor in WordPress?
- Add value to new attribute inside WordPress menu items
- Please show me how to use an if/else statement in combination with wp_enqueue
- If Array Values Match Another Array’s Values, Then
- Enqueing External JS on the remote server JS
- Open and closed function [closed]
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Else/If Statement to Display Photo Descriptions
- Count foreach and display in menu php
- How to add aria role and schema markup to custom walker container
- Remove submenu item from list
- Display additional page templates and a sidebar on plugin activation
- Customize field names in backend profile edit page through function.php [duplicate]
- Insert content into head tag with function
- Remove role of user after X days
- User filter posts by year
- bp-custom.php is not working on a WordPress multisite environment. how to fix it?
- Getting text from custom field from customizer
- Add a Metabox checkbox to the Page Edit screen of wp-admin , which only certain roles can see and Makes only certain roles able to Edit said page
- Adding wp users ID into a link address from a DIVI modul
- Execute function only for specific user roles
- if get_post_meta is empty echo a placeholder or shortcode
- Limit Search to Product Pages only unless I’m on Blogpage or Blogposts
- WP query posts BUT show the most recent and one per author
- Block error message in foreach loop when looping through ACF field
- Include User ID in iFrame URL
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Wp_Schedule_Event every few minutes doesn’t work
- PHP multiple forms, same page, isset($_POST[]) not working?
- Outputting post content to jQuery .html() string
- shortcodes, custom php and their errors
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- How to center all text body in single.php at once?
- Remove node from multisites?
- How to include a function in a template with template tag
- wordpress all post filter by year
- Add ID to output only for first option
- How to add custom text near category/tag title in WordPress Twenty Fifteen Theme?
- Display text of price (minus 20%) on every product page in a sentence.
- How do I get the featured post to share on Social Media and show on Individual Post pages?
- Pulling a variable into the wp_nav_menu function
- How to make 2 similar functions more efficient
- Echo multiple tasks if a common function exists
- Add end mark at the end of every article
- A Customizer checkbox control that sets the setting to “” or to “blank” and show() or hide() a color control
- Global variables and re-use
- Issues separating my Plugin pages into different files
- AJAX: WordPress filters inside $html do not work as intended
- Problem with function.php.. like
- Echo get_option displays as text
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- /page/2/ redirect to 404