Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8713813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:25:51+00:00 2026-06-13T05:25:51+00:00

Using filters/hooks, how would I replace the title of a wordpress post with whatever

  • 0

Using filters/hooks, how would I replace the title of a wordpress post with whatever term has been selected from a custom taxonomy.

Hopefully the attached image will explain what I’m trying to do.

enter image description here

Let’s say I selected ‘Powerchrono’ – I would like the title of the post to be replaced with the selected term, and it’s parent.

Any help would be much appreciated.

I’d obviously like the url of the post to also be updated too.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:25:55+00:00Added an answer on June 13, 2026 at 5:25 am

    I can’t guarantee this will work straight out of the gate since it’s untested. But this should get you started:

    functions.php

    <?php
    add_action('save_post', 'update_term_title');
    function update_term_title($post_id)
    {
        if(defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) 
            return;
        if(!current_user_can('edit_post', $post_id))
            return;
    
        //Replace 'manufacturer' with whatever your custom taxonomy slug is
        $terms = wp_get_post_terms($post_id, 'manufacturer');
    
        if(empty($terms))
            return;
    
        $title = false;
        foreach($terms as $term)
        {
            if($term->parent)
            {
                $parent = get_term($term->parent, 'manufacturer');
                $title = $term->name.' '.$parent->name;
                break;
            }
        }
        /*Default to first selected term name if no children were found*/
        $title = $title ? $title : $terms[0]->name;
    
        /*We must disable this hook and reenable from within
        if we don't want to get caught in a loop*/
        remove_action('save_post', 'update_term_title');
        $update = array(
            'ID'=>$post_id,
            'post_name'=>sanitize_title_with_dashes($title),
            'post_title'=>$title
        );
        wp_update_post($update);
        add_action('save_post', 'update_term_title');
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using filters in Sinatra the way it has been declared in the
I'm trying to follow this tutorial using StructureMap : http://iridescence.no/post/Constructor-Injection-for-ASPNET-MVC-Action-Filters.aspx What I'm trying to
How to remove noise from ecg signal in ecg.wav format using filters in matlab
So, I have a problem when using filters in forms in Zend Framework. When
In a webapp I'm using several filters and in one of the filter I'm
I want to filter my model object using two filters. So, it can be
I am using a Repository pattern with filters in my MVC application. The project
I am using org.tuckey.web.filters.urlrewrite.UrlRewriteFilter on my java project.It works fine .My issue is it
I'm using tesseract in my iPhone application. I tried several filters on my image
I'm trying to create a plugin that will allow WordPress to be accessed from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.