Getting the permalink from a variable. (1 post)

  1. chibib0
    Posted 4 years ago #


    I want to get the permalink from a given variable.

    I have an option using the settings api in which users can input the slug of a page.

    What i wanted is to output the permalink of the slug inputted by users.

    I have this,

    function mytheme_option( $option ) {
    	$options = get_option( 'mytheme_options' );
    	if ( isset( $options[$option] ) )
    		return $options[$option];
    		return false;
    $termspage = mytheme_option('terms_slug');
    echo get_permalink($termspage);

    However, it doesn't output the permalink even the page of the inputted slug exists.

    Please help

Topic Closed

This topic has been closed to new replies.

About this Topic