From fc257754b2cfb9db92d58d52c0e914aa6390e854 Mon Sep 17 00:00:00 2001 From: Robin Jonsson Date: Wed, 1 Apr 2020 17:24:44 +0200 Subject: [PATCH 1/2] Hooks for cache flush changed to two that works --- fields/acf-base.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fields/acf-base.php b/fields/acf-base.php index 6f36a46..f186229 100644 --- a/fields/acf-base.php +++ b/fields/acf-base.php @@ -24,7 +24,9 @@ public function __construct() { parent::__construct(); // Hooks ! - add_action( 'save_post_attachment', array( $this, 'save_post_attachment' ) ); + add_action( 'add_attachment', array( $this, 'save_post_attachment' ) ); + add_action( 'edit_attachment', array( $this, 'save_post_attachment' ) ); + } /** From a15f99c931d0bf867e3adccf75bd39f697594ce6 Mon Sep 17 00:00:00 2001 From: Robin Date: Fri, 16 Apr 2021 11:03:08 +0200 Subject: [PATCH 2/2] Hide the entire section of admin footer dummy SVG's instead of every single, since it caused some SVG's to not be hidden. --- fields/acf-base.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/fields/acf-base.php b/fields/acf-base.php index f186229..e629554 100644 --- a/fields/acf-base.php +++ b/fields/acf-base.php @@ -274,21 +274,19 @@ public function display_svg() { return; } + echo ''; + echo '
'; foreach ( $files as $file ) { if ( ! is_file( $file['file'] ) ) { continue; } - + $svg = file_get_contents( $file['file'] ); - - if ( true === strpos( $svg, 'style="' ) ) { - $svg = str_replace( 'style="', 'style="display:none; ', $svg ); - } else { - $svg = str_replace( ''; + echo ''; } /**