Title: Uncaught Error: Call to undefined function get_submit_button()
Last modified: May 9, 2024

---

# Uncaught Error: Call to undefined function get_submit_button()

 *  Resolved [banana828](https://wordpress.org/support/users/banana828/)
 * (@banana828)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-get_submit_button/)
 * Hi!
 * I have a pretty simple plugin with a WordPress button. I have been using the 
   following code for a while now:
 *     ```wp-block-code
       $button_html = get_submit_button('Register', 'primary', 'submit_button_name', false, $args);
       $button_with_link = '<a href="' . get_option('events_page_registration') . '?eid=' . $row->id . '">' . $button_html . '</a>';
       echo "<p>{$button_with_link}</p>";
       ```
   
 * It works fine in the page when I look at it from the website. But Elementor really
   finds this hard to do, because everytime I try to edit the page in Elementor 
   it shows me this:
 * _Error 500: Click her for preview debug _
 * When I click in the link for preview, it shows me this:
 * _Uncaught Error: Call to undefined function get\_submit\_button() in /var/www/
   vhosts/HOST/DOMAIN/wp-content/plugins/PLUGIN/includes/shortcodes\_event.php:139_
 * Which is the line that uses the get_submit_button(…).
 * Why is this happening all of a sudden? I did get the shortcode inside the page,
   so it worked once.

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Jahid Hossain](https://wordpress.org/support/users/jahidhasan018/)
 * (@jahidhasan018)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-get_submit_button/#post-17744433)
 * It seems like Elementor might not be able to recognize the `get_submit_button()`
   function. This could be due to how Elementor handles the rendering of content
   and interacts with WordPress functions.
 * To troubleshoot, you could try replacing `get_submit_button()` with a standard
   HTML button markup and see if Elementor handles it better. Additionally, ensure
   that the necessary WordPress core files are being loaded properly when Elementor
   is active.
 * If the issue persists, you may need to reach out to Elementor’s support for further
   assistance, as they may have insights or solutions specific to their plugin’s
   interaction with WordPress functions.
 *  Plugin Support [Milos](https://wordpress.org/support/users/miloss84/)
 * (@miloss84)
 * [2 years ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-get_submit_button/#post-17746085)
 * Hi there,
 * Please note that through this channel, we can only provide support for Elementor’s
   existing features and do not provide support for custom code solutions or custom
   plugin code, as it goes out of our [support scope](https://elementor.com/help/how-do-i-get-premium-support/#whatwesupport).
 * Currently, development/custom code queries (custom widgets and functions, Theme
   Child, custom code and CSS, BETA testing issues, compatibility issues, etc.) 
   have to be directed to our [GitHub project](https://github.com/elementor/elementor/issues),
   where our developers will be able to assist. Kindly note that our GitHub project
   is not a support channel; therefore, the response times may vary. We appreciate
   your understanding.
 * To post on our GitHub Repository, follow this guide: [Contribution Guidelines](https://github.com/elementor/elementor/blob/master/.github/CONTRIBUTING.md).
 * I hope this helps. If I missed something, please reply if you have any further
   questions regarding this ticket and Elementor. I’d request that you open a new
   ticket for any other issue; this will allow us to give you more accurate support.
 * Kind Regards,
 *  Thread Starter [banana828](https://wordpress.org/support/users/banana828/)
 * (@banana828)
 * [2 years ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-get_submit_button/#post-17746094)
 * [@jahidhasan018](https://wordpress.org/support/users/jahidhasan018/)
 * Thanks for your your reply. I found a way around it; just don’t use the WordPress
   functionality and create a HTML button.
 *     ```wp-block-code
       $button_text = 'Register';
       $button_class = 'button-primary';
       $button_name = 'submit_button_name';
   
       // Generate button HTML
       $button_html = sprintf(
           '<button name="%s" id="%s" class="%s">%s</button>',
           esc_attr($button_name),
           esc_attr($button_name),
           esc_attr($button_class),
           esc_html($button_text)
       );
   
       $button_with_link = sprintf(
           '<a href="%s">%s</a>',
           esc_url(get_option('klc_events_page_registration') . '?eid=' . $row->id),
           $button_html
       );
       ```
   
 * This is actually generated by ChatGPT. I guess it does give awesome solutions
   sometimes 😀
 * As Milos just pointed out, the support does not… support problems outside Element(
   like plugins and stuff) even though the error only exists inside Elementor. This
   is a common reply I get when I have problems with Elementor. I do try to avoid
   it as much as I can, but sometimes clients need or use it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Uncaught Error: Call to undefined function get_submit_button()’ is closed
to new replies.

 * ![](https://ps.w.org/elementor/assets/icon-256x256.gif?rev=3444228)
 * [Elementor Website Builder - more than just a page builder](https://wordpress.org/plugins/elementor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elementor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elementor/)
 * [Active Topics](https://wordpress.org/support/plugin/elementor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elementor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elementor/reviews/)

## Tags

 * [button](https://wordpress.org/support/topic-tag/button/)
 * [preview](https://wordpress.org/support/topic-tag/preview/)

 * 3 replies
 * 3 participants
 * Last reply from: [banana828](https://wordpress.org/support/users/banana828/)
 * Last activity: [2 years ago](https://wordpress.org/support/topic/uncaught-error-call-to-undefined-function-get_submit_button/#post-17746094)
 * Status: resolved