// コンテンツ内のhttpリンクを自動でhttpsに置換する設定 function replace_http_to_https_output($buffer) { // 自分のサイトのドメイン(例: http://example.com)をhttpsに置換 $search_http = 'http://' . $_SERVER['HTTP_HOST']; $replace_https = 'https://' . $_SERVER['HTTP_HOST']; return str_replace($search_http, $replace_https, $buffer); } function start_http_to_https_buffer() { ob_start("replace_http_to_https_output"); } function end_http_to_https_buffer() { if (ob_get_length()) { ob_end_flush(); } } add_action('init', 'start_http_to_https_buffer'); add_action('shutdown', 'end_http_to_https_buffer');
Warning: Cannot modify header information - headers already sent by (output started at /export/sd212/www/jp/r/e/gmoserver/9/4/sd0785894/pain-pithecan.com/wordpress-4.2.2-ja-jetpack-undernavicontrol/wp-content/themes/pain/functions.php:118) in /export/sd212/www/jp/r/e/gmoserver/9/4/sd0785894/pain-pithecan.com/wordpress-4.2.2-ja-jetpack-undernavicontrol/wp-includes/pluggable.php on line 1208