Support Forum ยป User Profile

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • eWebifyeWebify
    Participant

    So I use the meta box AIO

    <?php
    add_filter( 'mb_settings_pages', 'your_prefix_function_name' );
    
    function your_prefix_function_name( $settings_pages ) {
        $settings_pages[] = [
            'menu_title'  => __( 'Guru Settings', 'your-text-domain' ),
            'option_name' => 'Company',
            'position'    => 2,
            'parent'      => 'index.php',
            'style'       => 'no-boxes',
            'columns'     => 1,
            'icon_url'    => 'dashicons-admin-generic',
        ];
    return $settings_pages;
    }

    AND I copied the code that the plugin gives me to the gallery section. This gallery section custom field was added after I asked you the question above

    <?php
    add_filter( 'rwmb_meta_boxes', 'your_prefix_function_name' );
    function your_prefix_function_name( $meta_boxes ) {
        $prefix = 'settings_';
    $meta_boxes[] = [
        'title'          => __( 'Guru', 'your-text-domain' ),
        'id'             => 7,
        'settings_pages' => ['guru-settings'],
        'tabs'           => [
            'settings_home_page'     => [
                'label' => 'Home Page',
                'icon'  => 'admin-home',
            ],
            'settings_contact_info'  => [
                'label' => 'Contact Info',
                'icon'  => '',
            ],
            'settings_about_us_page' => [
                'label' => 'About Us',
                'icon'  => 'admin-users',
            ],
            'settings_contact_us'    => [
                'label' => 'Contact Us',
                'icon'  => '',
            ],
            'settings_code'          => [
                'label' => 'Code',
                'icon'  => '',
            ],
            'settings_mobile_menu'   => [
                'label' => 'Mobile Menu',
                'icon'  => 'editor-justify',
            ],
            'settings_coupons'       => [
                'label' => 'Coupons',
                'icon'  => 'tag',
            ],
        ],
        'fields'         => [
            [
                'name' => __( 'Total # of Reviews', 'your-text-domain' ),
                'id'   => $prefix . 'total_reviews',
                'type' => 'text',
                'tab'  => 'settings_home_page',
            ],
            [
                'name' => __( 'AVG Stars', 'your-text-domain' ),
                'id'   => $prefix . 'avg_stars',
                'type' => 'text',
                'tab'  => 'settings_home_page',
            ],
            [
                'name'              => __( 'Promise Title', 'your-text-domain' ),
                'id'                => $prefix . 'promise_title',
                'type'              => 'text',
                'sanitize_callback' => 'none',
                'tab'               => 'settings_home_page',
            ],
            [
                'type' => 'heading',
                'name' => __( 'Picture Gallery', 'your-text-domain' ),
                'tab'  => 'settings_home_page',
            ],
            [
                'name'  => __( 'Actrivate Gallery', 'your-text-domain' ),
                'id'    => $prefix . 'activate_gallery',
                'type'  => 'switch',
                'style' => 'rounded',
                'tab'   => 'settings_home_page',
            ],
            [
                'name' => __( 'Gallery Title', 'your-text-domain' ),
                'id'   => $prefix . 'gallery_title',
                'type' => 'text',
                'tab'  => 'settings_home_page',
            ],
            [
                'name' => __( 'Gallery Explanation', 'your-text-domain' ),
                'id'   => $prefix . 'gallery_explanation',
                'type' => 'wysiwyg',
                'tab'  => 'settings_home_page',
            ],
            [
                'name'       => __( 'Gallery Pictures', 'your-text-domain' ),
                'id'         => $prefix . 'gallery_pictures',
                'type'       => 'image_advanced',
                'image_size' => 'large',
                'tab'        => 'settings_home_page',
            ],
    
Viewing 1 post (of 1 total)