From what I see is the issue within your code.
Your issue is that you try to fetch the post type in your nested if-statements from the current post, even though at the first if statement, you validate against it and break the function.
What you want to do instead is to validate the post type against the $client_id variable.
$client_parent = get_post( $client_id );
$post_type="";
if( ! empty( $client_parent ) && isset( $client_parent->post_type ) ){
$post_type = $client_parent->post_type;
if( $post_type === 'note' ){
//run your logic
}
}
In case it’s still not working, you might want to take a look at the documentation of the update_post webhook action.
Related Posts:
- How can I fetch data from another website to my wordpress website with mysql database
- PHP Creating a formula from mysql db values and db stored math operator
- Plugin update error message
- How to Loop Plugin Option Field Set?
- Can we completely remove the WordPress Sitemaps (WordPress 5.5)?
- Set a User as Author of all ‘New Posts’ posted
- Post source link plugin – small modification
- Change destination author link
- HELP: Integrating WP with raw PHP code once published button is hit
- How to redirect Old Post URL to new Post and keep Old post Comments?
- 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
- New Plugin: Post update pushes a copy as a revision
- bulk change of image setting “link to” to “link to: image url “
- Scope for PHP Variables Assigned in functions.php or a plugin
- How to get post URL in the_content filter?
- How to write one comment and publish on every post using database or plugin?
- How to get number of Affected rows from wordpress dbDelta() function
- add_query_arg not working
- Executing my function once on a specific time
- How to stop or remove an action being called inside a function of an extended class
- Theme my Login plugin, how to update fields
- How to simultaneously access the same MySQL database in the main column and sidebar of WordPress?
- Date calculations from 2 custom fields
- How to enable specific plugin only based around shop manager role?
- get current date + 90 days and checking every day
- Adding a new field to the address field type in gravity forms
- Nested shortcode functions accessing variable
- Customize permalink wordpress category id
- WP Query. Is there a maximum size?
- Redirect to another page using contact form 7? [closed]
- Load Javascript from Plugin in One Page Only?
- Checking the count within a foreach loop
- execute function after one completed
- wp_dequeue_script for a Plugin
- Need to replace Currency Shortforms
- WordPress Stock Update Programatically
- How to translate wordpress error message
- Api external with wordpress
- All custom widgets are not showing in widget area at the same time
- speed up pagination for huge database
- Way to send multiple values for column to MySQL?
- same user role or copy the user role to be same as the other role
- More gentle way to hook WordPress custom url
- How to display results from a data table with an encrypted user id?
- Can you echo PHP code from a variable?
- add_action for publish_post doesn’t work
- Checkbox show / hide output result
- need to find duplicated meta value in custom filed and view the posts that have the same value
- Custom Logo Link WordPress
- How to convert Currency from USD to other IP Based currency in Php function
- Getting current user data with MySQL statement
- how to validate input field in wordpress generated with wpform plugin
- implement custom roles in custom plugin
- How to get current cart values using WC_Shortcodes?
- Attempting to list all product categories and the price range of all products within them
- Cant create table on plugin activation
- Creating an array from form inputs before it is posted to the options database
- Custom Plugin: How to Include Install Buttons of other 3rd Party Plugins?
- adding dynamic/multiple slug values in ‘option_none_value’
- How to assign a specific service to a specific provider based on location
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- Easiest way to load/fire a handful of functions, IF checkbox is checked?
- Moving a few select DB tables to a new WP instance
- post id or permalink auto-incrementing number and reset everyday
- Is admin section completely customizable in terms of styling?
- How to make the first letter of a post title uppercase, in a plugin?
- Compare Ajax Data Results
- How can I make the search bar in my wordpress site search all of the pages rather than just the blog posts?
- Migrating custom php we wrote from functions.php into a site-specific plugin
- Nested DIV’s across functions in PHP, do not seem to work
- WordPress environment not loading properly
- Every time I use wp_get_current_user() my plugin breaks
- Cannot access variables within a widget
- Is there any wordpress function to update a random post every 10 minutes?
- Posting code inside the post instead of in the template file using shortcode
- WordPress function to add text
- Saving plugin data returns “You do not have sufficient permissions to access this page.”
- Metabox Data not saving
- 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?
- MySql Query for WordPress
- Doing action based on input from options menu
- Including a PHP file via a function that is part of a plugin?
- Move related products after product summary? [closed]
- How to tweak a plugin without preventing it from updating
- is_plugin_active() not defined on active plugin, in the thumbnails.php file
- how to search through plugin in wordpress cimy-user-extra-fields?
- Adminimize Plugin — Is there an alternative to limiting Editor to ‘Appearance > Widgets’ only?
- Integrate Razorpay quick payments plugin with contact form7 plugin
- Woocommerce disable checkout on specific day
- Requires PHP version 5.3.0
- 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?
- WordPress Convert queries to slashes using function.php
- How to change all the urls of the WordPress site?
- Split Million WordPress Post’s Into Multiple Database Server
- Getting 504 Gateway Timeout Error on AWS Server! [closed]
- WordPress issue – data is not showing in wp-admin, but when searching through database, all the data is there
- I want to allow certain file types on dokan upload files