Browse Source

Dependency updates (#326)

* Update dependencies & remove soberwp/intervention as dependency
pull/327/head
Steel Wagstaff 3 years ago committed by GitHub
parent
commit
58cda20391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .github/dependabot.yml
  2. 6
      .github/workflows/.pipeline.yml
  3. 7
      composer.json
  4. 449
      composer.lock
  5. 9
      functions.php
  6. 36
      inc/actions/namespace.php
  7. 3
      inc/customizer/namespace.php
  8. 44
      inc/intervention.php
  9. 2
      package.json

4
.github/dependabot.yml

@ -4,7 +4,7 @@ updates:
- package-ecosystem: "npm" - package-ecosystem: "npm"
# Look for `package.json` and `package-lock.json` files in the root directory # Look for `package.json` and `package-lock.json` files in the root directory
directory: "/" directory: "/"
# Check for updates monthly # Check for updates daily
schedule: schedule:
interval: "daily" interval: "daily"
allow: allow:
@ -17,7 +17,7 @@ updates:
- package-ecosystem: "composer" - package-ecosystem: "composer"
# Look for `composer.json` and `composer.lock` files in the root directory # Look for `composer.json` and `composer.lock` files in the root directory
directory: "/" directory: "/"
# Check for updates monthly # Check for updates daily
schedule: schedule:
interval: "daily" interval: "daily"
allow: allow:

6
.github/workflows/.pipeline.yml

@ -13,9 +13,9 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
php: [ 7.3, 7.4 ] php: [ 7.4 ]
os: [ ubuntu-20.04 ] os: [ ubuntu-20.04 ]
wordpress: [ 5.9 ] wordpress: [ 5.9.3, latest ]
experimental: [ false ] experimental: [ false ]
include: include:
- php: 8.0 - php: 8.0
@ -94,7 +94,7 @@ jobs:
- name: Upload Coverage to Codecov - name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash) run: bash <(curl -s https://codecov.io/bash)
if: matrix.experimental == false && matrix.php == 7.3 if: matrix.experimental == false
- name: Prepare Build - name: Prepare Build
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')

7
composer.json

@ -19,16 +19,15 @@
}, },
"config": { "config": {
"platform": { "platform": {
"php": "7.3" "php": "7.4"
}, },
"sort-packages": true "sort-packages": true
}, },
"require": { "require": {
"php": ">=7.3", "php": ">=7.4",
"composer/installers": "^1.7", "composer/installers": "^2",
"phpcompatibility/php-compatibility": "^9.3", "phpcompatibility/php-compatibility": "^9.3",
"pressbooks/mix": "^2.1", "pressbooks/mix": "^2.1",
"soberwp/intervention": "1.2.0-p",
"spatie/color": "^1.1" "spatie/color": "^1.1"
}, },
"require-dev": { "require-dev": {

449
composer.lock generated

File diff suppressed because it is too large Load Diff

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' );

2
package.json

@ -68,7 +68,7 @@
"lint:styles": "stylelint \"assets/styles/**/*.scss\" --syntax scss" "lint:styles": "stylelint \"assets/styles/**/*.scss\" --syntax scss"
}, },
"engines": { "engines": {
"node": ">= 10" "node": ">= 14"
}, },
"devDependencies": { "devDependencies": {
"pressbooks-build-tools": "^3.0.1" "pressbooks-build-tools": "^3.0.1"

Loading…
Cancel
Save