操作
サポート #132
完了
廣僚
廣僚
サポート #5: AWSサーバー移管に伴う動作確認
入試課受験生サイト
サポート #132:
入試課受験生サイト
開始日:
2023/12/23
期日:
2023/12/23
進捗率:
100%
予定工数:
対象ページURL:
ファイル
アデ アルドリノ デフリン さんが2年以上前に更新 操作 #3
- ステータス を 新規 から 進行中 に変更
- 担当者 を 廣瀬 僚一 から アルドリノ デフリン に変更
- 進捗率 を 0 から 30 に変更
アデ アルドリノ デフリン さんが2年以上前に更新 操作 #4
エラー内容¶
TOP ページ
Warning: Undefined variable $blank in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/index.php on line 97
原因¶
変数の初期化がなかったため
$lastposts = get_posts('numberposts=5&orderby=date&category=1');
foreach ($lastposts as $post) :
setup_postdata($post);
if (in_category('outlink', $post)) {
$blank = ' target="_blank"'; // ← この変数の初期化がなかった
}
⋮
endforeach;
解決策¶
初期化を追加
$lastposts = get_posts('numberposts=5&orderby=date&category=1');
foreach ($lastposts as $post) :
setup_postdata($post);
$blank = in_category('outlink', $post) ? ' target="_blank"' : '';
⋮
endforeach;
アデ アルドリノ デフリン さんが2年以上前に更新 操作 #5
エラー内容¶
TOP ページ
FeedWordPress で取得した記事のパーマリンク
<b>Deprecated</b>: trim(): Passing null to parameter #1 ($string) of type string is deprecated in <b>/home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/plugins/feedwordpress/feedwordpress.php</b> on line <b>2022</b>
原因¶
PHP 関数の仕様変更でプラグインの更新がされていないため
解決策¶
プラグインの更新まで無視
WP_DEBUG を false にすればエラーが非表示される
アデ アルドリノ デフリン さんが2年以上前に更新 操作 #6
エラー内容¶
リキャップチャが全ページで表示される
原因¶
元々あった関数の優先度が設定されなかったので、
リキャップチャが表示される前に関数が実行されてしまう。
add_action('wp_enqueue_scripts', function () {
if (is_page('inquiry')) return;
wp_deregister_script('google-recaptcha');
});
解決策¶
優先度を設定する
add_action('wp_enqueue_scripts', function () {
if (is_page('inquiry')) return;
wp_deregister_script('google-recaptcha');
}, 100, 0);
アデ アルドリノ デフリン さんが2年以上前に更新 操作 #7
エラー内容¶
学内見学ページ
関連記事
Warning: Undefined array key 1 in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/page_topiclist_cat.php on line 6
Warning: Undefined array key 2 in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/page_topiclist_cat.php on line 6
Warning: Undefined array key 0 in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/page_topiclist_cat.php on line 9
Warning: Undefined variable $str in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/func_shortcode.php on line 16
原因 ①¶
Warning: Undefined variable $str in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/func_shortcode.php on line 16
変数の初期化がなかったため
add_shortcode('topics_cat', 'sc_topics_cat');
function sc_topics_cat($args)
{
ob_start();
set_query_var('args', $args);
$str .= '' . get_template_part('inc/page_topiclist_cat') . '';
echo $str;
return ob_get_clean();
}
解決策 ①¶
初期化を設定する
add_shortcode('topics_cat', 'sc_topics_cat');
function sc_topics_cat($args)
{
ob_start();
set_query_var('args', $args);
$str = get_template_part('inc/page_topiclist_cat') . '';
echo $str;
return ob_get_clean();
}
原因 ②¶
Warning: Undefined array key 1 in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/page_topiclist_cat.php on line 6
Warning: Undefined array key 2 in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/page_topiclist_cat.php on line 6
Warning: Undefined array key 0 in /home/clddev/ooda.biz/public_html/rgu-nyushi/wp-content/themes/tokiwa/inc/page_topiclist_cat.php on line 9
ショートコードに空の値を引数として渡しているため
<p>[topics_cat 'event' '' '' ]</p>
<h2><?php echo $args[1]; ?><small><?php echo $args[2]; ?></small></h2>
解決策 ②¶
引数の値が設定されたかどうかの判定を追加
<h2><?= isset($args[1]) ? $args[1] : ''; ?><small><?= isset($args[2]) ? $args[2] : ''; ?></small></h2>
アデ アルドリノ デフリン さんが2年以上前に更新 操作 #8
アデ アルドリノ デフリン さんが2年以上前に更新 操作 #9
- ステータス を 進行中 から フィードバック に変更
- 担当者 を アルドリノ デフリン から 廣瀬 僚一 に変更
操作
