Support

Account

Home Forums ACF PRO Common block multisites

Unread

Common block multisites

  • Hi,

    I’m trying to create a common block between parent and childs multisites (for example field textarea with data).

    I need to recover get_field(‘textarea_presentation’) from the post object (cf post.png)

    I need to access post_content->data->textarea_presentation

    Can you help me please ?

    Thank you so much

        function acf_block_render_child_callback($block)
        {
            dump(get_field('text_child'));
            switch_to_blog(1);
    
            $args = [
                'name' => 'hp',
                'post_status' => 'publish',
                'post_type' => 'page'
            ];
            $presentation = Timber::get_post($args);
            //dump(get_field('textarea_presentation'));
            //dump($presentation->get_field('textarea_presentation'));
            restore_current_blog();
    
            return Timber::render(
                ['advanced-custom-fields-templates/home-page-child.twig'],
                [
                    'block' => $block,
                    'presentation' => $presentation
                ]
            );
        }
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.