/
home
/
faureele
/
aura
/
wp-content
/
themes
/
JUSTCarsRegion
/
Upload File
HOME
<?php /* Ajoute la feuille de style du thème parent */ add_action( 'wp_enqueue_scripts', 'wpchild_enqueue_styles' ); function wpchild_enqueue_styles(){ wp_enqueue_style( 'ns-theme-style', get_template_directory_uri() . '/style.css' ); } // Donner les droits d'accès Caldera Form / Vue avec token // Si Token / Signature - valide / vu ok add_action('wp_enqueue_scripts', function(){ $form_id='CF5ec2926e8b110'; Caldera_Forms_Render_Assets::enqueue_script('api-client'); $config=new Caldera_Forms_API_JsConfig(Caldera_Forms_Forms::get_form($form_id)); wp_localize_script(Caldera_Forms_Render_Assets::make_slug('api-client'), 'MYOBJ', $config->toArray()); }); add_action('send_headers', 'xframe_options'); function xframe_options(){ header("X-Frame-Options: ALLOW-FROM http://extranet.just-til.fr/"); } add_action( 'rest_api_init', 'add_thumbnail_to_JSON' ); function add_thumbnail_to_JSON() { //Add featured image register_rest_field( 'post', 'featured_image_src', //NAME OF THE NEW FIELD TO BE ADDED - you can call this anything array( 'get_callback' => 'get_image_src', 'update_callback' => null, 'schema' => null, ) ); } function get_image_src( $object, $field_name, $request ) { $size = 'large'; // Change this to the size you want | 'medium' / 'large' $feat_img_array = wp_get_attachment_image_src($object['featured_media'], $size, true); return $feat_img_array[0]; } // //in front-end admin class is not included // require_once( CFCORE_PATH . 'classes/admin.php' ); // // //Be sure to set the correct form ID below // $form_id = 'CF5ec2926e8b110'; // // //get all entires (page 1 with 9999999 entries per page should do it:) // $data = Caldera_Forms_Admin::get_entries( $form_id, 1, 9999999 ); // // //$data has extra meta info. $entries has just the entries // $entries = $data[ 'entries' ]; /** * Load Caldera Forms API client * * Requires Caldera Forms 1.5 or later * * Only works for admins */ add_action( 'wp_enqueue_scripts', function(){ //change this to your form ID $form_id = 'CF5ec2926e8b110'; //load api client JavaScript Caldera_Forms_Render_Assets::enqueue_script( 'api-client' ); //Print useful info to DOM $config = new Caldera_Forms_API_JsConfig( Caldera_Forms_Forms::get_form( $form_id ) ); wp_localize_script( Caldera_Forms_Render_Assets::make_slug( 'api-client' ), 'MYOBJ', $config->toArray() ); }); add_action( 'wp_enqueue_scripts', function(){ //change this to your form ID $form_id = 'CF5ec2926e8b110'; //load api client JavaScript Caldera_Forms_Render_Assets::enqueue_script( 'api-client' ); //Print useful info to DOM $config = new Caldera_Forms_API_JsConfig( Caldera_Forms_Forms::get_form( $form_id ) ); $data = $config->toArray(); //Will allow for viewing by a user of editor role or higher $data[ 'api' ][ 'token' ] = Caldera_Forms_API_Token::make_token( 'super-admin', $form_id ); wp_localize_script( Caldera_Forms_Render_Assets::make_slug( 'api-client' ), 'MYOBJ', $data ); }); // SUPPRESSION DU NUMERO DE VERSION DE WORDPRESS function dc_delete_version() { return ''; } add_filter('the_generator', 'dc_delete_version'); // AJOUT DES ICONES FONT AWESOME function dc_load_fontawesome() { wp_enqueue_style( 'font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', null, '4.7.0' ); } add_action('wp_enqueue_scripts', 'dc_load_fontawesome'); // MASQUER LES ERREURS DE CONNEXION A L'ADMINISTRATION function wpm_hide_errors() { return "L'identifiant ou le mot de passe est incorrect"; } add_filter('login_errors', 'wpm_hide_errors'); // BEGIN ENQUEUE PARENT ACTION // MODAL /** * Scripts et styles additionnels */ function external_scripts_and_styles() { wp_enqueue_script( 'modaal-js', get_stylesheet_directory_uri() . '/js/modaal.min.js', array( 'jquery' ) ); wp_enqueue_style('modaal-css', get_stylesheet_directory_uri() . '/css/modaal.min.css'); wp_register_script('js-custom', get_stylesheet_directory_uri() .'/js/custom.js', array('jquery'), '', true ); wp_enqueue_script( 'js-custom' ); } add_action( 'wp_enqueue_scripts', 'external_scripts_and_styles' ); // === Shortcode Trip Planner Widget === function trip_planner_widget_shortcode() { ob_start(); ?> <div data-is-widget data-domain="sim.oura.com" data-widget-type="trip-planner" data-locale="fr" data-horizontal ></div> <script src="//sim.oura.com/widget/v1/installer.js"></script> <?php return ob_get_clean(); } add_shortcode('trip_planner', 'trip_planner_widget_shortcode');