essai1
4
admin_credentials.txt
Normal file
@ -0,0 +1,4 @@
|
||||
WordPress Admin Credentials:
|
||||
URL: http://localhost/wp-admin
|
||||
Username: admin
|
||||
Password: GDxU4zAjMCE945O8
|
||||
BIN
assets/vm-shot-2026-01-26T11-35-05-786Z.jpg
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
assets/vm-shot-2026-01-26T11-35-21-768Z.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
assets/vm-shot-2026-01-26T11-35-30-801Z.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
assets/vm-shot-2026-01-26T11-39-15-260Z.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
assets/vm-shot-2026-01-26T11-54-24-787Z.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
assets/vm-shot-2026-01-26T11-54-38-389Z.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
assets/vm-shot-2026-01-26T11-56-16-929Z.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
assets/vm-shot-2026-01-26T13-33-13-586Z.jpg
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
assets/vm-shot-2026-01-26T13-41-42-697Z.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
assets/vm-shot-2026-01-26T13-43-33-368Z.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
assets/vm-shot-2026-01-26T14-46-07-412Z.jpg
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
assets/vm-shot-2026-01-26T14-58-14-516Z.jpg
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
assets/vm-shot-2026-01-26T14-58-25-621Z.jpg
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
assets/vm-shot-2026-01-26T14-58-42-937Z.jpg
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
assets/vm-shot-2026-01-26T15-04-37-249Z.jpg
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
assets/vm-shot-2026-01-26T15-04-49-828Z.jpg
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
assets/vm-shot-2026-01-26T15-20-42-350Z.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
assets/vm-shot-2026-01-26T15-20-58-875Z.jpg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
assets/vm-shot-2026-01-26T15-21-19-157Z.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
assets/vm-shot-2026-01-26T15-21-45-883Z.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
assets/vm-shot-2026-01-27T08-23-41-822Z.jpg
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
assets/vm-shot-2026-01-27T08-23-57-939Z.jpg
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
assets/vm-shot-2026-01-27T08-24-19-323Z.jpg
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
assets/vm-shot-2026-01-27T08-24-32-288Z.jpg
Normal file
|
After Width: | Height: | Size: 49 KiB |
36
wp-content/mu-plugins/annuaire-04.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Annuaire Local 04
|
||||
* Description: Core functionality for the 04 directory.
|
||||
*/
|
||||
|
||||
add_action('init', function() {
|
||||
register_post_type('listing', [
|
||||
'labels' => [
|
||||
'name' => 'Fiches',
|
||||
'singular_name' => 'Fiche',
|
||||
'add_new' => 'Ajouter une fiche',
|
||||
'edit_item' => 'Modifier la fiche',
|
||||
],
|
||||
'public' => true,
|
||||
'has_archive' => true,
|
||||
'show_in_rest' => true,
|
||||
'supports' => ['title', 'editor', 'thumbnail', 'excerpt', 'custom-fields'],
|
||||
'menu_icon' => 'dashicons-store',
|
||||
'rewrite' => ['slug' => 'annuaire-pro'],
|
||||
]);
|
||||
|
||||
register_taxonomy('cat_pro', 'listing', [
|
||||
'labels' => ['name' => 'Catégories', 'singular_name' => 'Catégorie'],
|
||||
'hierarchical' => true,
|
||||
'show_in_rest' => true,
|
||||
'rewrite' => ['slug' => 'categorie-pro'],
|
||||
]);
|
||||
|
||||
register_taxonomy('ville_pro', 'listing', [
|
||||
'labels' => ['name' => 'Villes', 'singular_name' => 'Ville'],
|
||||
'hierarchical' => true,
|
||||
'show_in_rest' => true,
|
||||
'rewrite' => ['slug' => 'ville'],
|
||||
]);
|
||||
});
|
||||
@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin Name: Flatlogic URL Preserver
|
||||
* Description: Automatically attaches fl_project to all links on the page.
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
// Function to fetch the ID once per request
|
||||
function fl_get_env_project_id() {
|
||||
static $cached_id = null;
|
||||
if ($cached_id !== null) return $cached_id;
|
||||
|
||||
$cached_id = getenv('PROJECT_ID');
|
||||
|
||||
if (!$cached_id) {
|
||||
$envPath = ABSPATH . '../.env';
|
||||
if (file_exists($envPath)) {
|
||||
$lines = file($envPath, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
foreach ($lines as $line) {
|
||||
if (strpos(trim($line), 'PROJECT_ID=') === 0) {
|
||||
$cached_id = trim(str_replace('PROJECT_ID=', '', $line), "\"' ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $cached_id;
|
||||
}
|
||||
|
||||
// The core function to modify the URL
|
||||
function fl_append_project_param( $url ) {
|
||||
$pid = fl_get_env_project_id();
|
||||
if ( ! $pid || empty( $url ) || strpos( $url, '#' ) === 0 ) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
// Only append if it's an internal link
|
||||
if ( strpos( $url, home_url() ) === 0 || ( strpos( $url, '/' ) === 0 && strpos( $url, '//' ) !== 0 ) ) {
|
||||
return add_query_arg( 'fl_project', $pid, $url );
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
|
||||
// Apply to all link filters
|
||||
$filters = [
|
||||
'post_link', 'page_link', 'post_type_link',
|
||||
'term_link', 'attachment_link',
|
||||
'author_link', 'category_link', 'tag_link'
|
||||
];
|
||||
|
||||
foreach ( $filters as $f ) {
|
||||
add_filter( $f, 'fl_append_project_param' );
|
||||
}
|
||||
|
||||
// Special case: Navigation Menus
|
||||
add_filter( 'nav_menu_link_attributes', function( $atts ) {
|
||||
if ( isset( $atts['href'] ) ) {
|
||||
$atts['href'] = fl_append_project_param( $atts['href'] );
|
||||
}
|
||||
return $atts;
|
||||
}, 10, 1 );
|
||||