Skip to content

Commit

Permalink
Remove WPForms reports widget from dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ronilaukkarinen committed Dec 18, 2024
1 parent f0844dd commit 5f85472
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 3.1.9: 2024-12-18

* Remove WPForms reports widget from dashboard
* Add more clear instructions in code comments on how to add custom widgets to dashboard

### 3.1.8: 2024-12-16

* Fix: Replace .test domain with staging domain in attachment URLs (T-23857)
Expand Down
8 changes: 4 additions & 4 deletions air-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Air helper
* Plugin URI: https://github.com/digitoimistodude/air-helper
* Description: Plugin provides helpful functions and modifications for WordPress projects.
* Version: 3.1.8
* Version: 3.1.9
* Author: Digitoimisto Dude Oy
* Author URI: https://www.dude.fi
* Requires at least: 5.5
Expand All @@ -28,9 +28,9 @@
* @return integer current version of plugin
*/
function air_helper_version() {
// Version: 3.1.8
// 5 integers, e. g. 3.1.8 -> 31008
return 31008;
// Version: 3.1.9
// 5 integers, e. g. 3.1.9 -> 31009
return 31009;
} // end air_helper_version

/**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"plugin"
],
"license": "GPL-3.0+",
"version": "3.1.8",
"version": "3.1.9",
"authors": [
{
"name": "Timi Wahalahti",
Expand Down
21 changes: 18 additions & 3 deletions inc/admin/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@
/**
* Remove some boxes from dashboard.
*
* Turn off by using `remove_action( 'wp_dashboard_setup', 'air_helper_clear_admin_dashboard' )`
* Modify with `add_filter( 'air_helper_clear_admin_dashboard_boxes', 'myprefix_air_helper_clear_admin_dashboard_boxes' )`
* Turn off completely by using:
* remove_action( 'wp_dashboard_setup', 'air_helper_clear_admin_dashboard' );
*
* Modify which boxes are hidden/shown using:
* add_filter( 'air_helper_clear_admin_dashboard_boxes', function( $remove_boxes ) {
* // Show Yoast SEO widget
* $key = array_search( 'wpseo-dashboard-overview', $remove_boxes['normal'] );
* if ( false !== $key ) {
* unset( $remove_boxes['normal'][$key] );
* }
*
* // Hide additional widget
* $remove_boxes['normal'][] = 'my_custom_widget';
*
* return $remove_boxes;
* } );
*
* @since 1.7.0
*/
Expand All @@ -47,6 +61,7 @@ function air_helper_clear_admin_dashboard() {
'wpseo-wincher-dashboard-overview',
'tinypng_dashboard_widget',
'themeisle', // Optimole
'wpforms_reports_widget_pro', // WP Forms reports
],
'side' => [
'dashboard_quick_press',
Expand All @@ -56,7 +71,7 @@ function air_helper_clear_admin_dashboard() {
],
];

// Allow filtering which boxes to hide
// Allow filtering which boxes to hide or show
$remove_boxes = apply_filters( 'air_helper_clear_admin_dashboard_boxes', $remove_boxes );

if ( ! empty( $remove_boxes ) ) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "air-helper",
"version": "3.1.8",
"version": "3.1.9",
"description": "Plugin provides helpful functions and modifications for WordPress projects.",
"main": "air-helper.php",
"dependencies": {},
Expand Down

0 comments on commit 5f85472

Please sign in to comment.