Giter Site home page Giter Site logo

Block content and inner blocks "anchor" field being applied to parent block resulting in duplicates about wp-graphql-content-blocks HOT 4 CLOSED

wpengine avatar wpengine commented on May 31, 2024
Block content and inner blocks "anchor" field being applied to parent block resulting in duplicates

from wp-graphql-content-blocks.

Comments (4)

theodesp avatar theodesp commented on May 31, 2024 1

Hey @kidunot89 I think I found the issue.

I can change this line:
https://github.com/wpengine/wp-graphql-content-blocks/blob/main/includes/Field/BlockSupports/Anchor.php#L40

into:

$rendered_block   = wp_unslash( $block['innerHTML'] );

Before
Screenshot 2023-05-03 at 12 30 54

After
Screenshot 2023-05-03 at 12 29 04

from wp-graphql-content-blocks.

theodesp avatar theodesp commented on May 31, 2024

Hey @kidunot89 thanks for the report. Is it possible to use Anchors for Layout elements to avoid that issue in the meantime?
For example you can add an Anchor for CoreGroup and CoreColumns.

I'm trying to think of a way to avoid searching the innerBlocks content for anchor ids.

Since we are rendering the whole block render_block( $block ) and then using the following $attribute_config

$attribute_config = array(
									'type'      => 'string',
									'source'    => 'attribute',
									'attribute' => 'id',
									'selector'  => '*',
								);

It will search the innerHTML as well for that id. Not sure if there is an easy way to remove the innerHTML content. Probably with regex.

from wp-graphql-content-blocks.

theodesp avatar theodesp commented on May 31, 2024

#63

from wp-graphql-content-blocks.

theodesp avatar theodesp commented on May 31, 2024

We will be releasing this tomorrow.

from wp-graphql-content-blocks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.