Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('wcfm_profile_fields_social', function($social_fields, $vendor_id) {
- $vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true );
- $social_accounts = $vendor_data['social'] ?? array();
- $website = $social_accounts['website'] ?? '';
- return array_merge(
- $social_fields,
- array(
- "website" => array(
- 'label' => __('Website', 'wc-frontend-manager') ,
- 'type' => 'text',
- 'class' => 'wcfm-text wcfm_ele',
- 'label_class' => 'wcfm_title wcfm_ele',
- 'value' => $website,
- 'placeholder' => __('website address', 'wc-frontend-manager')
- )
- )
- );
- }, 10, 2);
- add_filter('wcfm_profile_social_types', function($types) {
- return array_merge(
- $types,
- ['website' => 'website',]
- );
- });
- add_action('wcfmmp_store_after_social', function($vendor_id) {
- ?>
- <style>
- .store-website-logo{
- display: block;
- margin-top: 50%;
- transform: translateY(-50%);
- }
- </style>
- <?php
- $store_info = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true );
- if( isset( $store_info['social']['website'] ) && !empty( $store_info['social']['website'] ) ) { ?>
- <li><a href="<?php echo esc_url( $store_info['social']['website'] ); ?>" class="store-website-logo" target="_blank">
- <i class="wcfmfa fa-globe" aria-hidden="true"></i>
- </a></li>
- <?php }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement