Title: [Plugin: HTTPS for WordPress] helper function isHTTPS($post_id)
Last modified: August 19, 2016

---

# [Plugin: HTTPS for WordPress] helper function isHTTPS($post_id)

 *  [Stephane Boisvert](https://wordpress.org/support/users/sboisvert/)
 * (@sboisvert)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-https-for-wordpress-helper-function-ishttpspost_id/)
 * I use this helper function in my theme to change some widgets around if the page
   is HTTPS, perhaps it can be of use (or be put in the class)
 *     ```
       function isHTTPS($post_id){
       	if(is_null($post_id)){
       		global $post;
       		$post_id = $post->ID;
       	}
       	return get_post_meta($post_id, 'force_ssl',true);
         }
       ```
   
 * [http://wordpress.org/extend/plugins/https-for-wordpress/](http://wordpress.org/extend/plugins/https-for-wordpress/)

The topic ‘[Plugin: HTTPS for WordPress] helper function isHTTPS($post_id)’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/https-for-wordpress.svg)
 * [HTTPS for WordPress](https://wordpress.org/plugins/https-for-wordpress/)
 * [Support Threads](https://wordpress.org/support/plugin/https-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/https-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/https-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/https-for-wordpress/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Stephane Boisvert](https://wordpress.org/support/users/sboisvert/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-https-for-wordpress-helper-function-ishttpspost_id/)
 * Status: not resolved