Created
February 3, 2022 17:04
-
-
Save humayunahmed8/9b2849f366deeda10db9474a55a84ffa to your computer and use it in GitHub Desktop.
Social Media Links Shortcode using Codestar Repeater Field.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined( 'ABSPATH' ) ) { die; } | |
function mydeals_theme_shortcode_options($options){ | |
$options = array(); | |
} | |
add_filter('cs_shortcode_options', 'mydeals_theme_shortcode_options'); | |
function mydeals_theme_customizer($options){ | |
$options = array(); | |
} | |
add_filter('cs_customize_options', 'mydeals_theme_customizer'); | |
// MyDeals Theme Options | |
function mydeals_option_settings($settings){ | |
$settings = array(); | |
$settings = array( | |
'menu_title' => esc_html__('MyDeals Setting','mydeals'), | |
'menu_type' => 'theme', | |
'menu_slug' => esc_html__('mydeals-theme-options','mydeals'), | |
'ajax_save' => true, | |
'show_reset_all' => true, | |
'framework_title' => esc_html__('MyDeals by Humayun Ahmed','mydeals'), | |
); | |
return $settings; | |
} | |
add_filter('cs_framework_settings', 'mydeals_option_settings'); | |
// Social Media Links Selection Options | |
function mydeals_options($options){ | |
$options = array(); | |
$options[] = array( | |
'name' => 'mydeals_social_links', | |
'title' => esc_html__('Social Links','mydeals'), | |
'icon' => 'fa fa-link', | |
'fields' => array( | |
array( | |
'id' => 'social_links', | |
'type' => 'group', | |
'title' => esc_html__('Social Links','mydeals'), | |
'button_title' => 'Add New', | |
'accordion_title' => esc_html__('Add New link','mydeals'), | |
'desc' => esc_html__('Select social icon and links here. Shortcode : [social]','mydeals'), | |
'fields' => array( | |
array( | |
'id' => 'icon', | |
'type' => 'icon', | |
'title' => esc_html__('Social Icon','mydeals'), | |
'desc' => esc_html__('Select social icon here.','mydeals'), | |
), | |
array( | |
'id' => 'link', | |
'type' => 'text', | |
'title' => esc_html__('Social Link','mydeals'), | |
'desc' => esc_html__('Type social links here.','mydeals'), | |
), | |
), | |
), | |
) | |
); | |
return $options; | |
} | |
add_filter( 'cs_framework_options', 'mydeals_options' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Preview