| @ -0,0 +1,15 @@ | |||||
| root = true | |||||
| [*] | |||||
| charset = utf-8 | |||||
| end_of_line = lf | |||||
| indent_size = 2 | |||||
| indent_style = space | |||||
| insert_final_newline = true | |||||
| trim_trailing_whitespace = true | |||||
| [*.php] | |||||
| indent_size = 4 | |||||
| [*.md] | |||||
| trim_trailing_whitespace = false | |||||
| @ -0,0 +1,6 @@ | |||||
| * text=auto eol=lf | |||||
| /.editorconfig export-ignore | |||||
| /.gitattributes export-ignore | |||||
| /.gitignore export-ignore | |||||
| /README.md export-ignore | |||||
| @ -0,0 +1,3 @@ | |||||
| composer.lock | |||||
| phpunit.xml | |||||
| vendor | |||||
| @ -0,0 +1,9 @@ | |||||
| MIT License | |||||
| Copyright (c) Vincent Klaiber <hello@doubledip.se> | |||||
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |||||
| The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||||
| @ -0,0 +1,9 @@ | |||||
| # Plate | |||||
| This package has been archived and abandoned by the owner. It is now read-only. | |||||
| If you want a plugin with similar features, consider checking out [Administration UI](https://vinkla.dev/administration-ui). When you buy a license you'll help the continuous development of WordPlate. | |||||
| ## License | |||||
| [MIT](LICENSE) © [Vincent Klaiber](https://doubledip.se) | |||||
| @ -0,0 +1,35 @@ | |||||
| { | |||||
| "name": "wordplate/plate", | |||||
| "type": "wordpress-plugin", | |||||
| "description": "A theme support plugin for WordPlate", | |||||
| "keywords": [ | |||||
| "plate", | |||||
| "plugin", | |||||
| "wordplate", | |||||
| "wordpress" | |||||
| ], | |||||
| "license": "MIT", | |||||
| "authors": [ | |||||
| { | |||||
| "name": "Vincent Klaiber", | |||||
| "email": "hello@doubledip.se" | |||||
| }, | |||||
| { | |||||
| "name": "Chris Andersson", | |||||
| "email": "hello@puredazzle.se" | |||||
| } | |||||
| ], | |||||
| "require": { | |||||
| "php": "^7.2" | |||||
| }, | |||||
| "config": { | |||||
| "preferred-install": "dist" | |||||
| }, | |||||
| "extra": { | |||||
| "branch-alias": { | |||||
| "dev-master": "6.1-dev" | |||||
| } | |||||
| }, | |||||
| "minimum-stability": "dev", | |||||
| "prefer-stable": true | |||||
| } | |||||
| @ -0,0 +1,30 @@ | |||||
| <?php | |||||
| /** | |||||
| * Copyright (c) Vincent Klaiber. | |||||
| * | |||||
| * For the full copyright and license information, please view the LICENSE | |||||
| * file that was distributed with this source code. | |||||
| * | |||||
| * @see https://github.com/wordplate/plate | |||||
| */ | |||||
| /* | |||||
| * Plugin Name: Plate | |||||
| * Description: A theme support plugin for WordPlate. | |||||
| * Author: WordPlate | |||||
| * Author URI: https://wordplate.github.io/ | |||||
| * Version: 6.0.1 | |||||
| * Plugin URI: https://github.com/wordplate/plate | |||||
| */ | |||||
| declare(strict_types=1); | |||||
| add_action('after_setup_theme', function () { | |||||
| require_if_theme_supports('plate-disable-dashboard', __DIR__ . '/src/disable-dashboard.php'); | |||||
| require_if_theme_supports('plate-disable-menu', __DIR__ . '/src/disable-menu.php'); | |||||
| require_if_theme_supports('plate-disable-toolbar', __DIR__ . '/src/disable-toolbar.php'); | |||||
| require_if_theme_supports('plate-footer-text', __DIR__ . '/src/footer-text.php'); | |||||
| require_if_theme_supports('plate-login-logo', __DIR__ . '/src/login-logo.php'); | |||||
| require_if_theme_supports('plate-permalink', __DIR__ . '/src/permalink.php'); | |||||
| }, 100); | |||||
| @ -0,0 +1,37 @@ | |||||
| <?php | |||||
| /** | |||||
| * Copyright (c) Vincent Klaiber. | |||||
| * | |||||
| * For the full copyright and license information, please view the LICENSE | |||||
| * file that was distributed with this source code. | |||||
| * | |||||
| * @see https://github.com/wordplate/plate | |||||
| */ | |||||
| declare(strict_types=1); | |||||
| // Remove dashboard widgets. | |||||
| add_action('wp_dashboard_setup', function () { | |||||
| global $wp_meta_boxes; | |||||
| $positions = [ | |||||
| 'dashboard_activity' => 'normal', | |||||
| 'dashboard_incoming_links' => 'normal', | |||||
| 'dashboard_plugins' => 'normal', | |||||
| 'dashboard_recent_comments' => 'normal', | |||||
| 'dashboard_right_now' => 'normal', | |||||
| 'dashboard_primary' => 'side', | |||||
| 'dashboard_quick_press' => 'side', | |||||
| 'dashboard_recent_drafts' => 'side', | |||||
| 'dashboard_secondary' => 'side', | |||||
| ]; | |||||
| $boxes = get_theme_support('plate-disable-dashboard')[0]; | |||||
| foreach ($boxes as $box) { | |||||
| $position = $positions[$box] ?: 'normal'; | |||||
| unset($wp_meta_boxes['dashboard'][$position]['core'][$box]); | |||||
| } | |||||
| }); | |||||
| @ -0,0 +1,38 @@ | |||||
| <?php | |||||
| /** | |||||
| * Copyright (c) Vincent Klaiber. | |||||
| * | |||||
| * For the full copyright and license information, please view the LICENSE | |||||
| * file that was distributed with this source code. | |||||
| * | |||||
| * @see https://github.com/wordplate/plate | |||||
| */ | |||||
| declare(strict_types=1); | |||||
| // Remove menu and submenu items. | |||||
| add_action('admin_menu', function () { | |||||
| $items = get_theme_support('plate-disable-menu')[0]; | |||||
| foreach ($items as $item) { | |||||
| if ( | |||||
| strpos($item, '?') === false || | |||||
| strpos($item, 'edit.php?post_type=') === 0 | |||||
| ) { | |||||
| remove_menu_page($item); | |||||
| continue; | |||||
| } | |||||
| $path = parse_url($item, PHP_URL_PATH); | |||||
| $query = parse_url($item, PHP_URL_QUERY); | |||||
| $value = explode('=', $query); | |||||
| if (isset($value[1])) { | |||||
| $name = $value[1]; | |||||
| strpos($item, 'admin.php') !== 0 ? remove_submenu_page($path, $name) : remove_menu_page($name); | |||||
| } | |||||
| } | |||||
| }, PHP_INT_MAX); | |||||
| @ -0,0 +1,21 @@ | |||||
| <?php | |||||
| /** | |||||
| * Copyright (c) Vincent Klaiber. | |||||
| * | |||||
| * For the full copyright and license information, please view the LICENSE | |||||
| * file that was distributed with this source code. | |||||
| * | |||||
| * @see https://github.com/wordplate/plate | |||||
| */ | |||||
| declare(strict_types=1); | |||||
| // Remove links from admin toolbar. | |||||
| add_action('admin_bar_menu', function ($menu) { | |||||
| $items = get_theme_support('plate-disable-toolbar')[0]; | |||||
| foreach ($items as $item) { | |||||
| $menu->remove_node($item); | |||||
| } | |||||
| }, 999); | |||||
| @ -0,0 +1,17 @@ | |||||
| <?php | |||||
| /** | |||||
| * Copyright (c) Vincent Klaiber. | |||||
| * | |||||
| * For the full copyright and license information, please view the LICENSE | |||||
| * file that was distributed with this source code. | |||||
| * | |||||
| * @see https://github.com/wordplate/plate | |||||
| */ | |||||
| declare(strict_types=1); | |||||
| // Set a custom footer text. | |||||
| add_filter('admin_footer_text', function () { | |||||
| return get_theme_support('plate-footer-text')[0]; | |||||
| }); | |||||
| @ -0,0 +1,38 @@ | |||||
| <?php | |||||
| /** | |||||
| * Copyright (c) Vincent Klaiber. | |||||
| * | |||||
| * For the full copyright and license information, please view the LICENSE | |||||
| * file that was distributed with this source code. | |||||
| * | |||||
| * @see https://github.com/wordplate/plate | |||||
| */ | |||||
| declare(strict_types=1); | |||||
| // Set custom login logo. | |||||
| add_action('login_head', function () { | |||||
| $args = get_theme_support('plate-login-logo'); | |||||
| if (empty($args[0])) { | |||||
| return; | |||||
| } | |||||
| $styles = [ | |||||
| 'background-position: center;', | |||||
| 'background-size: contain;', | |||||
| sprintf('background-image: url(%s);', $args[0]), | |||||
| ]; | |||||
| if (count($args) >= 2) { | |||||
| $styles[] = sprintf('width: %dpx;', $args[1]); | |||||
| } | |||||
| echo sprintf('<style> .login h1 a { %s } </style>', implode(' ', $styles)); | |||||
| }); | |||||
| // Set custom login logo url. | |||||
| add_filter('login_headerurl', function () { | |||||
| return get_bloginfo('url'); | |||||
| }); | |||||
| @ -0,0 +1,21 @@ | |||||
| <?php | |||||
| /** | |||||
| * Copyright (c) Vincent Klaiber. | |||||
| * | |||||
| * For the full copyright and license information, please view the LICENSE | |||||
| * file that was distributed with this source code. | |||||
| * | |||||
| * @see https://github.com/wordplate/plate | |||||
| */ | |||||
| declare(strict_types=1); | |||||
| // Set default permalink structure. | |||||
| add_action('admin_init', function () { | |||||
| global $wp_rewrite; | |||||
| $pattern = get_theme_support('plate-permalink')[0]; | |||||
| $wp_rewrite->set_permalink_structure($pattern); | |||||
| }); | |||||