Hello!
That’s correct. We only store inputted information; we don’t save auto-generated information, TSF regenerates those every request.
To get the active description for the current query, use this:
$desc = function_exists( 'the_seo_framework' ) ? the_seo_framework()->get_description() : '';
If you want to get only the generated description for the current query, use this:
$desc = function_exists( 'the_seo_framework' ) ? the_seo_framework()->get_generated_description() : '';
For most of our meta-getter-methods, we use the input parameter $args
.
For example, to get the active description for an external page, please use this:
$args = [
'id' => 42,
'taxonomy' => '',
];
$desc = function_exists( 'the_seo_framework' ) ? the_seo_framework()->get_description( $args ) : '';
The same input works for almost all description, title, URL, and soon (v4.0) also the robots and image getters. The structured-data getters are the last cohere (ETA v4.1).
There’s no need for method_exists()
checks on the_seo_framework()
object. We implemented a plethora of failsafe so we can change the API with a peace of mind; the object will notify you when there’s an issue.
I hope this helps! Cheers 🙂
-
This reply was modified 5 years, 1 month ago by Sybre Waaijer. Reason: Additional information
Thanks for the great support (and product), Sybre! That is exactly what I needed.