i-make-plugins icon indicating copy to clipboard operation
i-make-plugins copied to clipboard

WordPress Plugins as CPT instead of page

Open Ramoonus opened this issue 12 years ago • 5 comments

by changing a single line from page to a different CPT, its possible to reduce the amount of pages on a site, while moving all WordPress plugins into an extra CPT this cleans up the pages for users with a lot of plugins (like myself)

Ramoonus avatar Dec 29 '13 10:12 Ramoonus

This is already possible. @ipstenu does this, last I checked. Are you asking for this to be the default, or to work without using a filter?

markjaquith avatar Mar 07 '14 22:03 markjaquith

@ipstenu do you have a link for me?

Ramoonus avatar Mar 08 '14 07:03 Ramoonus

Never bothered to post it online, but :

        // I Make Plugins Filters
        add_filter ('i-make-plugins__post_type', 'halfelf_imp_posttype');
        function halfelf_imp_posttype() {
                return 'plugins';
        }
        add_filter ('i-make-plugins__get_plugins', 'halfelf_imp_getplugins');
        function halfelf_imp_getplugins($options) {
                unset($options[post_parent]);
                return $options;
        }
        add_filter ('i-make-plugins__is_plugin', 'halfelf_imp_isplugin', 10, 2);
        function halfelf_imp_isplugin($is_plugin, $post) {
                $post = get_post($post);
                return $post->post_type === 'plugins';
        }

Ipstenu avatar Mar 09 '14 02:03 Ipstenu

@markjaquith is it an idea to change the core from post_type page to post_type plugin?

Ramoonus avatar Mar 09 '14 09:03 Ramoonus

@Ipstenu thanks! this is what I was looking for I have made over 25 small plugins but its ruining the pages management

Ramoonus avatar Mar 09 '14 09:03 Ramoonus