WordPress post “saves” work by posting, processing, and redirecting back to the originating page. Put a die
after your error and you should see your errors when appropriate. Without that, the page redirects before you see the error message.
In my opinion you would be better off turning on debugging and writing to the error log.
catch (Exception $e) {
error_log($mySforceConnection->getLastRequest());
error_log(echo $e->faultstring);
}
vancoder is correct that this is mostly a PHP problem, but given that I believe the issue to be related to WordPress’ post/process/redirect pattern I thought an answer was in order. If I am right, that should straighten out the confusion.
Also, save_post
runs after most of the post data has been saved so if you need to interrupt the primary save this is not the hook.
Related Posts:
- Adding a drag and drop re-ordering from a custom post type default list [closed]
- Filter for “get_post_type_archive_link()”
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- Remove “Get Shortlink” button in admin of custom post type
- Modifying date filter on admin page for custom post type to link to custom field
- Why is conditionally loading a custom plugin’s code only on a specific custom post type causing the site content to disappear?
- Filter Posts from the Main Query
- How can I add a filter to a particular post format?
- Is there any way to get list of all possible filter hooks for all post types?
- sortable columns for multiple custom post types not working
- How check if a post is saved from backend or frontend?
- Best way to fix bad count on All | Mine | Published
- Store a value in global scope after init hook is fired
- Dynamic page for nav items used as filters
- Adding Information To All Posts Screen
- Filter Content on all Post Types
- Hook only specific post type
- Change CPT Edit Target Link for Admin List
- Custom post type template not loading from plugin
- How to add a post slug to a url?
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- WordPress sort search results by custom order
- How to filter wp_list_categories output with some custom post type meta query?
- How to Filter custom post type by taxonomy?
- Filter term taxonomy metabox in custom post type
- creat filter with wp_query
- Troubles with acf/save_post and WP_Query
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- How can I made custom taxonomies relationship?
- WooCommerce sort products by the actual product width(not the shipping width)
- How to change the post type a theme shows by default?
- Limit number of custom posts per taxonomy
- filter custom post in rest api with custom function
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- Sort and filter custom post type posts by custom taxonomy
- Versioned Custom Post Type (Not the same as revisions)
- Loop filtering Custom Post Types and/or Categories
- search suggest – filter post type
- the_content filter on some post types only not working
- Filtering posts list table
- CPT Validation to not show “Post updated.”
- Custom filter function not working with Custom post type
- Categories filtering in new post
- How to use manage_$post_type_posts_columns with underscore in post type?
- How does the filter post_updated_messages work?
- Search filter triggered & sort by custom post type
- How to order posts of a custom post type by date DESC in dashboard Admin?
- save_post custom post type ? $_POST not working?
- Categorise Custom Post Types
- Custom Post Meta from custom metaboxes is randomly being deleted
- Can I display custom post types in home.php or need page template?
- Create new custom post and post category of same name
- Add a custom text to admin footer in a Custom Post Type page
- wordpress remove views from action links in a custom post
- Get rid of “trash can” for custom post type
- Mutiple Select only POSTing 1 value
- wp_insert_post wrong post type [closed]
- Custom Post Type Metadata Not Saving
- detect when a custom post is cretaed for the first time
- Use remove_meta_box conditionally on custom post type
- Custom Meta fields Update hook?
- wp_trash_post action hook with custom post type
- Filter posts by tax (dropdown) and meta value
- How do I amend form data before it is saved for a custom post type
- Add an Outside Wrapper to my Header and Make it Full Width
- What do the numbers mean at the end of add_action(‘save_post’)…?
- How can I remove filters from custom post types?
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- How to detect that the save_post hook is calling the callback associated to the current edit post page only
- How do I add custom HTML to the content of an archive page’s posts?
- Only show posts with a specific term of an associated taxonomy in a custom post type archive
- REST filters only firing when I have a param set
- How to build a WordPress post review system beside commenting
- WordPress hook after post content and meta update
- ACF for custom post type archive pages: which hook to use?
- WordPress hook which triggers on post import
- Assigning alternate single-{cpt} template based on blog_id in multisite
- providing access to post_id or post inside functions.php
- Before saving post hook
- Problem with Apply Filters on URL in meta box filed of custom port type
- how to retain the ability to modify the post slug after applying a post_type_link filter?
- How do I show a link or ‘Read More’ button on a custom field excerpt when it is less than the word limit
- How to filter url on post submission?
- Creating alternate meta box context locations
- How can I edit comment meta value before it is saved?
- Make a custom column sortable by a value from a different custom post type
- Modifying WP_Title For Custom Post Type
- Filtering the_content, but still need to display the unfiltered content inside filter
- wordpress post_where set only for my costum post type
- Change Custom Post Type singular_name through function/filter
- Modify a plugin function output from another plugin
- comments hooks on custom post type
- Custom Taxonomy Filter Issues
- How to prevent meta data from being edited in a post?
- show most viewed posts of last days by link?
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Filter search posts by post meta?
- Modifying search results based on post_type
- Remove filter and view options from custom post type edit screen
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?