If you want to trigger some action when a post is published or edited, you can have a look at the save_post
and edit_post
actions.
You could easily hook in the edition process, modify your post data if needed, and save it again.
function myplugin_save_post($post_id, $post) {
// $post contains the post itself
// so you can check the submitted data and see if you need to update it
// $post->post_title is what you are looking for
// call your script to get the music data
// save the data in the wp_postmeta table so you can retrieve it later
}
add_action('edit_post', 'myplugin_save_post', 10, 2);
add_action('save_post', 'myplugin_save_post', 10, 2);
Related Posts:
- Customizing subject in comment notification e-mails
- How to Loop Plugin Option Field Set?
- Saving Plugin settings to the database
- I would like to use create a function in my custom plugin to tell WP to use a different header
- 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
- Edit Yoast SEO breadcrumbs output [closed]
- Conditional attributes and logic per product category
- WordPress get_avatar function not correct working
- Redirect to another page using contact form 7? [closed]
- Check if variable is set in filter
- execute function after one completed
- Plugin onclick button activate other plugin
- 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
- Allow a particular user to access a particular plugin?
- Cookie value changes back to previous value after changing
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- working code, not working – Plugin Dev
- Is admin section completely customizable in terms of styling?
- 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?
- 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?
- if plugin is active? check if plugin is enabled or not?
- Making plugin unique to not conflict with plugins with the same name
- How to find out if option exists but is empty?
- How to pass JavaScript variable to PHP in wordpress widget?
- Unable to add admin notice on plugin activation
- Errors while using ajax from external wordpress page
- shortcode doesn’t work
- WordPress plugin installation
- Can wp_script_is used in pluginA check if a script is being enqueued/registered from pluginB?
- Create or Update thousands of woocommerce products via PHP
- send_headers don’t work on wordpress multisite
- Update Option Error: Notice: Undefined index
- Self deactivate plugins after an action occurs
- How to periodically scrape and cache strings from remote txt files. – My First Plugin
- Avoid class name collision when using third party libraries in plugins?
- Using a custom plugin to capture input data via Ajax and PHP
- Display post lists in 2nd paragraph
- creating html reusable blocks via shortcodes
- Replacing a plugin function with a custom renamed function doesn’t work
- How to output CMB2 select options from repeated groups select elements?
- How to deal with WordPress and Pocket API to automate content curation on my hosted wordpress blog? [closed]
- WP All Import – Execute Imports
- Which file of wordpress manage plugins functionalities?
- JQuery prepend a function
- Add User Role: Pre-saved in User-Meta [SOLVED]
- How to make a dynamic css class whose name changes every visit to confuse scraper
- How to create plugin/ page that reads from database
- Send email with list of active plugins upon activation/deactivation
- How WordPress core manage the plugin installation
- Using custom fields for image alt and title
- 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
- WP Function does not trigger on Webhook API Call
- Post source link plugin – small modification
- Problem with checked box on wp car manager plugin
- How to create algorithm for ordering posts in WordPress?
- update_post_meta is not working for me when I use e.preventDefault for update button
- Block plugin update possibilities (but not by hiding notifications)
- Woocommerce list variations that are added already to cart in Single Product
- Soflyy WP All Import Custom File Download Issue
- WordPress Admin sub-level menu issue
- Update (a function) post’s featured image as soon as $image_url changes
- Plugin communication between sites that use it?
- Passing ajax variable to more than one wordpress plugin function
- Displaying friend’s posts only
- Theme editor removes backslashes
- Why isn’t my plugin seeing other classes?
- How to add submenu to WordPress plugin in the same Directory of main Plugin?
- Plugin Hook: Get posts
- Contact Form 7: custom validation [closed]
- What can I do to customize a widget provided with this plugin? from where have I to start?
- PHP if url extension action=discussion condition use [closed]
- How to add custom html to the Media > Attachment Details modal?
- Option value not getting updated until page refresh in WordPress
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- How to override plugin function in code snippets WordPress
- How to create a “Most Popular” & “Latest” TAB in WordPress
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode
- Use inline callable for hooks and filters
- Error in using ‘admin_enqueue_scripts’ action through a class