sybrew / The-SEO-Framework-Extension-Manager

A WordPress plugin that manages extensions for The SEO Framework.
https://tsf.fyi/em
GNU General Public License v3.0
76 stars 9 forks source link

Support custom fields in meta title and description #79

Open touchdowntech opened 1 year ago

touchdowntech commented 1 year ago

I have a custom field for a client's lead time. I like to have the lead time in the meta description or title of some pages. I'm using Meta Box's settings page and custom field to save this info and I use it throughout the website. When I tried to use the shortcode in the title of TSF it didn't show the value of the field. It showed the shortcode text instead.

I think this would be a great feature to add because it's great to have centralized control for some pieces of information that we may want to use in the meta title or description of a page.

What do you think?

sybrew commented 12 months ago

Hello!

Sorry for the delay.

You can enable shortcodes in custom fields using these filters:

add_filter( 'the_seo_framework_custom_field_description', 'apply_shortcodes' );
add_filter( 'the_seo_framework_title_from_custom_field', 'apply_shortcodes' );

Here, you can learn where to place them: https://tsf.fyi/docs/filters#where.