Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wpup/content-menu
Adds a content menu to WordPress admin
https://github.com/wpup/content-menu
admin menu wordpress wordpress-plugin
Last synced: 9 days ago
JSON representation
Adds a content menu to WordPress admin
- Host: GitHub
- URL: https://github.com/wpup/content-menu
- Owner: wpup
- License: mit
- Created: 2016-11-12T16:18:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-12-02T14:20:21.000Z (about 5 years ago)
- Last Synced: 2024-12-20T15:44:44.740Z (21 days ago)
- Topics: admin, menu, wordpress, wordpress-plugin
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Content menu
[![Build Status](https://travis-ci.org/wpup/content-menu.svg?branch=master)](https://travis-ci.org/wpup/content-menu)
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)Adds a content menu to WordPress admin where all your post types that are used for content can live, when doing this the post type configured to use content menu will be removed from the admin menu and if you have a lot of post types you will see a more clean admin menu than before.
Both `post` and `page` will be moved to content menu by default and can be unmoved by `content_menu_post_types` filter.
Content menu will only have submenu items when a post type is selected so you can see and use the submenu items for that post types, as you can see in the second screenshot.
## Installation
```sh
composer require frozzare/wp-content-menu
```## Usage
To move your post types into content menu you can set `content_menu` to `true` in `register_post_type` or use `content_menu_post_types` filter.
```php
// With `register_post_type`
register_post_type( 'book', [
'content_menu' => true
] );// With the filter.
add_filter( 'content_menu_post_types', function ( $post_types ) {
return ['page', 'post', 'book']
} );
```You can modify `Add New Book` label by `content_menu_add_new_item_label` filter.
```php
add_filter( 'content_menu_add_new_item_label', function ( $label ) {
return 'Add New';
} );
```Disable content menu for users:
```php
add_filter( 'content_menu_user_allowed', function ( $allowed, $user ) {
return false;
}, 10, 2 );
```## Screenshots
![](https://cloud.githubusercontent.com/assets/14610/20240391/4ab1f8d0-a917-11e6-9994-616924b94f53.png)
![](https://cloud.githubusercontent.com/assets/14610/20256173/0ce9c790-aa42-11e6-818e-8348862a252d.png)
## Contributing
Everyone is welcome to contribute with patches, bug-fixes and new features.
## License
MIT © [Fredrik Forsmo](https://github.com/frozzare)