. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 94.23.64.18 / Your IP :
216.73.216.185 [
Web Server : Apache System : Linux webm005.cluster107.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : villadal ( 6036) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/villadal/www/wp-content/themes/bahamas/admin/ |
Upload File : |
<?php
add_action( 'admin_menu', 'admin_menu_using_boo_helper_simple' );
function admin_menu_using_boo_helper_simple() {
require_once ('helper-class/class-boo-settings-helper.php');
$config_array_plain = array(
'tabs' => true,
'menu' =>
array(
'page_title' => __( 'Impostazioni Recapiti', 'bahamas' ),
'menu_title' => __( 'Recapiti', 'bahamas' ),
'capability' => 'manage_options',
'slug' => 'recapiti',
'icon' => 'dashicons-performance',
'position' => 10,
'parent' => 'options-general.php',
'submenu' => true,
),
'sections' =>
array(
array(
'id' => 'general_section_recapiti',
'title' => __( 'Recapiti Generali', 'bahamas' ),
//'desc' => __( 'These are general settings for Plugin Name', 'plugin-name' ),
),
array(
'id' => 'advance_section_recapiti',
'title' => __( 'Recapiti Privacy', 'bahamas' ),
//'desc' => __( 'These are advance settings for Plugin Name', 'plugin-name' )
),
array(
'id' => 'microdata_section_recapiti',
'title' => __( 'Microdata', 'bahamas' ),
//'desc' => __( 'These are advance settings for Plugin Name', 'plugin-name' )
)
),
'fields' => array(
'general_section_recapiti' => array(
array(
'id' => 'recapiti_telefono1',
'label' => __( 'Telefono 1', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {telefono1}', 'bahamas' ),
),
array(
'id' => 'recapiti_telefono2',
'label' => __( 'Telefono 2', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {telefono2}', 'bahamas' ),
),
array(
'id' => 'recapiti_telefono3',
'label' => __( 'Telefono 3', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {telefono3}', 'bahamas' ),
),
array(
'id' => 'recapiti_fax',
'label' => __( 'Fax', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {fax}', 'bahamas' ),
),
array(
'id' => 'recapiti_email',
'label' => __( 'Email', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {email}', 'bahamas' ),
),
array(
'id' => 'recapiti_indirizzo',
'label' => __( 'Indirizzo', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {indirizzo}', 'bahamas' ),
),
array(
'id' => 'recapiti_mappa',
'label' => __( 'Link Mappa', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {mappa}', 'bahamas' ),
),
array(
'id' => 'recapiti_piva',
'label' => __( 'Partita IVA', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {partitaiva}', 'bahamas' ),
),
array(
'id' => 'account_facebook',
'label' => __( 'Facebook', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {facebook}', 'bahamas' ),
),
array(
'id' => 'account_instagram',
'label' => __( 'Instagram', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {instagram}', 'bahamas' ),
),
array(
'id' => 'account_whatsapp',
'label' => __( 'WhatsApp', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {whatsapp}', 'bahamas' ),
),
array(
'id' => 'account_linkedin',
'label' => __( 'Linkedin', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {linkedin}', 'bahamas' ),
),
array(
'id' => 'account_youtube',
'label' => __( 'YouTube', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {youtube}', 'bahamas' ),
),
),
'advance_section_recapiti' => array(
array(
'id' => 'ragionesociale',
'label' => __( 'Ragione Sociale', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {ragionesociale}', 'bahamas' ),
),
array(
'id' => 'nometitolare',
'label' => __( 'Nome Titolare', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {nometitolare}', 'bahamas' ),
),
array(
'id' => 'sedelegale',
'label' => __( 'Sede Legale', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {sedelegale}', 'bahamas' ),
),
array(
'id' => 'emailprivacy',
'label' => __( 'Email Privacy', 'bahamas' ),
'desc' => __( 'Utilizza la variabile: {emailprivacy}', 'bahamas' ),
),
),
'microdata_section_recapiti' => array(
array(
'id' => 'microdataLocalBuisiness',
'label' => __( 'Microdata Local Buisines', 'bahamas' ),
'desc' => __( 'Attivo/Disattivo', 'bahamas' ),
'type' => 'checkbox',
'default' => 1,
),
array(
'id' => 'microdataDescription',
'label' => __( 'Descrizione', 'bahamas' ),
'type' => 'textarea',
),
array(
'id' => 'microdataIndirizzoVia',
'label' => __( 'Via/Piazza e Numero Civico', 'bahamas' ),
),
array(
'id' => 'microdataIndirizzoCap',
'label' => __( 'Cap', 'bahamas' ),
),
array(
'id' => 'microdataIndirizzoCitta',
'label' => __( 'Città ', 'bahamas' ),
),
array(
'id' => 'microdataIndirizzoProvincia',
'label' => __( 'Provincia', 'bahamas' ),
),
),
),
'links' => array(
'plugin_basename' => plugin_basename( __FILE__ ),
'action_links' => true,
),
);
$settings_helper = new Boo_Settings_Helper( $config_array_plain );
}
//Filtro per privacy policy
add_filter( 'the_content', 'filter_content_privacy', 999 ); //contenuto pagina
add_filter( 'widget_block_content', 'filter_content_privacy' ); //contenuto widget block
add_filter( 'widget_text_content', 'filter_content_privacy' ); //contenuto widget classic
function filter_content_privacy($content){
$contenuto = $content;
$contenuto = str_replace('{ragionesociale}',get_option('ragionesociale'),$contenuto);
$contenuto = str_replace('{dominio}',get_site_url( ),$contenuto);
$contenuto = str_replace('{nometitolare}',get_option('nometitolare'),$contenuto);
$contenuto = str_replace('{sedelegale}',get_option('sedelegale'),$contenuto);
$contenuto = str_replace('{emailprivacy}',get_option('emailprivacy'),$contenuto);
$contenuto = str_replace('{telefono1}',get_option('recapiti_telefono1'),$contenuto);
$contenuto = str_replace('{telefono2}',get_option('recapiti_telefono2'),$contenuto);
$contenuto = str_replace('{telefono3}',get_option('recapiti_telefono3'),$contenuto);
$contenuto = str_replace('{fax}',get_option('recapiti_fax'),$contenuto);
$contenuto = str_replace('{email}',get_option('recapiti_email'),$contenuto);
$contenuto = str_replace('{indirizzo}',get_option('recapiti_indirizzo'),$contenuto);
$contenuto = str_replace('{mappa}',get_option('recapiti_mappa'),$contenuto);
$contenuto = str_replace('{facebook}',get_option('account_facebook'),$contenuto);
$contenuto = str_replace('{instagram}',get_option('account_instagram'),$contenuto);
$contenuto = str_replace('{linkedin}',get_option('account_linkedin'),$contenuto);
$contenuto = str_replace('{youtube}',get_option('account_youtube'),$contenuto);
$contenuto = str_replace('{whatsapp}', str_replace(' ', '', get_option('account_whatsapp')),$contenuto);
$contenuto = str_replace('{partitaiva}',get_option('recapiti_piva'),$contenuto);
$contenuto = str_replace('{currentyear}',date('Y'),$contenuto);
return $contenuto;
}
//Shortcode social
add_shortcode( 'social', 'social_shortcode' );
function social_shortcode(){
$social = '<div class="social">';
if(get_option('account_facebook')){
$social .= '<a class="fb" target="_blank" href="'.get_option('account_facebook').'" title="Facebook"><svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="facebook-f" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512" width="20" height="20"><path fill="currentColor" d="M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z" class=""></path></svg></a>';
}
if(get_option('account_instagram')){
$social .= '<a class="ig" target="_blank" href="'.get_option('account_instagram').'" title="Instagram"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="20" height="20"><path fill="currentColor" d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"/></svg></a>';
}
if(get_option('account_linkedin')){
$social .= '<a class="in" target="_blank" href="'.get_option('account_linkedin').'" title="Linkedin"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="20" height="20"><path fill="currentColor" d="M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"/></svg></a>';
}
if(get_option('account_youtube')){
$social .= '<a class="yt" target="_blank" href="'.get_option('account_youtube').'" title="YouTube"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512" width="20" height="20"><path fill="currentColor" d="M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"/></svg></a>';
}
if(get_option('account_whatsapp')){
$social .= '<a class="wa" target="_blank" href="https://wa.me/'.str_replace(' ', '', get_option('account_whatsapp')).'" title="WhatsApp"><svg aria-hidden="true" focusable="false" data-prefix="fab" data-icon="whatsapp" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" width="20" height="20"><path fill="currentColor" d="M380.9 97.1C339 55.1 283.2 32 223.9 32c-122.4 0-222 99.6-222 222 0 39.1 10.2 77.3 29.6 111L0 480l117.7-30.9c32.4 17.7 68.9 27 106.1 27h.1c122.3 0 224.1-99.6 224.1-222 0-59.3-25.2-115-67.1-157zm-157 341.6c-33.2 0-65.7-8.9-94-25.7l-6.7-4-69.8 18.3L72 359.2l-4.4-7c-18.5-29.4-28.2-63.3-28.2-98.2 0-101.7 82.8-184.5 184.6-184.5 49.3 0 95.6 19.2 130.4 54.1 34.8 34.9 56.2 81.2 56.1 130.5 0 101.8-84.9 184.6-186.6 184.6zm101.2-138.2c-5.5-2.8-32.8-16.2-37.9-18-5.1-1.9-8.8-2.8-12.5 2.8-3.7 5.6-14.3 18-17.6 21.8-3.2 3.7-6.5 4.2-12 1.4-32.6-16.3-54-29.1-75.5-66-5.7-9.8 5.7-9.1 16.3-30.3 1.8-3.7.9-6.9-.5-9.7-1.4-2.8-12.5-30.1-17.1-41.2-4.5-10.8-9.1-9.3-12.5-9.5-3.2-.2-6.9-.2-10.6-.2-3.7 0-9.7 1.4-14.8 6.9-5.1 5.6-19.4 19-19.4 46.3 0 27.3 19.9 53.7 22.6 57.4 2.8 3.7 39.1 59.7 94.8 83.8 35.2 15.2 49 16.5 66.6 13.9 10.7-1.6 32.8-13.4 37.4-26.4 4.6-13 4.6-24.1 3.2-26.4-1.3-2.5-5-3.9-10.5-6.6z" class=""></path></svg></a>';
}
$social .= '</div>';
return $social;
}
?>