refining fields

This commit is contained in:
Antoine M 2024-05-27 15:17:50 +02:00
parent ccccbf238e
commit 902e08eb8d
2 changed files with 6 additions and 12 deletions

View File

@ -17,11 +17,13 @@ if (class_exists('GF_Field')) {
'post_type' => 'brochures',
'posts_per_page' => -1,
'post_status' => 'publish',
'order' => 'DESC',
'orderby' => 'date',
'order' => 'ASC',
'orderby' => 'title',
'meta_key' => 'brochure_pdf',
'meta_value' => false,
'meta_compare' => '!=',
'post__not_in' => [4431, 4436, 7222, 5825, 6505]
));
$choices = [];

View File

@ -5,17 +5,10 @@ if (class_exists('GF_Field')) {
{
public $type = 'order_documents_list';
private function buildChoicesArray()
{
$posts_array = [
[
'text' => 'La synthèse des primes',
'ID_fr' => 7153,
'ID_nl' => 7157,
],
[
'text' => 'Flyer Général',
'ID_fr' => 7425,
@ -29,7 +22,7 @@ if (class_exists('GF_Field')) {
[
'text' => 'Jeu memo Sherif',
'ID_fr' => 7419,
'ID_nl' => 7419,
'ID_nl' => 7464,
],
];
@ -41,6 +34,7 @@ if (class_exists('GF_Field')) {
$choices[] = [
'title' => get_the_title($id),
'text' => get_the_title($id),
'ID' => $id,
];
}
@ -129,12 +123,10 @@ if (class_exists('GF_Field')) {
private function PrettyListDocumentOrder($value)
{
$documentOrderPreviewHtml = '<ul>';
foreach ($value as $brochure => $quantities) {
$documentOrderAmountHtml = null;
if ($quantities["quantity_fr"]) {
$documentOrderAmountHtml .= '<li>' . __("Quantité FR: ", "homegrade-theme__texte-fonctionnel") . '<span class="brochure_quantity">' . $quantities["quantity_fr"] . '</span></li>';
}