Browse Source

Remove soberwp/intervention as dependency

pull/326/head
SteelWagstaff 4 years ago
parent
commit
d5f188ab1a
  1. 1
      composer.json
  2. 468
      composer.lock
  3. 9
      functions.php
  4. 36
      inc/actions/namespace.php
  5. 3
      inc/customizer/namespace.php
  6. 44
      inc/intervention.php

1
composer.json

@ -28,7 +28,6 @@
"composer/installers": "^2", "composer/installers": "^2",
"phpcompatibility/php-compatibility": "^9.3", "phpcompatibility/php-compatibility": "^9.3",
"pressbooks/mix": "^2.1", "pressbooks/mix": "^2.1",
"soberwp/intervention": "2.0.0-rc.5",
"spatie/color": "^1.1" "spatie/color": "^1.1"
}, },
"require-dev": { "require-dev": {

468
composer.lock generated

@ -4,47 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "cb4ec996812a3ab738f1a2013fc3a7da", "content-hash": "57c07c2fd3e425e4618519761e9c9b64",
"packages": [ "packages": [
{
"name": "brick/varexporter",
"version": "0.3.5",
"source": {
"type": "git",
"url": "https://github.com/brick/varexporter.git",
"reference": "05241f28dfcba2b51b11e2d750e296316ebbe518"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/brick/varexporter/zipball/05241f28dfcba2b51b11e2d750e296316ebbe518",
"reference": "05241f28dfcba2b51b11e2d750e296316ebbe518",
"shasum": ""
},
"require": {
"nikic/php-parser": "^4.0",
"php": "^7.2 || ^8.0"
},
"require-dev": {
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^8.5 || ^9.0",
"vimeo/psalm": "4.4.1"
},
"type": "library",
"autoload": {
"psr-4": {
"Brick\\VarExporter\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "A powerful alternative to var_export(), which can export closures and objects without __set_state()",
"keywords": [
"var_export"
],
"time": "2021-02-10T13:53:07+00:00"
},
{ {
"name": "composer/installers", "name": "composer/installers",
"version": "v2.1.1", "version": "v2.1.1",
@ -185,194 +146,6 @@
], ],
"time": "2022-04-13T09:13:00+00:00" "time": "2022-04-13T09:13:00+00:00"
}, },
{
"name": "illuminate/collections",
"version": "v8.83.8",
"source": {
"type": "git",
"url": "https://github.com/illuminate/collections.git",
"reference": "fc232e89c0214dba5d2b431220a24b02d480a472"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/collections/zipball/fc232e89c0214dba5d2b431220a24b02d480a472",
"reference": "fc232e89c0214dba5d2b431220a24b02d480a472",
"shasum": ""
},
"require": {
"illuminate/contracts": "^8.0",
"illuminate/macroable": "^8.0",
"php": "^7.3|^8.0"
},
"suggest": {
"symfony/var-dumper": "Required to use the dump method (^5.4)."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"files": [
"helpers.php"
],
"psr-4": {
"Illuminate\\Support\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Collections package.",
"homepage": "https://laravel.com",
"time": "2022-03-25T14:53:23+00:00"
},
{
"name": "illuminate/contracts",
"version": "v8.83.8",
"source": {
"type": "git",
"url": "https://github.com/illuminate/contracts.git",
"reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/contracts/zipball/5e0fd287a1b22a6b346a9f7cd484d8cf0234585d",
"reference": "5e0fd287a1b22a6b346a9f7cd484d8cf0234585d",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0",
"psr/container": "^1.0",
"psr/simple-cache": "^1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Contracts\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Contracts package.",
"homepage": "https://laravel.com",
"time": "2022-01-13T14:47:47+00:00"
},
{
"name": "illuminate/macroable",
"version": "v8.83.8",
"source": {
"type": "git",
"url": "https://github.com/illuminate/macroable.git",
"reference": "aed81891a6e046fdee72edd497f822190f61c162"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/illuminate/macroable/zipball/aed81891a6e046fdee72edd497f822190f61c162",
"reference": "aed81891a6e046fdee72edd497f822190f61c162",
"shasum": ""
},
"require": {
"php": "^7.3|^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "8.x-dev"
}
},
"autoload": {
"psr-4": {
"Illuminate\\Support\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "The Illuminate Macroable package.",
"homepage": "https://laravel.com",
"time": "2021-11-16T13:57:03+00:00"
},
{
"name": "nikic/php-parser",
"version": "v4.13.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.9-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2021-11-30T19:35:32+00:00"
},
{ {
"name": "phpcompatibility/php-compatibility", "name": "phpcompatibility/php-compatibility",
"version": "9.3.5", "version": "9.3.5",
@ -470,145 +243,6 @@
], ],
"time": "2017-09-06T21:35:04+00:00" "time": "2017-09-06T21:35:04+00:00"
}, },
{
"name": "psr/container",
"version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": ""
},
"require": {
"php": ">=7.4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2021-11-05T16:50:12+00:00"
},
{
"name": "psr/simple-cache",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/simple-cache.git",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Psr\\SimpleCache\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interfaces for simple caching",
"keywords": [
"cache",
"caching",
"psr",
"psr-16",
"simple-cache"
],
"time": "2017-10-23T01:57:42+00:00"
},
{
"name": "soberwp/intervention",
"version": "2.0.0-rc.5",
"source": {
"type": "git",
"url": "https://github.com/darrenjacoby/intervention.git",
"reference": "7377e42b36780d0c4787b36119524ffac14cc8d4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/darrenjacoby/intervention/zipball/7377e42b36780d0c4787b36119524ffac14cc8d4",
"reference": "7377e42b36780d0c4787b36119524ffac14cc8d4",
"shasum": ""
},
"require": {
"brick/varexporter": "^0.3.5",
"illuminate/collections": "^8.51",
"php": "^7.4|^8.0"
},
"require-dev": {
"composer/installers": "^2.0",
"symplify/easy-coding-standard": "dev-main"
},
"type": "wordpress-plugin",
"autoload": {
"psr-4": {
"Jacoby\\Intervention\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Darren Jacoby",
"email": "darren@jacoby.co.za",
"homepage": "https://twitter.com/withjacoby"
}
],
"description": "WordPress plugin containing modules to cleanup and customize wp-admin.",
"homepage": "https://github.com/darrenjacoby",
"keywords": [
"wordpress"
],
"time": "2022-02-23T13:39:50+00:00"
},
{ {
"name": "spatie/color", "name": "spatie/color",
"version": "1.5.1", "version": "1.5.1",
@ -1034,6 +668,58 @@
], ],
"time": "2022-03-03T13:19:32+00:00" "time": "2022-03-03T13:19:32+00:00"
}, },
{
"name": "nikic/php-parser",
"version": "v4.13.2",
"source": {
"type": "git",
"url": "https://github.com/nikic/PHP-Parser.git",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
"reference": "210577fe3cf7badcc5814d99455df46564f3c077",
"shasum": ""
},
"require": {
"ext-tokenizer": "*",
"php": ">=7.0"
},
"require-dev": {
"ircmaxell/php-yacc": "^0.0.7",
"phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
},
"bin": [
"bin/php-parse"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.9-dev"
}
},
"autoload": {
"psr-4": {
"PhpParser\\": "lib/PhpParser"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Nikita Popov"
}
],
"description": "A PHP parser written in PHP",
"keywords": [
"parser",
"php"
],
"time": "2021-11-30T19:35:32+00:00"
},
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
"version": "2.0.3", "version": "2.0.3",
@ -1875,6 +1561,50 @@
], ],
"time": "2021-08-09T16:26:32+00:00" "time": "2021-08-09T16:26:32+00:00"
}, },
{
"name": "psr/container",
"version": "1.1.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/container.git",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
"reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
"shasum": ""
},
"require": {
"php": ">=7.4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Psr\\Container\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "https://www.php-fig.org/"
}
],
"description": "Common Container Interface (PHP FIG PSR-11)",
"homepage": "https://github.com/php-fig/container",
"keywords": [
"PSR-11",
"container",
"container-interface",
"container-interop",
"psr"
],
"time": "2021-11-05T16:50:12+00:00"
},
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
"version": "1.0.1", "version": "1.0.1",
@ -3877,9 +3607,7 @@
], ],
"aliases": [], "aliases": [],
"minimum-stability": "stable", "minimum-stability": "stable",
"stability-flags": { "stability-flags": [],
"soberwp/intervention": 5
},
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {

9
functions.php

@ -38,9 +38,6 @@ $includes = [
foreach ( $includes as $include ) { foreach ( $includes as $include ) {
require get_template_directory() . "/inc/$include/namespace.php"; require get_template_directory() . "/inc/$include/namespace.php";
} }
if ( ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
require get_template_directory() . '/inc/intervention.php';
}
add_action( 'after_switch_theme', '\Aldine\Activation\create_default_content', 10 ); add_action( 'after_switch_theme', '\Aldine\Activation\create_default_content', 10 );
add_action( 'after_switch_theme', '\Aldine\Activation\create_menus', 11 ); add_action( 'after_switch_theme', '\Aldine\Activation\create_menus', 11 );
@ -59,7 +56,9 @@ add_filter( 'excerpt_more', '\Aldine\Filters\excerpt_more' );
add_filter( 'query_vars', '\Aldine\Filters\register_query_vars' ); add_filter( 'query_vars', '\Aldine\Filters\register_query_vars' );
add_filter( 'wp_nav_menu_items', '\Aldine\Filters\adjust_menu', 10, 2 ); add_filter( 'wp_nav_menu_items', '\Aldine\Filters\adjust_menu', 10, 2 );
add_filter( 'the_content', 'do_shortcode' ); add_filter( 'the_content', 'do_shortcode' );
add_filter( 'show_admin_bar', '__return_false' );
add_action( 'widgets_init', '\Aldine\Actions\widgets_init' ); add_action( 'widgets_init', '\Aldine\Actions\widgets_init' );
add_action( 'widgets_init', '\Aldine\Actions\remove_widgets' );
add_action( 'wp_enqueue_scripts', '\Aldine\Actions\enqueue_assets' ); add_action( 'wp_enqueue_scripts', '\Aldine\Actions\enqueue_assets' );
add_action( 'updated_option', '\Aldine\Actions\add_color_variants', 10, 3 ); add_action( 'updated_option', '\Aldine\Actions\add_color_variants', 10, 3 );
add_action( 'customize_register', '\Aldine\Customizer\customize_register' ); add_action( 'customize_register', '\Aldine\Customizer\customize_register' );
@ -79,5 +78,5 @@ add_filter( 'wpmu_blogs_columns', '\Aldine\Admin\catalog_columns' );
add_action( 'manage_blogs_custom_column', '\Aldine\Admin\catalog_column', 1, 3 ); add_action( 'manage_blogs_custom_column', '\Aldine\Admin\catalog_column', 1, 3 );
add_action( 'manage_sites_custom_column', '\Aldine\Admin\catalog_column', 1, 3 ); add_action( 'manage_sites_custom_column', '\Aldine\Admin\catalog_column', 1, 3 );
// Remove first submenu page from Tools. // Remove unwanted menu pages.
add_action( 'admin_menu', '\Aldine\Actions\remove_tools_menu' ); add_action( 'admin_menu', '\Aldine\Actions\remove_menu_items' );

36
inc/actions/namespace.php

@ -309,10 +309,40 @@ function tinymce_l18n() {
} }
/** /**
* Remove top-level tools menu. * Remove unwanted menu pages.
* *
* @since 1.4.0 * @since 1.15.0
*/ */
function remove_tools_menu() { function remove_menu_items() {
remove_menu_page( 'edit.php' );
remove_submenu_page( 'tools.php', 'import.php' );
remove_submenu_page( 'tools.php', 'export.php' );
remove_submenu_page( 'tools.php', 'tools.php' ); remove_submenu_page( 'tools.php', 'tools.php' );
remove_submenu_page( 'options-general.php', 'options-writing.php' );
remove_submenu_page( 'options-general.php', 'options-reading.php' );
remove_submenu_page( 'options-general.php', 'options-permalink.php' );
}
/**
* Remove unwanted widgets.
*
* @since 1.15.0
*/
function remove_widgets() {
unregister_widget('WP_Widget_Pages');
unregister_widget('WP_Widget_Calendar');
unregister_widget('WP_Widget_Archives');
unregister_widget('WP_Widget_Links');
unregister_widget('WP_Widget_Meta');
unregister_widget('WP_Widget_Search');
unregister_widget('WP_Widget_Categories');
unregister_widget('WP_Widget_Recent_Posts');
unregister_widget('WP_Widget_Recent_Comments');
unregister_widget('WP_Widget_RSS');
unregister_widget('WP_Widget_Tag_Cloud');
unregister_widget('WP_Widget_Media_Audio');
unregister_widget('WP_Nav_Menu_Widget');
unregister_widget('WP_Widget_Custom_HTML');
unregister_widget('WP_Widget_Media_Video');
unregister_widget('Akismet_Widget');
} }

3
inc/customizer/namespace.php

@ -20,6 +20,9 @@ function customize_register( \WP_Customize_Manager $wp_customize ) {
$wp_customize->remove_control( 'display_header_text' ); $wp_customize->remove_control( 'display_header_text' );
$wp_customize->remove_control( 'header_textcolor' ); $wp_customize->remove_control( 'header_textcolor' );
// Remove unsupported WP section, @see \WP_Customize_Manager::register_sections.
$wp_customize->remove_section( 'static_front_page' );
// Add Pressbooks controls. // Add Pressbooks controls.
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage'; $wp_customize->get_setting( 'blogname' )->transport = 'postMessage';

44
inc/intervention.php

@ -1,44 +0,0 @@
<?php
/**
* Admin Interventions
*
* @see https://github.com/soberwp/intervention/
*/
use function \Sober\Intervention\intervention;
intervention( 'remove-customizer-items', 'static-front-page', 'all' );
intervention( 'remove-emoji' );
intervention( 'remove-howdy', __( 'Hello,', 'pressbooks-aldine' ) );
intervention( 'remove-dashboard-items', [ 'activity', 'quick-draft' ] );
intervention(
'remove-menu-items', [
'posts',
'tool-import',
'tool-export',
'setting-writing',
'setting-reading',
'setting-permalink',
], 'all'
);
intervention(
'remove-widgets', [
'pages',
'calendar',
'archives',
'links',
'media-audio',
'meta',
'search',
'categories',
'recent-posts',
'recent-comments',
'rss',
'tag-cloud',
'custom-menu',
'custom-html',
'media-video',
'akismet',
], 'all'
);
intervention( 'remove-toolbar-frontend', 'all' );
Loading…
Cancel
Save