Skip to content

Commit

Permalink
Merge branch 'T-17628' into 3.0.8rc
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasKau committed Oct 4, 2024
2 parents 3386be9 + 3a389dc commit 6139289
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 17 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
### Unreleased

* Add srcset to `get_native_lazyload_tag` function

### 3.0.9: 2024-09-25

* Disable dashboard widgets for wpseo-wincher, tinypng and objectcache
* Fix removal of welcome panel in admin dashboard
* Bump tested WordPress version to 6.6.2

### 3.0.8: 2024-09-24

* Fix media option switching on staging DB in development

### 3.0.7: 2024-09-06

* Add array check to Gutenberg allowed block filter
Expand Down
8 changes: 4 additions & 4 deletions air-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* Plugin Name: Air helper
* Plugin URI: https://github.com/digitoimistodude/air-helper
* Description: Plugin provides helpful functions and modifications for WordPress projects.
* Version: 3.0.7
* Version: 3.0.9
* Author: Digitoimisto Dude Oy
* Author URI: https://www.dude.fi
* Requires at least: 5.5
* Tested up to: 6.5.5
* Tested up to: 6.6.2
* License: GPL-3.0+
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*
Expand All @@ -28,9 +28,9 @@
* @return integer current version of plugin
*/
function air_helper_version() {
// Version: 3.0.7
// Version: 3.0.9
// 5 integers
return 30070;
return 30090;
} // 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.0.7",
"version": "3.0.9",
"authors": [
{
"name": "Timi Wahalahti",
Expand Down
4 changes: 4 additions & 0 deletions functions/image-lazyload-native.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ function get_native_lazyload_tag( $image_id = 0, $args = [] ) {
// Get alt
$alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );

// Get srcset
$srcset = wp_get_attachment_image_srcset( $image_id );

// Get the img tag
ob_start(); ?>
<img loading="lazy"
alt="<?php echo esc_attr( $alt ); ?>"
src="<?php echo esc_url( $image_urls['big'] ); ?>"
srcset="<?php echo esc_attr( $srcset ); ?>"
<?php if ( ! empty( $styles ) ) : ?>
style="<?php echo esc_attr( $styles ); ?>"
<?php endif; ?>
Expand Down
25 changes: 16 additions & 9 deletions inc/admin/dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
*
* @since 1.7.0
*/
remove_action( 'welcome_panel', 'wp_welcome_panel' );
add_action( 'admin_init', function () {
if ( is_admin() ) {
remove_action( 'welcome_panel', 'wp_welcome_panel' );
}
}, 999 );

/**
* Remove some boxes from dashboard.
Expand All @@ -31,19 +35,22 @@
function air_helper_clear_admin_dashboard() {
$remove_boxes = [
'normal' => [
'dashboard_right_now',
'dashboard_recent_comments',
'dashboard_incoming_links',
'dashboard_activity',
'dashboard_plugins',
'dashboard_right_now',
'dashboard_recent_comments',
'dashboard_incoming_links',
'dashboard_activity',
'dashboard_plugins',
'dashboard_site_health',
'sendgrid_statistics_widget',
'wpseo-dashboard-overview', // yoast
'rg_forms_dashboard', // gravity forms
'sendgrid_statistics_widget',
'wpseo-dashboard-overview', // yoast
'rg_forms_dashboard', // gravity forms
'dashboard_rediscache',
'dashboard_php_nag',
'yith_dashboard_products_news', // all YITH plugins
'yith_dashboard_blog_news', // all YITH plugins
'wpseo-wincher-dashboard-overview',
'tinypng_dashboard_widget',
'dashboard_objectcache',
],
'side' => [
'dashboard_quick_press',
Expand Down
9 changes: 7 additions & 2 deletions inc/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*
* @Author: Timi Wahalahti
* @Date: 2020-01-10 16:42:40
* @Last Modified by: Timi Wahalahti
* @Last Modified time: 2021-02-19 14:26:46
* @Last Modified by: Roni Äikäs
* @Last Modified time: 2024-09-24 19:54:03
*
* @package air-helper
*/
Expand All @@ -24,6 +24,11 @@
$update_option = false;
}

// Don't update options if development environment is used on staging DB
if ( 'development' === wp_get_environment_type() && 'gunship.dude.fi' === getenv( 'DB_HOST' ) ) {
$update_option = false;
}

if ( $update_option ) {
update_option( 'upload_path', untrailingslashit( preg_replace( '/\bwp\b/u', 'media', ABSPATH ) ) );
update_option( 'upload_url_path', untrailingslashit( preg_replace( '/\bwp\b/u', 'media', get_site_url() ) ) );
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.0.7",
"version": "3.0.9",
"description": "Plugin provides helpful functions and modifications for WordPress projects.",
"main": "air-helper.php",
"dependencies": {},
Expand Down

0 comments on commit 6139289

Please sign in to comment.