handling translation for contract type
This commit is contained in:
parent
0f22068330
commit
43b229b970
|
|
@ -8,6 +8,24 @@ $args = array(
|
||||||
|
|
||||||
$offresEmplois = new WP_Query($args);
|
$offresEmplois = new WP_Query($args);
|
||||||
|
|
||||||
|
|
||||||
|
if (!function_exists("translateContractType")) {
|
||||||
|
|
||||||
|
function translateContractType($contractType)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch ($contractType) {
|
||||||
|
case 'CDI, temps plein':
|
||||||
|
return __("CDI, temps plein", "homegrade-theme__texte-fonctionnel");
|
||||||
|
break;
|
||||||
|
case 'CDI, 4/5e':
|
||||||
|
return __("CDI, 4/5e", "homegrade-theme__texte-fonctionnel");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
||||||
|
|
@ -27,10 +45,11 @@ $offresEmplois = new WP_Query($args);
|
||||||
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
||||||
$offrePermalink = get_the_permalink($offre->ID);
|
$offrePermalink = get_the_permalink($offre->ID);
|
||||||
get_the_content($offre->ID);
|
get_the_content($offre->ID);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li class="homegrade-blocks-offres-emplois__offre">
|
<li class="homegrade-blocks-offres-emplois__offre">
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo $contractType ?></p>
|
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo translateContractType($contractType) ?></p>
|
||||||
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,24 @@ $args = array(
|
||||||
|
|
||||||
$offresEmplois = new WP_Query($args);
|
$offresEmplois = new WP_Query($args);
|
||||||
|
|
||||||
|
|
||||||
|
if (!function_exists("translateContractType")) {
|
||||||
|
|
||||||
|
function translateContractType($contractType)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch ($contractType) {
|
||||||
|
case 'CDI, temps plein':
|
||||||
|
return __("CDI, temps plein", "homegrade-theme__texte-fonctionnel");
|
||||||
|
break;
|
||||||
|
case 'CDI, 4/5e':
|
||||||
|
return __("CDI, 4/5e", "homegrade-theme__texte-fonctionnel");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
<section <?php echo get_block_wrapper_attributes(["class" => "homegrade-blocks-offres-emplois"]); ?>>
|
||||||
|
|
@ -27,10 +45,11 @@ $offresEmplois = new WP_Query($args);
|
||||||
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
$contractType = get_field("contract_type", $offre->ID) ? get_field("contract_type", $offre->ID)['label'] : null;
|
||||||
$offrePermalink = get_the_permalink($offre->ID);
|
$offrePermalink = get_the_permalink($offre->ID);
|
||||||
get_the_content($offre->ID);
|
get_the_content($offre->ID);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<li class="homegrade-blocks-offres-emplois__offre">
|
<li class="homegrade-blocks-offres-emplois__offre">
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
<p class="homegrade-blocks-offres-emplois__offre-title"><a href="<?php echo $offrePermalink ?>"><?php echo $offre->post_title ?></a></p>
|
||||||
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo $contractType ?></p>
|
<p class="homegrade-blocks-offres-emplois__offre-type"><?php echo translateContractType($contractType) ?></p>
|
||||||
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
<a class="homegrade-blocks-offres-emplois__offre-download cta cta--secondary cta--button" href="<?php echo $offrePermalink ?>"><?php echo __("Consulter l'offre", "homegrade-blocks") ?></a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user