Apply a custom Template to a Custom Post Type from within a plugin

Here you are – a plugin that is registering a Custom Post Type (CPT) and pushing template file from the plugin for that particular CPT. <?php /** * Plugin Name: WPSE352898 Template Test * Author: Mayeenul Islam * Author URI: https://mayeenulislam.github.io */ /** * Register My Custom Post Type. */ function wpse352898_register_cpt() { register_post_type(‘mycpt’, array( … Read more

Delete Plugin Options with Verify

There are various opinions on this, but generally, if you’re “deleting” (as opposed to simply “deactivating”), you don’t necessarily need to confirm it. However, you certainly could. The general approach to that is to include a setting to remove all settings upon delete or not. Let’s say it’s a checkbox in the plugin’s settings to … Read more