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', 'post_type' => 'brochures',
'posts_per_page' => -1, 'posts_per_page' => -1,
'post_status' => 'publish', 'post_status' => 'publish',
'order' => 'DESC', 'order' => 'ASC',
'orderby' => 'date', 'orderby' => 'title',
'meta_key' => 'brochure_pdf', 'meta_key' => 'brochure_pdf',
'meta_value' => false, 'meta_value' => false,
'meta_compare' => '!=', 'meta_compare' => '!=',
'post__not_in' => [4431, 4436, 7222, 5825, 6505]
)); ));
$choices = []; $choices = [];

View File

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