Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('rank_math/vars/register_extra_replacements', function () {
- rank_math_register_var_replacement(
- 'long_desc',
- [
- 'name' => esc_html__('Long description', 'rank-math'),
- 'description' => esc_html__('Product long description', 'rank-math'),
- 'variable' => 'long_desc',
- 'example' => long_desc_callback(),
- ],
- 'long_desc_callback'
- );
- });
- function long_desc_callback()
- {
- $desc = wp_strip_all_tags(get_the_content());
- return substr($desc,0, 160);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement