WordPress Snippets at WPcustoms

Conditionally use SSL connections

This function can easily be modified to use conditional tags and force SSL on these pages. In this example SSL is limited to page id 12


/**
 * Snippet Name: Conditionally use SSL connections
 * Snippet URL: http://www.wpcustoms.net/snippets/conditionally-use-ssl-connections/
 */
 function wpc_use_ssl( $force_ssl, $post_id = 0, $url = '' ) {
    if ( $post_id == 12 ) {
        return true
    }
    return $force_ssl;
}
add_filter('force_ssl' , 'wpc_use_ssl', 10, 3);