Skip to content

Instantly share code, notes, and snippets.

@humayunahmed8
Created February 3, 2022 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save humayunahmed8/9b2849f366deeda10db9474a55a84ffa to your computer and use it in GitHub Desktop.
Save humayunahmed8/9b2849f366deeda10db9474a55a84ffa to your computer and use it in GitHub Desktop.
Social Media Links Shortcode using Codestar Repeater Field.
<?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' );
@humayunahmed8
Copy link
Author

humayunahmed8 commented Feb 3, 2022

Screenshot_130

Preview

@humayunahmed8
Copy link
Author

Screenshot_131

Shortcode : [social]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment