0

Been trying to wrap my head around using filters to change titles. I've been using a third party plugin to incorporate real estate listings. Having contacted the developer on asking if I could change the listing titles he mentioned I could use filters to do so.

His response was

"The Singe Page can be changed, you need to use the following filter to change the page title.

soldpress_sync_post_title

apply_filters('soldpress_sync_post_title', $title, $post);"

So I've tried

apply_filters('soldpress_sync_post_title', $title, $post);
add_filter ('soldpress_sync_post_title', 'property_title');

function property_title($title) {
$title = "Testing";
return $title;
}

Im curious if anyone can tell if this is the right way or Im at least headed in the right direction.

  • Are you sure you want to apply the filters then add your filter? Don't you want to add before you apply, not afterwards? The order you do things in matters – Tom J Nowell Feb 23 '15 at 1:14
  • First time really working with filters, I tried it both ways but nothing changes either way. Didnt realize that order of these filters was important, thanks. – Phrosty30 Feb 23 '15 at 2:14
  • programs always operate sequentially within a particular scope, what you did is the equivalent of nominating yourself for the presidency 2 weeks after the votes have been counted – Tom J Nowell Feb 23 '15 at 23:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.