From ceef565edd93ea159a0802574f51ebd7aedc1e5c Mon Sep 17 00:00:00 2001 From: jorge-vitrubio Date: Sun, 24 Jul 2022 11:42:11 +0200 Subject: [PATCH] moved control home to hangar plugin, menu "Hangar Options" --- functions.php | 124 +++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 61 deletions(-) diff --git a/functions.php b/functions.php index 3947132..a2ad727 100644 --- a/functions.php +++ b/functions.php @@ -136,68 +136,70 @@ function has_subcategories($catt) endif; } +// commented on 2022/08/24 moved code to hangar-wp-plugin +// //construim un panell de control a l'administració per a que vegin les que estan marcades per a sortir a la home -function menu_control_home(){ - add_menu_page( "Control Home","Control Home", "add_users", "control_home", "control_home", "", 6 ); -} - -function control_home(){ - - global $wpdb; - $querystr = " - SELECT wposts.post_name,wposts.ID, users.user_login, m1.meta_value as inicio, m2.meta_value as orden - FROM $wpdb->posts wposts - INNER JOIN $wpdb->postmeta m1 ON wposts.ID = m1.post_id - INNER JOIN $wpdb->postmeta m2 ON wposts.ID = m2.post_id - INNER JOIN $wpdb->users users ON wposts.post_author = users.ID - WHERE (wposts.post_type = 'post' OR wposts.post_type = 'page') - AND m1.meta_key = 'Inici' - AND m1.meta_value = '1' - AND m2.meta_key = 'Ordre_inici' - GROUP BY ID - ORDER BY inicio DESC, CAST(orden AS SIGNED) ASC - "; - - echo'
-

Control Home


'; - - $pageposts = $wpdb->get_results($querystr, OBJECT); - if ($pageposts): - global $post; - - - echo " - - - - - - - - - - "; - - foreach ($pageposts as $post): - $nom = $post->post_name; - $id = $post->ID; - $autor = $post->user_login; - $inici = $post->inicio; - $ordre = $post->orden; - echo " - - - - - - "; - endforeach; - echo "
Nombre PostIdAutor PostInicioOrden
$nom$id$autor$inici$ordre
"; - endif; - -} - -add_action("admin_menu","menu_control_home"); +// function menu_control_home(){ +// add_menu_page( "Control Home","Control Home", "add_users", "control_home", "control_home", "", 6 ); +// } +// +// function control_home(){ +// +// global $wpdb; +// $querystr = " +// SELECT wposts.post_name,wposts.ID, users.user_login, m1.meta_value as inicio, m2.meta_value as orden +// FROM $wpdb->posts wposts +// INNER JOIN $wpdb->postmeta m1 ON wposts.ID = m1.post_id +// INNER JOIN $wpdb->postmeta m2 ON wposts.ID = m2.post_id +// INNER JOIN $wpdb->users users ON wposts.post_author = users.ID +// WHERE (wposts.post_type = 'post' OR wposts.post_type = 'page') +// AND m1.meta_key = 'Inici' +// AND m1.meta_value = '1' +// AND m2.meta_key = 'Ordre_inici' +// GROUP BY ID +// ORDER BY inicio DESC, CAST(orden AS SIGNED) ASC +// "; +// +// echo'
+//

Control Home


'; +// +// $pageposts = $wpdb->get_results($querystr, OBJECT); +// if ($pageposts): +// global $post; +// +// +// echo " +// +// +// +// +// +// +// +// +// +// "; +// +// foreach ($pageposts as $post): +// $nom = $post->post_name; +// $id = $post->ID; +// $autor = $post->user_login; +// $inici = $post->inicio; +// $ordre = $post->orden; +// echo " +// +// +// +// +// +// "; +// endforeach; +// echo "
Nombre PostIdAutor PostInicioOrden
$nom$id$autor$inici$ordre
"; +// endif; +// +// } +// +// add_action("admin_menu","menu_control_home"); // Filtre que modifica la funcio que mostra els menús, per poder seleccionar mitjançant el camp title, quines seràn links i quines no. // title= no_link -> no es un link