Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Fields Group - rwmb_meta for single image no returning array #1457

Closed
hanabukovska opened this issue Aug 16, 2022 · 1 comment
Closed

Comments

@hanabukovska
Copy link

hanabukovska commented Aug 16, 2022

Hi,
in custom fileds group I have simple image. The function rwbm_meta returns ID, not array for image.

Function.php

        $meta_boxes[] = [
            'title'      	=> __('About us', 'understrap' ),
            'post_types' 	=> ['page'],
            'include'    	=> [
                'relation'	=> 'AND',
                'slug'		=> ['about-us'],
            ],

            'fields'     => [
                [
                    'id'		=> 'cc_about_us',
                    'type'		=> 'group',
                    'fields'	=> [

                        [
                            'name'    			=> 'Image',
                            'id'      			=> 'cc_about_us_image',
                            'type'   			=> 'single_image',
                        ],

                    ],	
                ],	
            ],
        ];

        return $meta_boxes;

Template.php:

<?php
$about_us = rwmb_meta( 'cc_about_us' );
?>
<h2>Result: <?php print_r($about_us); ?></h2> 

FrontEnd:
Snímek obrazovky 2022-08-15 v 11 35 04

What with this? How do I get to the image url?

@rilwis
Copy link
Member

rilwis commented Aug 24, 2022

Please see this docs

@rilwis rilwis closed this as completed Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants