-
Hello,
I have a custom field called “listing_type”, which I want to use in a post types seo title element. Unfortunally, the listing type is sanitized in the database. So I had to modify the code getting the custom field (see below). Is there any hook / action / filter I can use so that I do NOT have to edit rankmath core files anymore?
Thanks in advance!
public function get_customfield( $name ) {
global $post;$on_screen = is_singular() || is_admin();
$has_post = is_object( $post ) && isset( $post->ID );
if ( Str::is_non_empty( $name ) && $on_screen && $has_post ) {$name = get_post_meta( $post->ID, $name, true );
if ( '' !== $name ) {
if($name == "grundstuecke")
{
$name = "grundstücke";
}
if($name == "buero")
{
$name = "büro";
}return ucfirst($name);
}
}return null;
}
The ticket ‘Use custom field as title element but modify its value’ is closed to new replies.