Article3 | Testing the BeaverBuilder custom shortcode   This post id=35550

1. The “featured” shortcode has been added to the Beaver Theme, child theme.
Link -› functions.php

//  Use  filling the '' with the correct values for you
function gg_get_field($attr){
    $args = shortcode_atts( array(     
            'id' => '1',
            'my_field' => 'featured'
        ), $attr );
 
    return get_field($args['my_field'], $args['id']);
}
add_shortcode( 'featured' , 'gg_get_field' );


2. Testing the “featured” shortcode inside this post “Article3”

Test conclusion: the solution works for html, but not for shortcodes contained in the referenced posts’ fields.
The “remote” shortcodes inside “featured” fields are not executed remotely, but with local data from the Article3 post.

Illustration:
Two shortcodes inserted into this post fetch the “featured” field content from two posts: Article1 | Article2:

[ featured id='35400' my_field='featured' ] | [ featured id='35406' my_field='featured' ] 

Output:

Using html only Shows the expected result 20210729: Article1: id= 35400
Title, text, id, image, are called from the field "Featured" in Article1 and all render correctly.


Using shortcode Cardlet1:

Caption1: ØfL1.25% | Øsub0

2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.

Using html only Shows the expected result 20210729: Article1: id= 35400
Title, text, id, image, are called from the field "Featured" in Article1 and all render correctly.


Using shortcode Cardlet1:

Caption1: ØfL1.25% | Øsub0

2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.

3. No issues with Content Views Shortcodes are executed remotely in their fields, before being called into the page.

Article9
acf_excerpt CURRENT PAGE: sc name="sc_1"
 Art.9     |   article9 Edit post - id:37140
logo
img
img1
img2
img3

  The images are defined in the page's ACF custom fields | Sourced from: "article9" | ID: "37140"

2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.


Edit sc_1Popup sc_1
Article5
Shortcode: [ sc name="sc_1"] -›

 Article5 title    |   article5 Edit post - id:35703
logo
img
img1
img2
img3

  The images are defined in the page's ACF custom fields | Sourced from: "article5" | ID: "35703"

ACF Text field for Article5 (name=’acf_wys2)

SUCCESS! > The shortcode picks up the content correctly in case this text shows up. It works when grid solutions perform the call.


Edit sc_1Popup sc_1
Article4
Shortcode: [ sc name="sc_1"] -›

 Article 4 IOR    |   article4 Edit post - id:35672
logo
img
img1
img2
img3

  The images are defined in the page's ACF custom fields | Sourced from: "article4" | ID: "35672"

▷ Article 4, ACF Field 2
Text content for the featured section.
‹Beaver Page›


Edit sc_1Popup sc_1
ACF to BeaverBuilder
sc name="sc_1"-›

 ACF> B-Builder layout    |   acf-to-beaverbuilder Edit post - id:36961
logo
img
img1
img2
img3

  The images are defined in the page's ACF custom fields | Sourced from: "acf-to-beaverbuilder" | ID: "36961"

2
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.


Edit sc_1Popup sc_1
Article2
Using html only Shows the expected result: Article2: id= 35406
Title, text, id, image, are called from the field "Featured" in Article1 and all render correctly.


Using shortcodes: acf_cardlet1

 Article 2    |   article2 Edit post - id:35406
logo
img
img1
img2
img3

  The images are defined in the page's ACF custom fields | Sourced from: "article2" | ID: "35406"

ACF Text field for Article2 (name=’acf_wys2)
SUCCESS! > The shortcode picks up the content correctly in case this text shows up. It works when grid solutions perform the call.


Edit sc_1Popup sc_1
35550 ||||| id=35550 |||||
Article1
Using html only Shows the expected result 20210729: Article1: id= 35400
Title, text, id, image, are called from the field "Featured" in Article1 and all render correctly.


Using shortcode Cardlet1:
Article1 ACF field ▷ Img1

ACF Text field for Article1 (name=’acf_wys2)
SUCCESS! > The shortcode picks up the content correctly in case this text shows up. It works when grid solutions perform the call.

Article1_IOR

Article3