markjaquith / i-make-plugins

#WordPressPlugin: For plugin authors. Showcase your plugins on your WordPress site. You only update your readme.txt files!
19 stars 9 forks source link

WordPress Plugins as CPT instead of page #9

Open Ramoonus opened 10 years ago

Ramoonus commented 10 years ago

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)

markjaquith commented 10 years ago

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?

Ramoonus commented 10 years ago

@ipstenu do you have a link for me?

Ipstenu commented 10 years ago

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';
        }
Ramoonus commented 10 years ago

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

Ramoonus commented 10 years ago

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