• Resolved ofmarconi

    (@ofmarconi)


    Hi!

    I think it’s an unlikely thing, but I wanted to know if it is possible to render a shortcode in the destination field.

    Why that?

    I want to make it easier for my client the redirects, I’m using Jengine Crocoblock, it’s as good as the ACF.

    I have forms in which my client can change any site information, one of them would be the destination of redirection.

    I need to render this:

    [jet_engine component=”option” page=”slider” field=”01-video-de-fundo”]

    It would be possible?

    Or any “METAFIELD”?`

    Example: https://postimg.cc/4YpWfHZ

Viewing 1 replies (of 1 total)
  • Plugin Author Rank Math SEO

    (@rankmath)

    Hello,

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    It’s not possible to render a Shortcode in the Destination field.

    However, you can use following code to redirect the post based on the Shortcode:

    add_filter( 'rank_math/redirection/pre_search', function( $value, $url, $full_url ) {
    	global $post;
    	$destination_url = do_shortcode( '[jet_engine component="option" page="slider" field="01-video-de-fundo"]' );
    	if ( ! $destination_url ) {
    		return $value;
    	}
    
    	return [
    		'url_to' => $destination_url,
    	];
    }, 10, 3 );

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘How to Render a Shortcode in the Destination Field’ is closed to new replies.