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
- Filter by custom field in custom post type on admin page
- How can I remove the “Add New” button in my custom post type?
- Calling a Function After New Post Creation for a WordPress Custom Post Type?
- How to remove Filters from post admin page?
- How can I filter posts by post_parent in the admin?
- How do I filter the excerpt metabox description in admin?
- How do I Filter Custom Post Type by Custom Taxonomy in the newest WordPress RESTful API?
- get_query_var() not working in pre_get_posts
- Filter by custom Field for Custom post type Admin Listing
- WP Admin default view mode for Custom Post Type
- Remove wpautop from all posts/pages except my custom post type
- How to create notification on frontend using heartbeat api for multiple custom post types
- Remove date and category filters when editing custom post types
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Make the ‘all’ filter default instead of ‘mine’ in a custom post type
- Exclude custom function content from certain pages
- Filter get_categories() for taxonomy term in WordPress
- Multiple post types in archives (filter?)
- Highlight nav menu terms
- Want to filter only parent post in admin area
- What hook should be used to programmatically create a post only when master post is updated?
- How to register custom post types in a plugin?
- Filters post in admin with dropdown select, custom post type
- Admin List Dynamic Heading
- What is better: Custom Fields vs Custom Taxonomies with Terms for perfomance, scalability and better user experience
- Add $more_link_text parameter to the_excerpt()
- Add html to cpt main page / admin edit.php
- register_taxonomy and register_post_type does not work [closed]
- Filter categories of posts with checkboxes
- Hooking in to an archive page?
- Add custom column in custom post type edit page
- Setting proper query for multiple custom admin filters
- How to query custom post types posts filtered by multiple custom taxonomies through a form selection
- How can I see a list of my Custom Post Types of the last term I was in?
- Posts are duplicating on wp_post_update
- Categories of custom taxonomy don’t show any posts
- How to filter wp_list_categories output with some custom post type meta query?
- How to Filter custom post type by taxonomy?
- creat filter with wp_query
- A method for ordering mixed dates in search result loop (theory only, no actual code)
- Filter hierarchical custom post type admin page by parent, and include children & grandchildren
- Versioned Custom Post Type (Not the same as revisions)
- Categories filtering in new post
- Add a custom text to admin footer in a Custom Post Type page
- wordpress remove views from action links in a custom post
- Custom Meta fields Update hook?
- wp_trash_post action hook with custom post type
- Filter posts by tax (dropdown) and meta value
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- providing access to post_id or post inside functions.php
- Make a custom column sortable by a value from a different custom post type
- comments hooks on custom post type
- How to prevent meta data from being edited in a post?
- How to recover the post ID earlier in the WP admin hook action “firing” sequence?
- Is possible register two archive pages for single custom post type?
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- Query filter by value in meta_value array
- Using `set_transient()` when saving a custom post type
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- WP Admin Dropdown List Filter for custom (ACF) field on custom post type(s)
- Add html tot CPT edit screen – no metabox
- In child theme, add CPT to custom taxonomy registered in parent theme
- Display category filters for custom post type when category is shared by multiple post types
- Changing CPT permalink
- Create Post Types from a XML url (Real Estate website)
- Sort custom post archives by a meta value from a different custom post type?
- Post meta is not accessible within save_post hook
- Correct way to register custom post type from external php file?
- How to save post_status using action save_post?
- Keep br tags from stripping
- Custom meta box data not saving
- Add filter button to custom post type in admin area
- How to hook save-post function to use taxonomy term in post-slug?
- Custom Fields as Post Type Options
- Dropdown switching subcategories portfolio
- Generate slug and meta data if meta field is empty
- Problem with ‘save_post’ hook not running
- Customizing a plugin function using a hook
- Filter custom post type by tags
- Filter page ID outside the loop and order
- Paginate yearly archives for a custom post type
- coloring row’s background based on custom field value