FEATURE Handling Instagram field
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4f8a18ad3e
commit
137d54be77
|
|
@ -51,6 +51,14 @@ function carhop_settings_init()
|
||||||
'carhop_section_social',
|
'carhop_section_social',
|
||||||
array('label_for' => 'youtube_url')
|
array('label_for' => 'youtube_url')
|
||||||
);
|
);
|
||||||
|
add_settings_field(
|
||||||
|
'instagram_url',
|
||||||
|
'URL Instagram',
|
||||||
|
'carhop_field_instagram_callback',
|
||||||
|
'carhop_options',
|
||||||
|
'carhop_section_social',
|
||||||
|
array('label_for' => 'instagram_url')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
add_action('admin_init', 'carhop_settings_init');
|
add_action('admin_init', 'carhop_settings_init');
|
||||||
|
|
||||||
|
|
@ -89,6 +97,22 @@ function carhop_field_youtube_callback($args)
|
||||||
placeholder="https://youtube.com/votrechaine">
|
placeholder="https://youtube.com/votrechaine">
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function carhop_field_instagram_callback($args)
|
||||||
|
{
|
||||||
|
$options = get_option('carhop_options');
|
||||||
|
$value = isset($options[$args['label_for']]) ? $options[$args['label_for']] : '';
|
||||||
|
?>
|
||||||
|
<input type="url"
|
||||||
|
id="<?php echo esc_attr($args['label_for']); ?>"
|
||||||
|
name="carhop_options[<?php echo esc_attr($args['label_for']); ?>]"
|
||||||
|
value="<?php echo esc_attr($value); ?>"
|
||||||
|
class="regular-text"
|
||||||
|
placeholder="https://instagram.com/votreprofil">
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Page HTML de l'interface d'options
|
// Page HTML de l'interface d'options
|
||||||
function carhop_options_page_html()
|
function carhop_options_page_html()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user