Support Forum ยป User Profile

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: google maps vs. include/exclude #5483
    web-crossingweb-crossing
    Participant

    Hi,
    here you go:

    <?php

    
    function content_element_metaboxes( $meta_boxes ) {
        $prefix = "webx-";
        $type_opt = array(0 => "Text", 1 => "Masonry Gallery", 2 => "Slider", 3 => "Big Picture", 4 => "Map", 5 => "Insta Feed", 6 => "Cite", 7 => "Interview");
    
        $just_text = array(
            'wpautop' => false,
            'media_buttons' => true,
            'textarea_rows' => 20,
            'teeny' => false,
            'dfw' => false,
            'tinymce' => true,
            'quicktags' => false
        );
    
        $meta_boxes[] = array(
            'title'      => __('The content', 'webx'),
            'context'    => 'normal',
            'priority'   => 'high',
            'post_types' => array( 'content_element'),
            'geo' => true,
            'fields' => array(
                array(
                    'name' => __('Type', 'webx'),
                    'id' => "{$prefix}type",
                    'type'  => "select",
                    'inline' => true,
                    'options' => $type_opt
                ),
                array(
                    'name' => __('Text', 'webx'),
                    'id' => "{$prefix}text",
                    'type'  => "wysiwyg",
                    'options' => $just_text,
                    'hidden' => array( "{$prefix}type", '!=', 0)
                ),
                array(
                    'id'               => "{$prefix}gallery",
                    'name'             => __('Images', 'webx'),
                    'type'             => 'image_advanced',
                    'force_delete'     => false,
                    'max_file_uploads' => 50,
                    'max_status'       => true,
                    'visible' => array( "{$prefix}type", 'in', [1, 2, 3])
                ),
                // Map requires at least one address field (with type = text)
                array(
                    'id'   =>  "{$prefix}address",
                    'name' => __( 'Address', 'webx' ),
                    'type' => 'text',
                    'std'  => __( 'Innsbruck, Austria', 'webx' ),
                    'visible' => array( "{$prefix}type", 4),
                ),
                array(
                    'id'            =>  "{$prefix}map",
                    'name'          => __( 'Location', 'webx' ),
                    'type'          => 'map',
                    'std'           => '47.2643292,11.3963643',
                    'address_field' => "{$prefix}address",
                    'api_key'       => 'AIzaSyBQDh2E_g4_UTvYb5_2y6WClAOCn3VqRLc',
                    'visible' => array( "{$prefix}type", 4),
                ),
                array(
                    'name' => __('Markers', 'webx'),
                    'id' => "{$prefix}markers",
                    'type' => 'group',
                    'clone'  => true,
                    'visible' => array( "{$prefix}type", 4),
                    'fields' => array(
                        array(
                            'name' => __('Address', 'webx'),
                            'type' => 'text',
                            'id'    => 'address_marker'
                        ),
                        array(
                            'name' => __('Text', 'webx'),
                            'type' => 'wysiwyg',
                            'id'    => 'markercontent',
                            'options' => $just_text
                        ),
                    ),
                ),
                array(
                    'id'   =>  "{$prefix}instagram",
                    'name' => __( 'Instagram ID', 'webx' ),
                    'dec' => __('get it here: ') . ".https://smashballoon.com/instagram-feed/find-instagram-user-id/",
                    'type' => 'text',
                    'size' => 100,
                    'hidden' => array( "{$prefix}type", '!=', 5),
                ),
                array(
                    'id'   =>  "{$prefix}cite",
                    'name' => __( 'cite', 'webx' ),
                    'type' => 'textarea',
                    'size' => 100,
                    'hidden' => array( "{$prefix}type", '!=', 6),
                ),
                array(
                    'id' => "{$prefix}interview-header",
                    'name' => __("Title", 'webx'),
                    'type' => 'text',
                    'size' => 120,
                    'hidden' => array( "{$prefix}type", '!=', 7),
                ),
                array(
                    'id' => "{$prefix}interview",
                    'name' => __("Interview", 'webx'),
                    'type' => 'group',
                    'hidden' => array( "{$prefix}type", '!=', 7),
                    'sort_clone' => true,
                    'clone'  => true,
                    'fields' => array(
                        array(
                            'name' => __('Question', 'webx'),
                            'type' => 'text',
                            'size' => 80,
                            'id'    => 'question'
                        ),
                        array(
                            'name' => __('Text', 'webx'),
                            'type' => 'wysiwyg',
                            'id'    => 'answer',
                            'options' => $just_text
                        ),
                    )
    
                )
    
            )
        );
        return $meta_boxes;
    }
    add_filter( 'rwmb_meta_boxes', 'content_element_metaboxes' );
    in reply to: Cloning getting slow #4637
    web-crossingweb-crossing
    Participant

    It would be great.
    Thanks.

    in reply to: Settings Page - Radio Buttons and Conditional Logic #4382
    web-crossingweb-crossing
    Participant

    Thanks, now it's working like a charm...

Viewing 3 posts - 1 through 3 (of 3 total)