• Resolved jonmojo

    (@jonmojo)


    I’m just getting into this plugin.

    • Can I call data from the database as a default value?
    • Can you add examples to the documentation as to what that might look like?

    For example – I want to add a separate caption field to an image, using the caption of the image already select (in another field (image))

Viewing 1 replies (of 1 total)
  • Plugin Author Luke Carbis

    (@lukecarbis)

    @jonmojo Hey thanks for touching base. Block Lab doesn’t have the ability to do this built in, but it might be able to be extended to do that. For example, you could do something along the lines of:

    
    <?php
    $caption = block_value( 'caption' );
    
    if ( '' !== $caption ) {
        echo $caption;
    } else {
        $default_caption_id = 42; // Default attachment post ID.
        echo the_post_thumbnail_caption( $default_caption_id );
    }
    ?>
    

    Hope that helps!

Viewing 1 replies (of 1 total)

The topic ‘Default values from data’ is closed to new replies.