wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
665 stars 144 forks source link

Remove unused method for fetching preview of single shortcode #764

Open goldenapples opened 6 years ago

goldenapples commented 6 years ago

Following on from https://github.com/wp-shortcake/shortcake/pull/743#issuecomment-311819095

Removes the unused "fetch()" method from Shortcode View constructor (it was confusingly making a request to the 'do_shortcode' ajax endpoint, which was removed a long time ago). Also removes the nonce which is set with each separate query in the bulk_do_shortcode request - since #743, a single nonce is being sent as a top-level field on the request and is being checked by the 'bulk_do_shortcode' endpoint.

This is causing some test failures, because we have specs still testing the shortcode constructor.fetch() function. There's no reason to test this function since its no longer used, but I didn't want to remove the tests without replacing them with tests that cover the .delayedFetch() function, and that will take a bit of thought.