public function updateTermMetiers() { $offres = $this->getAllOffres(); foreach ($offres as $keyO => $offres) { $emailOffre = get_field('email', $offres->ID); $argsFind = array( 'post_type' => 'profils_physiques', 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( 'key' => 'email', 'value' => $emailOffre, 'compare' => '=' ) ), ); $postFound = get_posts($argsFind); $isolatePost = $postFound[0]; $isolatePostID = $isolatePost->ID; $regionOffre = get_the_terms( $offres->ID, 'tax_metier'); $isolateRegion = $regionOffre[0]; dump($isolateRegion); $regionForProfil = get_term_by('name', $isolateRegion->name, 'profil_metier'); dump($regionForProfil); wp_set_post_terms($isolatePostID, array($regionForProfil->term_id), 'profil_metier'); // update_post_meta($offres->ID, 'lier_avec_le_profil', $isolatePostID); } } } // controller('ExampleController', ReworkController::class);
"Undefined offset: 0"
public function updateTermMetiers() { $offres = $this->getAllOffres(); foreach ($offres as $keyO => $offres) { $emailOffre = get_field('email', $offres->ID); $argsFind = array( 'post_type' => 'profils_physiques', 'posts_per_page' => -1, 'post_status' => 'publish', 'meta_query' => array( array( 'key' => 'email', 'value' => $emailOffre, 'compare' => '=' ) ), ); $postFound = get_posts($argsFind); $isolatePost = $postFound[0]; $isolatePostID = $isolatePost->ID; $regionOffre = get_the_terms( $offres->ID, 'tax_metier'); $isolateRegion = $regionOffre[0]; dump($isolateRegion); $regionForProfil = get_term_by('name', $isolateRegion->name, 'profil_metier'); dump($regionForProfil); wp_set_post_terms($isolatePostID, array($regionForProfil->term_id), 'profil_metier'); // update_post_meta($offres->ID, 'lier_avec_le_profil', $isolatePostID); } } } // controller('ExampleController', ReworkController::class);
8
"Undefined offset: 0"
"/home/krushby/www/wp-content/themes/ac-wp-theme/app/controllers/ReworkController.php"
298
array:10 [ "offres" => WP_Post {#2224} "keyO" => 4 "emailOffre" => "" "argsFind" => array:4 [ "post_type" => "profils_physiques" "posts_per_page" => -1 "post_status" => "publish" "meta_query" => array:1 [ 0 => array:3 [ "key" => "email" "value" => "" "compare" => "=" ] ] ] "postFound" => [] "isolatePost" => WP_Post {#3847} "isolatePostID" => 1170 "regionOffre" => array:1 [ 0 => WP_Term {#3869} ] "isolateRegion" => WP_Term {#3869} "regionForProfil" => WP_Term {#3818} ]
<?php /* Template Name: Reworkprofil */ ?> <?php get_header(); $RW = new ReworkController(); // $allOffres = $RW->getAllOffres(); // $createProfils = $RW->createProfilUnique(); // $addAggregatedContent= $RW->addAggregatedContent(); // $linkProfilsToOffers= $RW->linkProfilsToOffers(); // $insertTermRegion= $RW->insertTermRegion(); // $insertTermMetiers= $RW->insertTermMetiers(); // $updateTermRegion= $RW->updateTermRegion(); $updateTermMetiers= $RW->updateTermMetiers(); ?> <div class="container_rework"> </div> <?php get_footer(); ?>
} break; } } if ( ! $template ) { $template = get_index_template(); } /** * Filters the path of the current template before including it. * * @since 3.0.0 * * @param string $template The path of the template to include. */ $template = apply_filters( 'template_include', $template ); if ( $template ) { include $template; } elseif ( current_user_can( 'switch_themes' ) ) { $theme = wp_get_theme(); if ( $theme->errors() ) { wp_die( $theme->errors() ); } } return; }
"/home/krushby/www/wp-content/themes/ac-wp-theme/template-reworkprofil.php"
<?php /** * Loads the WordPress environment and template. * * @package WordPress */ if ( ! isset( $wp_did_header ) ) { $wp_did_header = true; // Load the WordPress library. require_once __DIR__ . '/wp-load.php'; // Set up the WordPress query. wp(); // Load the theme template. require_once ABSPATH . WPINC . '/template-loader.php'; }
"/home/krushby/www/wp-includes/template-loader.php"
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define( 'WP_USE_THEMES', true ); /** Loads the WordPress Environment and Template */ require __DIR__ . '/wp-blog-header.php';
"/home/krushby/www/wp-blog-header.php"
Key | Value |
query_vars | array:2 [ "page" => "" "pagename" => "rework-profils" ] |
query_string | "pagename=rework-profils"
|
request | "rework-profils"
|
matched_rule | "(.?.+?)(?:/([0-9]+))?/?$"
|
matched_query | "pagename=rework-profils&page="
|
did_permalink | true
|
Key | Value |
query | array:2 [ "page" => "" "pagename" => "rework-profils" ] |
query_vars | array:9 [ "pagename" => "rework-profils" "name" => "rework-profils" "cache_results" => true "update_post_term_cache" => true "lazy_load_term_meta" => true "update_post_meta_cache" => true "posts_per_page" => 10 "comments_per_page" => "50" "order" => "DESC" ] |
meta_query | WP_Meta_Query {#2153} |
queried_object | WP_Post {#2156} |
queried_object_id | 935
|
request | """ SELECT wpKA_posts.*\n \t\t\t\t\t FROM wpKA_posts \n \t\t\t\t\t WHERE 1=1 AND (wpKA_posts.ID = '935') AND wpKA_posts.post_type = 'page'\n \t\t\t\t\t \n \t\t\t\t\t ORDER BY wpKA_posts.post_date DESC\n \t\t\t\t\t """ |
post_count | 1
|
current_post | -1
|
before_loop | true
|
current_comment | -1
|
found_posts | 1
|
is_page | true
|
is_singular | true
|
Key | Value |
ID | 935
|
post_author | "1"
|
post_date | "2023-03-20 12:02:15"
|
post_date_gmt | "2023-03-20 11:02:15"
|
post_content | "" |
post_title | "REWORK PROFILS"
|
post_excerpt | "" |
post_status | "publish"
|
comment_status | "closed"
|
ping_status | "closed"
|
post_password | "" |
post_name | "rework-profils"
|
to_ping | "" |
pinged | "" |
post_modified | "2023-03-20 12:02:15"
|
post_modified_gmt | "2023-03-20 11:02:15"
|
post_content_filtered | "" |
post_parent | 0
|
guid | "https://krush-by-krysaudition.fr/?page_id=935"
|
menu_order | 0
|
post_type | "page"
|
post_mime_type | "" |
comment_count | "0"
|
filter | "raw"
|
Key | Value |
PHPSESSID | "33b237b0793948c5d48afbef8f5be9e9"
|
Key | Value |
ac_flash | [] |
Key | Value |
SERVER_SOFTWARE | "Apache"
|
REQUEST_URI | "/rework-profils/"
|
USER | "krushby"
|
SCRIPT_NAME | "/index.php"
|
QUERY_STRING | "" |
REQUEST_METHOD | "GET"
|
SERVER_PROTOCOL | "HTTP/1.1"
|
GATEWAY_INTERFACE | "CGI/1.1"
|
REDIRECT_URL | "/rework-profils/"
|
REMOTE_PORT | "58172"
|
SCRIPT_FILENAME | "/home/krushby/www/index.php"
|
SERVER_ADMIN | "postmaster@krush-by-krysaudition.fr"
|
DOCUMENT_ROOT | "/home/krushby/www"
|
REMOTE_ADDR | "3.147.65.95"
|
SERVER_PORT | "443"
|
SERVER_ADDR | "10.31.41.230"
|
SERVER_NAME | "krush-by-krysaudition.fr"
|
SERVER_SIGNATURE | "" |
HTTP_REMOTE_IP | "3.147.65.95"
|
HTTP_ACCEPT_ENCODING | "br, gzip"
|
HTTP_X_VARNISH | "469517772"
|
HTTP_X_AE | "br"
|
HTTP_X_SCHEME | "https"
|
HTTP_X_CDN_REQUEST_ID | "468826068"
|
HTTP_X_CDN_ANY_IP | "46.105.204.31"
|
HTTP_X_REMOTE_PORT | "23986"
|
HTTP_REMOTE_PORT | "23986"
|
HTTP_X_REMOTE_IP | "3.147.65.95"
|
HTTP_REFERER | "https://krush-by-krysaudition.fr/rework-profils"
|
HTTP_USER_AGENT | "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
|
HTTP_ACCEPT | "*/*"
|
HTTP_SCHEME | "https"
|
HTTP_X_OVHREQUEST_ID | "c2fcbb4775ae2d7d50edc9e9b4b982e6"
|
HTTP_X_FORWARDED_PROTO | "https"
|
HTTP_X_FORWARDED_FOR | "3.147.65.95"
|
HTTP_X_PREDICTOR | "1"
|
HTTP_COOKIE | "PHPSESSID=33b237b0793948c5d48afbef8f5be9e9"
|
HTTP_HOST | "krush-by-krysaudition.fr"
|
ENVIRONMENT | "production"
|
CFG_CLUSTER | "cluster031"
|
HTTP_AUTHORIZATION | "" |
HTTPS | "on"
|
SCRIPT_URI | "https://krush-by-krysaudition.fr:443/rework-profils/"
|
SCRIPT_URL | "/rework-profils/"
|
GEOIP_LONGITUDE | "-83.006104"
|
GEOIP_LATITUDE | "39.962502"
|
GEOIP_AREA_CODE | "614"
|
GEOIP_DMA_CODE | "535"
|
GEOIP_CITY | "Columbus"
|
GEOIP_REGION | "OH"
|
GEOIP_COUNTRY_NAME | "United States"
|
GEOIP_COUNTRY_CODE | "US"
|
UNIQUE_ID | "ZtzyMKqqOn5MGm6PCn7Y2gAAAFQ"
|
REDIRECT_STATUS | "200"
|
FCGI_ROLE | "RESPONDER"
|
PHP_SELF | "/index.php"
|
REQUEST_TIME_FLOAT | 1725755952.6616
|
REQUEST_TIME | 1725755952
|
argv | [] |
argc | 0
|
Key | Value |
USER | "krushby"
|
SCRIPT_NAME | "/index.php"
|
REQUEST_URI | "/rework-profils/"
|
QUERY_STRING | "" |
REQUEST_METHOD | "GET"
|
SERVER_PROTOCOL | "HTTP/1.1"
|
GATEWAY_INTERFACE | "CGI/1.1"
|
REDIRECT_URL | "/rework-profils/"
|
REMOTE_PORT | "58172"
|
SCRIPT_FILENAME | "/home/krushby/www/index.php"
|
SERVER_ADMIN | "postmaster@krush-by-krysaudition.fr"
|
DOCUMENT_ROOT | "/home/krushby/www"
|
REMOTE_ADDR | "3.147.65.95"
|
SERVER_PORT | "443"
|
SERVER_ADDR | "10.31.41.230"
|
SERVER_NAME | "krush-by-krysaudition.fr"
|
SERVER_SOFTWARE | "Apache"
|
SERVER_SIGNATURE | "" |
HTTP_REMOTE_IP | "3.147.65.95"
|
HTTP_ACCEPT_ENCODING | "br, gzip"
|
HTTP_X_VARNISH | "469517772"
|
HTTP_X_AE | "br"
|
HTTP_X_SCHEME | "https"
|
HTTP_X_CDN_REQUEST_ID | "468826068"
|
HTTP_X_CDN_ANY_IP | "46.105.204.31"
|
HTTP_X_REMOTE_PORT | "23986"
|
HTTP_REMOTE_PORT | "23986"
|
HTTP_X_REMOTE_IP | "3.147.65.95"
|
HTTP_REFERER | "https://krush-by-krysaudition.fr/rework-profils"
|
HTTP_USER_AGENT | "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"
|
HTTP_ACCEPT | "*/*"
|
HTTP_SCHEME | "https"
|
HTTP_X_OVHREQUEST_ID | "c2fcbb4775ae2d7d50edc9e9b4b982e6"
|
HTTP_X_FORWARDED_PROTO | "https"
|
HTTP_X_FORWARDED_FOR | "3.147.65.95"
|
HTTP_X_PREDICTOR | "1"
|
HTTP_COOKIE | "PHPSESSID=33b237b0793948c5d48afbef8f5be9e9"
|
HTTP_HOST | "krush-by-krysaudition.fr"
|
ENVIRONMENT | "production"
|
CFG_CLUSTER | "cluster031"
|
HTTP_AUTHORIZATION | "" |
HTTPS | "on"
|
SCRIPT_URI | "https://krush-by-krysaudition.fr:443/rework-profils/"
|
SCRIPT_URL | "/rework-profils/"
|
GEOIP_LONGITUDE | "-83.006104"
|
GEOIP_LATITUDE | "39.962502"
|
GEOIP_AREA_CODE | "614"
|
GEOIP_DMA_CODE | "535"
|
GEOIP_CITY | "Columbus"
|
GEOIP_REGION | "OH"
|
GEOIP_COUNTRY_NAME | "United States"
|
GEOIP_COUNTRY_CODE | "US"
|
UNIQUE_ID | "ZtzyMKqqOn5MGm6PCn7Y2gAAAFQ"
|
REDIRECT_STATUS | "200"
|
FCGI_ROLE | "RESPONDER"
|
PHP_SELF | "/index.php"
|
REQUEST_TIME_FLOAT | 1725755952.6616
|
REQUEST_TIME | 1725755952
|
argv | [] |
argc | 0
|