Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions fields/acf-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ) );

}

/**
Expand Down Expand Up @@ -272,21 +274,19 @@ public function display_svg() {
return;
}

echo '<!-- ACF SVG ICON output dummies start-->';
echo '<div style="display: none !important;">';
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( '<svg ', '<svg style="display:none;" ', $svg );
}


echo $svg;
}
echo '</div>';
echo '<!-- ACF SVG ICON output dummies end-->';
}

/**
Expand Down