MAJ 18022024
This commit is contained in:
@@ -304,4 +304,21 @@ function update_acf_mission($post, $request) {
|
||||
}
|
||||
}
|
||||
|
||||
add_action('rest_after_insert_page', 'update_acf_mission', 10, 2);
|
||||
add_action('rest_after_insert_page', 'update_acf_mission', 10, 2);
|
||||
|
||||
function add_rankmath_to_rest_api($response, $post, $request) {
|
||||
$seo_meta = get_post_meta($post->ID, 'rank_math_description', true);
|
||||
$seo_title = get_post_meta($post->ID, 'rank_math_title', true);
|
||||
|
||||
if (!empty($seo_meta)) {
|
||||
$response->data['seo_description'] = $seo_meta;
|
||||
}
|
||||
|
||||
if (!empty($seo_title)) {
|
||||
$response->data['seo_title'] = $seo_title;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
add_filter('rest_prepare_page', 'add_rankmath_to_rest_api', 10, 3);
|
||||
Reference in New Issue
Block a user