質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

サーバ

サーバは、 クライアントサーバモデルにおいてクライアントからの要求に対し 何らかのサービスを提供するプログラムを指す言葉です。 また、サーバーソフトウェアを稼動させているコンピュータ機器そのもののことも、 サーバーと呼ぶ場合もあります。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

Q&A

1回答

2531閲覧

WordPress サーバのPHPバージョンを5から7にあげた際に出たエラー

ichigob

総合スコア27

WordPress

WordPressは、PHPで開発されているオープンソースのブログソフトウェアです。データベース管理システムにはMySQLを用いています。フリーのブログソフトウェアの中では最も人気が高く、PHPとHTMLを使って簡単にテンプレートをカスタマイズすることができます。

PHP

PHPは、Webサイト構築に特化して開発されたプログラミング言語です。大きな特徴のひとつは、HTMLに直接プログラムを埋め込むことができるという点です。PHPを用いることで、HTMLを動的コンテンツとして出力できます。HTMLがそのままブラウザに表示されるのに対し、PHPプログラムはサーバ側で実行された結果がブラウザに表示されるため、PHPスクリプトは「サーバサイドスクリプト」と呼ばれています。

サーバ

サーバは、 クライアントサーバモデルにおいてクライアントからの要求に対し 何らかのサービスを提供するプログラムを指す言葉です。 また、サーバーソフトウェアを稼動させているコンピュータ機器そのもののことも、 サーバーと呼ぶ場合もあります。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

0グッド

0クリップ

投稿2019/12/12 10:26

編集2022/01/12 10:55

WordPressでサーバの PHP のバージョンを5から7にあげた際に出たエラーがでました。

サーバーはXサーバーです。

エラーはこちらです。

Warning: Declaration of The_Bootstrap_Nav_Walker::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = Array) in /home/ichigo/example.com/public_html/wp-content/themes/the-bootstrap/inc/nav-menu-walker.php on line 0

Warning: Declaration of The_Bootstrap_Nav_Walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = Array, $id = 0) in /home/ichigo/example.com/public_html/wp-content/themes/the-bootstrap/inc/nav-menu-walker.php on line 0

サイト自体は見えています。

エラーが出ているnav-menu-walker.phpの中身を添付しています。

何を改善したらよろしいでしょうか。

<?php /** nav-menu-walker.php * * @author Konstantin Obenland * @package The Bootstrap * @since 1.5.0 - 15.05.2012 */ class The_Bootstrap_Nav_Walker extends Walker_Nav_Menu { /** * @see Walker_Nav_Menu::start_lvl() */ function start_lvl( &$output, $depth ) { $output .= "\n<ul class=\"dropdown-menu\">\n"; } /** * @see Walker_Nav_Menu::start_el() */ function start_el( &$output, $item, $depth, $args ) { global $wp_query; $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $li_attributes = $class_names = $value = ''; $classes = empty( $item->classes ) ? array() : (array) $item->classes; $classes[] = 'menu-item-' . $item->ID; if ( $args->has_children ) { $classes[] = ( 1 > $depth) ? 'dropdown': 'dropdown-submenu'; $li_attributes .= ' data-dropdown="dropdown"'; } $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) ); $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : ''; $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args ); $id = $id ? ' id="' . esc_attr( $id ) . '"' : ''; $output .= $indent . '<li' . $id . $value . $class_names . $li_attributes . '>'; $attributes = $item->attr_title ? ' title="' . esc_attr( $item->attr_title ) .'"' : ''; $attributes .= $item->target ? ' target="' . esc_attr( $item->target ) .'"' : ''; $attributes .= $item->xfn ? ' rel="' . esc_attr( $item->xfn ) .'"' : ''; $attributes .= $item->url ? ' href="' . esc_attr( $item->url ) .'"' : ''; $attributes .= $args->has_children ? ' class="dropdown-toggle" data-toggle="dropdown"' : ''; $item_output = $args->before . '<a' . $attributes . '>'; $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after; $item_output .= ( $args->has_children AND 1 > $depth ) ? ' <b class="caret"></b>' : ''; $item_output .= '</a>' . $args->after; $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args ); } /** * @see Walker::display_element() */ function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) { if ( ! $element ) return; $id_field = $this->db_fields['id']; //display this element if ( is_array( $args[0] ) ) $args[0]['has_children'] = (bool) ( ! empty( $children_elements[$element->$id_field] ) AND $depth != $max_depth - 1 ); elseif ( is_object( $args[0] ) ) $args[0]->has_children = (bool) ( ! empty( $children_elements[$element->$id_field] ) AND $depth != $max_depth - 1 ); $cb_args = array_merge( array( &$output, $element, $depth ), $args ); call_user_func_array( array( &$this, 'start_el' ), $cb_args ); $id = $element->$id_field; // descend only when the depth is right and there are childrens for this element if ( ( $max_depth == 0 OR $max_depth > $depth+1 ) AND isset( $children_elements[$id] ) ) { foreach ( $children_elements[ $id ] as $child ) { if ( ! isset( $newlevel ) ) { $newlevel = true; //start the child delimiter $cb_args = array_merge( array( &$output, $depth ), $args ); call_user_func_array( array( &$this, 'start_lvl' ), $cb_args ); } $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); } unset( $children_elements[ $id ] ); } if ( isset( $newlevel ) AND $newlevel ) { //end the child delimiter $cb_args = array_merge( array( &$output, $depth ), $args ); call_user_func_array( array( &$this, 'end_lvl' ), $cb_args ); } //end this element $cb_args = array_merge( array( &$output, $element, $depth ), $args ); call_user_func_array( array( &$this, 'end_el' ), $cb_args ); } } /** * Adds the active CSS class * * @author Konstantin Obenland * @since 1.5.0 - 15.05.2012 * * @param array $classes Default class names * * @return array */ function the_bootstrap_nav_menu_css_class( $classes ) { if ( in_array('current-menu-item', $classes ) OR in_array( 'current-menu-ancestor', $classes ) ) $classes[] = 'active'; return $classes; } add_filter( 'nav_menu_css_class', 'the_bootstrap_nav_menu_css_class' ); /* End of file nav-menu-walker.php */ /* Location: ./wp-content/themes/the-bootstrap/inc/nav-menu-walker.php */

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2019/12/13 08:59 編集

とりあえず本番は エラーディスプレイOFFにしようじぇ ~.com とか実際のアドレス入ってるが・・・WPだと宣言してるので脆弱性を狙われますよ
ichigob

2019/12/13 03:53

上記のURL 変更しましたので コメントのURLもhogeに変更いただけませんでしょうかー。
退会済みユーザー

退会済みユーザー

2019/12/13 03:55

実在の会社「Hoge Lumber Company」のドメインということをしってますか?
CHERRY

2019/12/13 03:58

ドメインの例示には、example.comexample.jp 等が、用意されているので、それをお使いください。
ichigob

2019/12/13 04:04

そうなんですね
ichigob

2019/12/13 04:06

example.com に変更しました! ありがとうございます。
ichigob

2019/12/13 04:07

asahina1979様のコメントのURLも念のため変更いただけませんでしょうかー。
guest

回答1

0

継承してオーバーライドしているが、親と定義が違うよってエラー 

引数の型、個数を合わせましょう

投稿2019/12/12 10:37

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

ichigob

2019/12/13 02:33

どの辺りを修正したらいいでしょうか?
退会済みユーザー

退会済みユーザー

2019/12/13 03:19

基本、この警告は表示されているものを修正しましょう
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問