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 {#2927} "keyO" => 1 "emailOffre" => "henri.terrier@kry-audition.com" "argsFind" => array:4 [ "post_type" => "profils_physiques" "posts_per_page" => -1 "post_status" => "publish" "meta_query" => array:1 [ 0 => array:3 [ "key" => "email" "value" => "henri.terrier@kry-audition.com" "compare" => "=" ] ] ] "postFound" => [] "isolatePost" => WP_Post {#4976} "isolatePostID" => 1400 "regionOffre" => array:1 [ 0 => WP_Term {#4981} ] "isolateRegion" => WP_Term {#4981} "regionForProfil" => WP_Term {#4945} ]
<?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(); ?>
/**
* 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 ) {
/**
* Fires immediately before including the template.
*
* @since 6.9.0
*
* @param string $template The path of the template about to be included.
*/
do_action( 'wp_before_include_template', $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:10 [ "pagename" => "rework-profils" "name" => "rework-profils" "fields" => "all" "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 {#2839} |
| queried_object | WP_Post {#2842} |
| 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 | "85ff8170c0e974cb0b9407be84212e75"
|
| 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 | "40626"
|
| SCRIPT_FILENAME | "/home/krushby/www/index.php"
|
| SERVER_ADMIN | "postmaster@krush-by-krysaudition.fr"
|
| DOCUMENT_ROOT | "/home/krushby/www"
|
| REMOTE_ADDR | "216.73.216.166"
|
| SERVER_PORT | "443"
|
| SERVER_ADDR | "10.131.40.9"
|
| SERVER_NAME | "krush-by-krysaudition.fr"
|
| SERVER_SIGNATURE | "" |
| HTTP_REMOTE_IP | "216.73.216.166"
|
| HTTP_ACCEPT_ENCODING | "br, gzip"
|
| HTTP_X_VARNISH | "267278551"
|
| HTTP_X_AE | "br"
|
| HTTP_X_SCHEME | "https"
|
| HTTP_X_CDN_REQUEST_ID | "266280167"
|
| HTTP_X_CDN_ANY_IP | "46.105.204.31"
|
| HTTP_X_REMOTE_PORT | "5312"
|
| HTTP_REMOTE_PORT | "5312"
|
| HTTP_X_REMOTE_IP | "216.73.216.166"
|
| 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 | "2d7899ee1569217c31fd2f9d643e94ff"
|
| HTTP_X_FORWARDED_PROTO | "https"
|
| HTTP_X_FORWARDED_FOR | "216.73.216.166"
|
| HTTP_X_PREDICTOR | "1"
|
| HTTP_COOKIE | "PHPSESSID=85ff8170c0e974cb0b9407be84212e75"
|
| HTTP_HOST | "krush-by-krysaudition.fr"
|
| ENVIRONMENT | "production"
|
| CFG_CLUSTER | "cluster131"
|
| HTTP_AUTHORIZATION | "" |
| HTTPS | "on"
|
| SCRIPT_URI | "https://krush-by-krysaudition.fr:443/rework-profils/"
|
| SCRIPT_URL | "/rework-profils/"
|
| GEOIP_LONGITUDE | "-119.070099"
|
| GEOIP_LATITUDE | "34.355598"
|
| GEOIP_AREA_CODE | "805"
|
| GEOIP_DMA_CODE | "803"
|
| GEOIP_CITY | "Santa Paula"
|
| GEOIP_REGION | "CA"
|
| GEOIP_COUNTRY_NAME | "United States"
|
| GEOIP_COUNTRY_CODE | "US"
|
| UNIQUE_ID | "aT96g3cpuGeez3OK3cIWWAAAAlg"
|
| REDIRECT_STATUS | "200"
|
| FCGI_ROLE | "RESPONDER"
|
| PHP_SELF | "/index.php"
|
| REQUEST_TIME_FLOAT | 1765767811.3855
|
| REQUEST_TIME | 1765767811
|
| 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 | "40626"
|
| SCRIPT_FILENAME | "/home/krushby/www/index.php"
|
| SERVER_ADMIN | "postmaster@krush-by-krysaudition.fr"
|
| DOCUMENT_ROOT | "/home/krushby/www"
|
| REMOTE_ADDR | "216.73.216.166"
|
| SERVER_PORT | "443"
|
| SERVER_ADDR | "10.131.40.9"
|
| SERVER_NAME | "krush-by-krysaudition.fr"
|
| SERVER_SOFTWARE | "Apache"
|
| SERVER_SIGNATURE | "" |
| HTTP_REMOTE_IP | "216.73.216.166"
|
| HTTP_ACCEPT_ENCODING | "br, gzip"
|
| HTTP_X_VARNISH | "267278551"
|
| HTTP_X_AE | "br"
|
| HTTP_X_SCHEME | "https"
|
| HTTP_X_CDN_REQUEST_ID | "266280167"
|
| HTTP_X_CDN_ANY_IP | "46.105.204.31"
|
| HTTP_X_REMOTE_PORT | "5312"
|
| HTTP_REMOTE_PORT | "5312"
|
| HTTP_X_REMOTE_IP | "216.73.216.166"
|
| 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 | "2d7899ee1569217c31fd2f9d643e94ff"
|
| HTTP_X_FORWARDED_PROTO | "https"
|
| HTTP_X_FORWARDED_FOR | "216.73.216.166"
|
| HTTP_X_PREDICTOR | "1"
|
| HTTP_COOKIE | "PHPSESSID=85ff8170c0e974cb0b9407be84212e75"
|
| HTTP_HOST | "krush-by-krysaudition.fr"
|
| ENVIRONMENT | "production"
|
| CFG_CLUSTER | "cluster131"
|
| HTTP_AUTHORIZATION | "" |
| HTTPS | "on"
|
| SCRIPT_URI | "https://krush-by-krysaudition.fr:443/rework-profils/"
|
| SCRIPT_URL | "/rework-profils/"
|
| GEOIP_LONGITUDE | "-119.070099"
|
| GEOIP_LATITUDE | "34.355598"
|
| GEOIP_AREA_CODE | "805"
|
| GEOIP_DMA_CODE | "803"
|
| GEOIP_CITY | "Santa Paula"
|
| GEOIP_REGION | "CA"
|
| GEOIP_COUNTRY_NAME | "United States"
|
| GEOIP_COUNTRY_CODE | "US"
|
| UNIQUE_ID | "aT96g3cpuGeez3OK3cIWWAAAAlg"
|
| REDIRECT_STATUS | "200"
|
| FCGI_ROLE | "RESPONDER"
|
| PHP_SELF | "/index.php"
|
| REQUEST_TIME_FLOAT | 1765767811.3855
|
| REQUEST_TIME | 1765767811
|
| argv | [] |
| argc | 0
|