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
- How do I call wp_get_current_user() in a plugin when plugins are loaded before pluggable.php?
- 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 “
- Display a text message if the field is not found and not if found
- 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
- wordpress plugin is not activating from widget
- 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?
- WpDataTables – View Image Directory
- 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?
- WordPress get_avatar function not correct working
- What is @Action in WordPress?
- pagination on data fetched using SQL query
- Check if variable is set in filter
- Cannot get wpdb data (Error in a simple fuction) [closed]
- Notice: Uninitialized string offset: 0 in social sharing mu-plugin
- Using ‘mysqli_connect’ ‘crashes’ WordPress client-side
- JQuery prepend a function
- Why can’t I call a (member) function from within a foreach?
- Are there action hooks for comments?
- Help with WP Business Directory Manager Plugin?
- wp_enqueue_scripts
- Return multiple values in a shortcode attribute
- get specific value of a array | PHP
- How to make a dynamic css class whose name changes every visit to confuse scraper
- Plugin onclick button activate other plugin
- Send email with list of active plugins upon activation/deactivation
- Using custom fields for image alt and title
- Add the_post_thumbnail_url to a shortcode in function.php
- Different registration form for different roles
- Adding a Tag Parameter / Filter to My Shortcode
- Check against server time to display SQL entries – Radio Station DJ Rotator Plugin
- WordPress Cache delete on plugin uninstall
- add_rewrite_rule to load different page, without changing URL in browser
- WordPress Custom Hook with Class method
- Allow a particular user to access a particular plugin?
- Cookie value changes back to previous value after changing
- How to get database connection details without longing to cpanel in WordPress?
- Post source link plugin – small modification
- Share my WordPress plugin for updating how?
- How to create algorithm for ordering posts in WordPress?
- Submitting form to PHP
- Adding discount functionality to the cart
- Precheck fields when I add a new post
- Get Shortcode output to database for static post_content
- working code, not working – Plugin Dev
- Block plugin update possibilities (but not by hiding notifications)
- Change custom rewrite rule when permalink is updated/changed
- Return function results within shortcode
- Configuring default woo commerce login with modal popup
- Soflyy WP All Import Custom File Download Issue
- register_activation_hook doesn’t fire at all
- Update (a function) post’s featured image as soon as $image_url changes
- get/show Last ID
- My ajax request don´t work and return 0
- Populate select option with JSON file
- How to echo a plugin’s function into a template?
- Find all strings between an enclosing shortcode
- It possible to implement an adhoc php web application with wordpress?
- Create csv file in plugin
- Contact Form 7: custom validation [closed]
- date function not correctly returning date
- How to disable register and reset the password from WordPress admin panel?
- How use Dynamic hyperlink on each wordpress post?
- How to prevent page load on form submission
- WordPress: code structure
- PHP if url extension action=discussion condition use [closed]
- Adding a script & php to functions.php
- Option value not getting updated until page refresh in WordPress
- Make plugin admin page visible to other roles
- Sort posts by Date (DESC) and by ACF: active_inactive (ASC)
- WordPress Custom Page Blog Template Pagination Problem (Pagination Not Displaying)
- stop resize button for wordpress media
- Mixed results with is_page() WordPress function, when using $this, or self
- Read page- or post-content across different builder-plugins
- Remove posts that start with similar words (like a delete duplicate posts plugin)