WordPress.org

Ready to get started?Download WordPress

Forums

Add a link into a filter (1 post)

  1. brook1979
    Member
    Posted 2 years ago #

    Hi People,

    Fairly new at adding functions/filters etc...and add the bewlo code to change some custom text...and it worked great.....but how would i add a link to the custom text..??...when i try adding a url "http" its breaking the code.....could someone please point me in the right direction.??

    Cheers in advance if anyone can help

    add_filter( 'the_password_form', 'custom_password_form' );
    function custom_password_form() {
    	global $post;
    	$label = 'pwbox-'.( empty( $post->ID ) ? rand() : $post->ID );
    	$o = '<form class="protected-post-form" action="' . get_option('siteurl') . '/wp-pass.php" method="post">
    	' . __( "This page is password protected. To view it please enter your password below: If you do not have a password then please contact us to request one.") . '
    	<label for="' . $label . '">' . __( "Password:" ) . ' </label><input name="post_password" id="' . $label . '" type="password" size="20" /><input type="submit" name="Submit" value="' . esc_attr__( "Submit" ) . '" />
    	</form>
    	';
    	return $o;
    }

Topic Closed

This topic has been closed to new replies.

About this Topic