Take the file the custom post type is registered in, put it in the plugins folder, and add a comment at the top, e.g.:
<?php
/**
* Plugin Name: David A. Frenchs Custom Post Type Plugin
**/
Save and visit the plugins page to activate it, and that’s it! A plugin is just a file with a comment at the top. You can put it inside a folder and include other files into your plugin too, WP will search for the comment at the top of the file and load that one.
Just remember to prefix your plugins name, if somebody else has the same idea and uploads a plugin with the same folder/file name to wordpress.org it’ll trigger the updater
Related Posts:
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- How to show an image popup when one clicks on an image thumbnail?
- Uninstall, Activate, Deactivate a plugin: typical features & how-to
- How do you debug plugins?
- Add multiple plugin directories
- What are the differences between WPINC and ABSPATH?
- Where do I put the code snippets I found here or somewhere else on the web?
- Giving Multiple Authors Access to a Plugin’s WP.org Repo
- Add section (add_settings_section) to a custom page (add_submenu_page)
- Creating a default Custom Post Template that a Theme can override
- Can i create two tables at single time while installation of custom plugin?
- How do I check if my $wpdb->insert() was successful?
- Creating a theme option page?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Add post thumbnail from external image with plugin
- How does WooCommerce display a custom comment_type in Comment Admin?
- Is it possible to add an action to the currently running action?
- Created Widget Not Showing up on Admin Panel
- How to display public user profile with 2 additional fields? (GitHub source code included)
- Action on post publish
- OOP: Display warning and deactivate the plugin if PHP version is less than 5.4
- wp_enqueue_scripts not working inside shortcode
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- unzip a folder on specific location and delete the zip file
- Handling jQuery Component Collision
- Scope for PHP Variables Assigned in functions.php or a plugin
- How do I write into a file (css)
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Where should I save an API key of my user when installing my plugin?
- How to make a customize role and view a specific plugins base on that role?
- Allow users of my plugin to define their own shortcode rather than use mine?
- CRUD and Frontend show from a custom table without shortcode
- Map Custom Registration Fields to WordPress User Roles
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- Add Plugin options as subpage to Theme options page
- Image upload and download from front-end
- custom payment gateway in woocommerce failed to connect to remote api server
- correct way to include a library(and its dependent libraries) in wordpress development
- Issue Tracker from pre exsisting table [closed]
- Removing an action from wp_footer called in a class that’s inside a bigger class
- Ajax call returning 0
- Git Hosting for WordPress SVN Plugin Repository [closed]
- WordPress plugin admin html being shown in Customizer iframe
- WordPress Widget – Saving multidimensional arrays into $instance
- Plugin Options not being output
- Stop Plugin from Getting Styles from Other Plugin
- Default taxonomy template in plugin, override in theme
- Fullscreen gallery plugin [closed]
- How to add support for caching plugins for my own plugin?
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- wp_loaded with static Singleton
- How to remove a CPT Menu from the Root Admin only
- Get post_id on clicking a link in WordPress
- WordPress.org: How to add a plugin for certain countries?
- How to remove menus items from Menu section from WordPress theme customizer
- Wp Debug Enabled True Notices and Warning
- Plugin generated unexpected output – No PHP errors
- Extending a theme: build new features as plugin or core modules?
- Plugin generating unexpected output – on WP mysql dump import
- help intercepting save_post through plugin
- best way to run a php script away from the template?
- Scrape key check failed. Please try again
- Add a new category for posts
- How to save Setting pages data to the database?
- Prevent WordPress from sending set-cookie http header
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- how to auto random increment for post view
- Woocommerce convert simple products to variations
- Block content rendering on the top just below body tag
- WordPress Thickbox Navigation Issue in Gallery
- How to save the option’s new values plus old value without overwrite old one
- Not displaying Woocommerce product page in lightbox
- WordPress “template_include” Filter Not Working
- WordPress Media Uploader : How to add custom button on featured image tab
- Change pricing in Woocommerce based on Category and Product [closed]
- Can we validate data from jquery
- WordPress not displaying information on post sent from custom admin form
- Re-writing MySQl query for execute faster
- Getting error “The package could not be installed. PCLZIP_ERR_BAD_FORMAT ”
- Building a simple “settings” plugin to change textstrings on the home page
- Couldn’t find a documentation for a filter API in plugin development
- My wordpress website admin panel loads very slow, what can i do about that? [closed]
- WordPress Customise
- register_activation_hook not working
- Predefine Product Variations for specific custom product type [closed]
- Create plugin with multiple blocks
- WP Elementor Pro causing crtical failure on website
- Function not being called on form submit, only blank admin-post.php page
- How do I set register_meta for a specific CPT?
- How to Enfroce Domain Licensing Limits? [closed]
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Update Content for a Custom Block Toolbar Button
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Uncaught Error: Cannot use object of type stdClass while showing the list using WP_List_Table
- How to give specific class name to category in wordpress with code snippets
- Submitting form to admin-post.php WordPress
- WordPress Throwing Deprecated Errors on its own Files
- plugin doesn’t retrieve data from database
- Display Any Field fromAdmin Panel in Frontend via Shortcode?