%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/maraton/maraton.eco-n-tech.co.uk/wp-content/themes/maraton/blocks/FAQ/
Upload File :
Create Path :
Current File : //home/maraton/maraton.eco-n-tech.co.uk/wp-content/themes/maraton/blocks/FAQ/index.php

<?php

acf_register_block( array(
    'name'            => 'faq',
    'title'           => __( 'FAQ Block', 'maraton' ),
    'description'     => __( 'FAQ block.', 'maraton' ),
    'render_callback' => 'faq_render_callback',
    'category'        => 'maraton-blocks',
    'icon'            => 'editor-quote',
    'keywords'        => array( 'faq', 'maraton'),
) );

function faq_render_callback( $block, $content = '', $is_preview = false ) {

    $context = Timber::context();

    // Store block values.
    $context['block'] = $block;

    // Store field values.
    $context['fields'] = get_fields();

    // Store $is_preview value.
    $context['is_preview'] = $is_preview;

    // build style string
//    if (isset($context['fields']['settings'])) {
//        $context['block']['style'] = 'background-color: ' . $context['fields']['settings']['background_color'] . ';';
//    }
    $context['uniqid'] = uniqid();

    // Render the block.
    Timber::render( 'render-template.twig', $context );
}

?>

Zerion Mini Shell 1.0