I've been working on my first WordPress plugin, and it functions, for the most part. However when I activate the plugin, the edit page screen gets all messed up. I attached a screenshot.
Now I think I understand why, but I'm not sure how to fix it. I've set the plugin up as a price quote form, and if the user places the shortcode in the text editor, it will show up on that page. However, everything that goes with the shortcode is also showing up on the 'edit page' screen, like in the photo I shared above.
Here is a snippet of code that shows the issue. I condensed this of course, but this is giving me the same result. The 'Hello World' and the Lorem Ipsum is still showing up on the edit page screen like in the screenshot.
<?php
function price_quote_display () {
?>
<h1>Hello World</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus laoreet sit amet felis nec molestie. Ut porttitor neque nec metus feugiat tincidunt.
</p>
<?php
}
//function calls html from shortcode
function register_shortcode(){
add_shortcode('price-quote','price_quote_display');
}
//sets up and calls function that contains shortcode
add_action('init', 'register_shortcode');
?>
Any idea why the HTML inside the priceQuoteDisplay is showing up on the edit page screen? Thanks for any help.

add_shortcodeviaadd_actionon init which could be too early. In any plugin shortcode I've written, I've just included theadd_shortcodedirectly after I declare the function (i.e. don't hook into anything) because the plugin will only load when WP is ready for it anyway. Another thing to try is returning the contents from yourpriceQuoteDisplayfunction instead of displaying it directly (although I thought you should be able to do it your way).add_shortcodebut tried theadd_actionas a desperate attempt. So that still isn't working. If I have a bunch of html that I'm outputting (and entire form), how could I return all of that?