Shortcodes Are Not Properly Working Inside Of WooCommerce Endpoints
I am using WP Job Manager plugin (with some addons for it) and WooCommerce. I want to combine both plugins user dashboards, so all the user functionality will be inside of a user WooCommerce my account:
- Dashboard
- Orders
- Address
- Account Details
- (custom endpoint) Jobs
- (custom endpoint) Bookmarks
- (custom endpoint) Job Alerts
- (custom endpoint) ...
- Logout
The problem is that WP Job Manager and it's addons shortcodes are not properly working insider of WooCommerce endpoints. I suspect that it is not only related to WPJM but this is a general thing here that brakes it.
Example 1. There is a WPJM addon Job alerts. When inside of a custom endpoint I click "cleare jot alert", page reload with the form for creating an alert. When I click "Save alert" - page just reloads with the same data I entered. Alerts did not created.
After submit for just reloads and no alerts created
Example 2. Action links also not working - I have a job list dashboard shortcode. It display jobs list with action like, edit, duplicate, delete... When I click any of those page just reloads without any result.
Overall I feel like the submitted data can not be processed by the WP Job Manager and it's addons. All those shortcodes are working properly on the usual WP pages.
Waht can be the reason?
Answer
I found this piece of code in the plugin:
public function shortcode_action_handler() {
global $post;
if ( is_page() && strstr( $post->post_content, '[job_alerts' ) ) {
$this->job_alerts_handler();
}
}
specifically this part is what stopping the pluginto continue
strstr( $post->post_content, '[job_alerts' )
After commenting this part plugin now works inside of the endpoint. Possible solutions is to remove this action. Or replace with modified one that accept WC endpoint.
Related Questions
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?