With ninja form + front-end posting plugin, can we fill a social media metabox (Icon + Link)

18 Views Asked by At

I am stuck in creating my form which must create a member page. I manage to bring up all the "simple" fields like name, company, email, telephone etc... but I don't know how to bring up the two fields of the "social link" metabox which includes two fields, a drop-down list of social network icons (icon) + a social network URL field (link)... the meta key for the metabox is "gs_social". IF I put metakey = gs_social, I don't know what to put in meta value = {field:???}. Does anyone have any ideas to help me? should I use a hook? add a function?

thank you very much in advance !

To find the company (_gs_com) it's simple, but for gs_social which is an array ? :

 'meta_input' => $this->get_meta_inputs([
                    '_thumbnail_id' => 'gsteam-member-1',
                    '_gs_des' => 'Product Manager',
                    '_gs_com' => 'Sanira Inc',
                    '_gs_land' => '406-324-6585',
                    '_gs_cell' => '619-770-9056',
                    '_gs_email' => '[email protected]',
                    '_gs_address' => '1158 Hartland Avenue, Fond Du Lac, WI 54935',
                    '_gs_ribon' => 'Rising Star',
                    'second_featured_img' => 'gsteam-member-flip-1',
                    'gs_social' => [
                        ['icon' => 'twitter', 'link' => 'https://twitter.com/WilliamMDean'],
                        ['icon' => 'google-plus', 'link' => 'https://google.com/WilliamMDean'],
                        ['icon' => 'facebook', 'link' => 'https://facebook.com/WilliamMDean'],
                        ['icon' => 'linkedin', 'link' => 'https://linkedin.com/WilliamMDean'],
                    ],

In my Ninja Form back end:

Ninja Form Front End Posting

The Metabox to fill with the form and that I don't know how to fill out :

Social Link and icon metabox

The function who populate the metabox :

function cmb_social_cb($post) {

        // Add a nonce field so we can check for it later.
        wp_nonce_field('gs_team_nonce_name', 'gs_team_cmb_token');

        /*
         * Use get_post_meta() to retrieve an existing value
         * from the database and use the value for the form.
         */
        $gs_social  = get_post_meta($post->ID, 'gs_social', true);
        $social_icons  = array('envelope', 'link', 'google-plus', 'facebook', 'instagram', 'whatsapp', 'twitter', 'youtube', 'vimeo-square', 'flickr', 'dribbble', 'behance', 'dropbox', 'wordpress',  'tumblr', 'skype', 'linkedin', 'stack-overflow', 'pinterest', 'foursquare', 'github', 'xing', 'stumbleupon',  'delicious', 'lastfm', 'hacker-news', 'reddit', 'soundcloud', 'yahoo', 'trello', 'steam', 'deviantart', 'twitch', 'feed', 'renren', 'vk', 'vine', 'spotify', 'digg', 'slideshare', 'bandcamp', 'map-pin', 'map-marker');

    ?>

I tried all metakey combinations (gs_social, icon, gs_socia_icon...), functions found on the net, hooks for Ninja Forms... nothing works I hope to find here, not the answer, but a way to customize my form, my code, in order to create this member page (only the social network icon and link data is missing, everything else works well, the member page is well creating)

0

There are 0 best solutions below