Skip to content

Commit

Permalink
Merge pull request #329 from Yoast/19508-the-content-in-acf-fields-is…
Browse files Browse the repository at this point in the history
…-not-detected-for-analysis-when-classic-editor-is-used

bugfix: content in acf-fields was not included in analyses.
  • Loading branch information
FAMarfuaty authored Jan 31, 2023
2 parents 4ef5333 + e115e6f commit af22f34
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions js/src/collect/collect-v5.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global _, acf, jQuery, wp */
/* global _, acf, jQuery, wp, window */

module.exports = function() {
var outerFieldsName = [
"flexible_content",
Expand All @@ -10,9 +11,12 @@ module.exports = function() {
var outerFields = [];
var acfFields = [];

if ( wp.data.select( "core/block-editor" ) ) {
// Return only fields in metabox areas (either below or side) or
// ACF block fields in the content (not in the sidebar, to prevent duplicates)
// Check if Gutenberg editor is used.
if ( window.wpseoScriptData.isBlockEditor ) {
/*
* Return only fields in metabox areas (either below or side) or
* ACF block fields in the content (not in the sidebar, to prevent duplicates).
*/
var parentContainer = jQuery( ".metabox-location-normal, .metabox-location-side, .acf-block-component.acf-block-body" );
acfFields = acf.get_fields( false, parentContainer );
} else {
Expand Down

0 comments on commit af22f34

Please sign in to comment.