function error line 110 – breaks site — PLEASE HELP
-
Warning: call_user_func_array() expects parameter 1 to be a valid callback, no array or string given in …
/wp-content/plugins/if-menu/if-menu.php on line 110
Sincere thanks for help. I’m working locally or I’d put a link to the site. I can post a screenshot of the error if that will help.
-
I have exactly the same issue – Latest WordPress version – PHP 7.3
I fixed it by doing the following – Replace line 110
$cond = $conditions[$if_conditions[$index]]['condition']; if($cond): $singleCondition .= call_user_func_array($cond, $params) ? $bit1 : $bit2; endif;
One of the conditions was returning NULL, so this was breaking the call_user_func_array()
You’re welcome ??
I have a long menu list.
I added a new page. which auto-added the page to the end of the menu.
I then moved it to a third-level entry
and got this error,
Using the above test, I added some debugging, here is the result
Hope this helpsRoy
———————————————————————Notice: Undefined index: in /home/pillowan/www-shaw-weil-edit/wp-content/plugins/if-menu/if-menu.php on line 109 index = 0 if_conditions = Array ( [0] => ) conditions = Array ( [user-is-administrator] => Array ( [id] => user-is-administrator [name] => Is Administrator [alias] => User is Administrator [condition] => Closure Object ( [static] => Array ( [roleId] => administrator ) ) [group] => User ) [Is Administrator] => Array ( [id] => user-is-administrator [name] => Is Administrator [alias] => User is Administrator [condition] => Closure Object ( [static] => Array ( [roleId] => administrator ) ) [group] => User ) [User is Administrator] => Array ( [id] => user-is-administrator [name] => Is Administrator [alias] => User is Administrator [condition] => Closure Object ( [static] => Array ( [roleId] => administrator ) ) [group] => User ) [user-is-editor] => Array ( [id] => user-is-editor [name] => Is Editor [alias] => User is Editor [condition] => Closure Object ( [static] => Array ( [roleId] => editor ) ) [group] => User ) [Is Editor] => Array ( [id] => user-is-editor [name] => Is Editor [alias] => User is Editor [condition] => Closure Object ( [static] => Array ( [roleId] => editor ) ) [group] => User ) [User is Editor] => Array ( [id] => user-is-editor [name] => Is Editor [alias] => User is Editor [condition] => Closure Object ( [static] => Array ( [roleId] => editor ) ) [group] => User ) [user-is-author] => Array ( [id] => user-is-author [name] => Is Author [alias] => User is Author [condition] => Closure Object ( [static] => Array ( [roleId] => author ) ) [group] => User ) [Is Author] => Array ( [id] => user-is-author [name] => Is Author [alias] => User is Author [condition] => Closure Object ( [static] => Array ( [roleId] => author ) ) [group] => User ) [User is Author] => Array ( [id] => user-is-author [name] => Is Author [alias] => User is Author [condition] => Closure Object ( [static] => Array ( [roleId] => author ) ) [group] => User ) [user-is-contributor] => Array ( [id] => user-is-contributor [name] => Is Contributor [alias] => User is Contributor [condition] => Closure Object ( [static] => Array ( [roleId] => contributor ) ) [group] => User ) [Is Contributor] => Array ( [id] => user-is-contributor [name] => Is Contributor [alias] => User is Contributor [condition] => Closure Object ( [static] => Array ( [roleId] => contributor ) ) [group] => User ) [User is Contributor] => Array ( [id] => user-is-contributor [name] => Is Contributor [alias] => User is Contributor [condition] => Closure Object ( [static] => Array ( [roleId] => contributor ) ) [group] => User ) [user-is-subscriber] => Array ( [id] => user-is-subscriber [name] => Is Subscriber [alias] => User is Subscriber [condition] => Closure Object ( [static] => Array ( [roleId] => subscriber ) ) [group] => User ) [Is Subscriber] => Array ( [id] => user-is-subscriber [name] => Is Subscriber [alias] => User is Subscriber [condition] => Closure Object ( [static] => Array ( [roleId] => subscriber ) ) [group] => User ) [User is Subscriber] => Array ( [id] => user-is-subscriber [name] => Is Subscriber [alias] => User is Subscriber [condition] => Closure Object ( [static] => Array ( [roleId] => subscriber ) ) [group] => User ) [user-logged-in] => Array ( [id] => user-logged-in [name] => Is logged in [alias] => User is logged in [condition] => is_user_logged_in [group] => User ) [Is logged in] => Array ( [id] => user-logged-in [name] => Is logged in [alias] => User is logged in [condition] => is_user_logged_in [group] => User ) [User is logged in] => Array ( [id] => user-logged-in [name] => Is logged in [alias] => User is logged in [condition] => is_user_logged_in [group] => User ) [users-can-register] => Array ( [id] => users-can-register [name] => User registration is allowed [condition] => Closure Object ( ) [group] => User ) [User registration is allowed] => Array ( [id] => users-can-register [name] => User registration is allowed [condition] => Closure Object ( ) [group] => User ) [front-page] => Array ( [id] => front-page [name] => Front Page [condition] => is_front_page [group] => Page type ) [Front Page] => Array ( [id] => front-page [name] => Front Page [condition] => is_front_page [group] => Page type ) [single-post] => Array ( [id] => single-post [name] => Single Post [condition] => is_single [group] => Page type ) [Single Post] => Array ( [id] => single-post [name] => Single Post [condition] => is_single [group] => Page type ) [is-page] => Array ( [id] => is-page [name] => Page [condition] => is_page [group] => Page type ) [Page] => Array ( [id] => is-page [name] => Page [condition] => is_page [group] => Page type ) [page-archive] => Array ( [id] => page-archive [name] => Is Archive page [condition] => is_archive [group] => Page type ) [Is Archive page] => Array ( [id] => page-archive [name] => Is Archive page [condition] => is_archive [group] => Page type ) [is-mobile] => Array ( [id] => is-mobile [name] => Mobile [condition] => wp_is_mobile [group] => Device ) [Mobile] => Array ( [id] => is-mobile [name] => Mobile [condition] => wp_is_mobile [group] => Device ) [language-is-rtl] => Array ( [id] => language-is-rtl [name] => Is RTL [condition] => is_rtl [group] => Language ) [Is RTL] => Array ( [id] => language-is-rtl [name] => Is RTL [condition] => is_rtl [group] => Language ) [user-location] => Array ( [id] => user-location [type] => multiple [name] => From country [options] => Array ( [AF] => Afghanistan [AX] => ?land Islands [AL] => Albania [DZ] => Algeria [AS] => American Samoa [AD] => Andorra [AO] => Angola [AI] => Anguilla [AQ] => Antarctica [AG] => Antigua and Barbuda [AR] => Argentina [AM] => Armenia [AW] => Aruba [AU] => Australia [AT] => Austria [AZ] => Azerbaijan [BS] => Bahamas [BH] => Bahrain [BD] => Bangladesh [BB] => Barbados [BY] => Belarus [BE] => Belgium [PW] => Belau [BZ] => Belize [BJ] => Benin [BM] => Bermuda [BT] => Bhutan [BO] => Bolivia [BQ] => Bonaire, Saint Eustatius and Saba [BA] => Bosnia and Herzegovina [BW] => Botswana [BV] => Bouvet Island [BR] => Brazil [IO] => British Indian Ocean Territory [VG] => British Virgin Islands [BN] => Brunei [BG] => Bulgaria [BF] => Burkina Faso [BI] => Burundi [KH] => Cambodia [CM] => Cameroon [CA] => Canada [CV] => Cape Verde [KY] => Cayman Islands [CF] => Central African Republic [TD] => Chad [CL] => Chile [CN] => China [CX] => Christmas Island [CC] => Cocos (Keeling) Islands [CO] => Colombia [KM] => Comoros [CG] => Congo (Brazzaville) [CD] => Congo (Kinshasa) [CK] => Cook Islands [CR] => Costa Rica [HR] => Croatia [CU] => Cuba [CW] => Cura?ao [CY] => Cyprus [CZ] => Czech Republic [DK] => Denmark [DJ] => Djibouti [DM] => Dominica [DO] => Dominican Republic [EC] => Ecuador [EG] => Egypt [SV] => El Salvador [GQ] => Equatorial Guinea [ER] => Eritrea [EE] => Estonia [ET] => Ethiopia [FK] => Falkland Islands [FO] => Faroe Islands [FJ] => Fiji [FI] => Finland [FR] => France [GF] => French Guiana [PF] => French Polynesia [TF] => French Southern Territories [GA] => Gabon [GM] => Gambia [GE] => Georgia [DE] => Germany [GH] => Ghana [GI] => Gibraltar [GR] => Greece [GL] => Greenland [GD] => Grenada [GP] => Guadeloupe [GU] => Guam [GT] => Guatemala [GG] => Guernsey [GN] => Guinea [GW] => Guinea-Bissau [GY] => Guyana [HT] => Haiti [HM] => Heard Island and McDonald Islands [HN] => Honduras [HK] => Hong Kong [HU] => Hungary [IS] => Iceland [IN] => India [ID] => Indonesia [IR] => Iran [IQ] => Iraq [IE] => Ireland [IM] => Isle of Man [IL] => Israel [IT] => Italy [CI] => Ivory Coast [JM] => Jamaica [JP] => Japan [JE] => Jersey [JO] => Jordan [KZ] => Kazakhstan [KE] => Kenya [KI] => Kiribati [KW] => Kuwait [KG] => Kyrgyzstan [LA] => Laos [LV] => Latvia [LB] => Lebanon [LS] => Lesotho [LR] => Liberia [LY] => Libya [LI] => Liechtenstein [LT] => Lithuania [LU] => Luxembourg [MO] => Macao S.A.R., China [MK] => Macedonia [MG] => Madagascar [MW] => Malawi [MY] => Malaysia [MV] => Maldives [ML] => Mali [MT] => Malta [MH] => Marshall Islands [MQ] => Martinique [MR] => Mauritania [MU] => Mauritius [YT] => Mayotte [MX] => Mexico [FM] => Micronesia [MD] => Moldova [MC] => Monaco [MN] => Mongolia [ME] => Montenegro [MS] => Montserrat [MA] => Morocco [MZ] => Mozambique [MM] => Myanmar [NA] => Namibia [NR] => Nauru [NP] => Nepal [NL] => Netherlands [NC] => New Caledonia [NZ] => New Zealand [NI] => Nicaragua [NE] => Niger [NG] => Nigeria [NU] => Niue [NF] => Norfolk Island [MP] => Northern Mariana Islands [KP] => North Korea [NO] => Norway [OM] => Oman [PK] => Pakistan [PS] => Palestinian Territory [PA] => Panama [PG] => Papua New Guinea [PY] => Paraguay [PE] => Peru [PH] => Philippines [PN] => Pitcairn [PL] => Poland [PT] => Portugal [PR] => Puerto Rico [QA] => Qatar [RE] => Reunion [RO] => Romania [RU] => Russia [RW] => Rwanda [BL] => Saint Barthélemy [SH] => Saint Helena [KN] => Saint Kitts and Nevis [LC] => Saint Lucia [MF] => Saint Martin (French part) [SX] => Saint Martin (Dutch part) [PM] => Saint Pierre and Miquelon [VC] => Saint Vincent and the Grenadines [SM] => San Marino [ST] => S?o Tomé and Príncipe [SA] => Saudi Arabia [SN] => Senegal [RS] => Serbia [SC] => Seychelles [SL] => Sierra Leone [SG] => Singapore [SK] => Slovakia [SI] => Slovenia [SB] => Solomon Islands [SO] => Somalia [ZA] => South Africa [GS] => South Georgia/Sandwich Islands [KR] => South Korea [SS] => South Sudan [ES] => Spain [LK] => Sri Lanka [SD] => Sudan [SR] => Suriname [SJ] => Svalbard and Jan Mayen [SZ] => Swaziland [SE] => Sweden [CH] => Switzerland [SY] => Syria [TW] => Taiwan [TJ] => Tajikistan [TZ] => Tanzania [TH] => Thailand [TL] => Timor-Leste [TG] => Togo [TK] => Tokelau [TO] => Tonga [TT] => Trinidad and Tobago [TN] => Tunisia [TR] => Turkey [TM] => Turkmenistan [TC] => Turks and Caicos Islands [TV] => Tuvalu [UG] => Uganda [UA] => Ukraine [AE] => United Arab Emirates [GB] => United Kingdom (UK) [US] => United States (US) [UM] => United States (US) Minor Outlying Islands [VI] => United States (US) Virgin Islands [UY] => Uruguay [UZ] => Uzbekistan [VU] => Vanuatu [VA] => Vatican [VE] => Venezuela [VN] => Vietnam [WF] => Wallis and Futuna [EH] => Western Sahara [WS] => Samoa [YE] => Yemen [ZM] => Zambia [ZW] => Zimbabwe ) [condition] => Closure Object ( [parameter] => Array ( [$item] => [$selectedOptions] => ) ) [group] => User ) [From country] => Array ( [id] => user-location [type] => multiple [name] => From country [options] => Array ( [AF] => Afghanistan [AX] => ?land Islands [AL] => Albania [DZ] => Algeria [AS] => American Samoa [AD] => Andorra [AO] => Angola [AI] => Anguilla [AQ] => Antarctica [AG] => Antigua and Barbuda [AR] => Argentina [AM] => Armenia [AW] => Aruba [AU] => Australia [AT] => Austria [AZ] => Azerbaijan [BS] => Bahamas [BH] => Bahrain [BD] => Bangladesh [BB] => Barbados [BY] => Belarus [BE] => Belgium [PW] => Belau [BZ] => Belize [BJ] => Benin [BM] => Bermuda [BT] => Bhutan [BO] => Bolivia [BQ] => Bonaire, Saint Eustatius and Saba [BA] => Bosnia and Herzegovina [BW] => Botswana [BV] => Bouvet Island [BR] => Brazil [IO] => British Indian Ocean Territory [VG] => British Virgin Islands [BN] => Brunei [BG] => Bulgaria [BF] => Burkina Faso [BI] => Burundi [KH] => Cambodia [CM] => Cameroon [CA] => Canada [CV] => Cape Verde [KY] => Cayman Islands [CF] => Central African Republic [TD] => Chad [CL] => Chile [CN] => China [CX] => Christmas Island [CC] => Cocos (Keeling) Islands [CO] => Colombia [KM] => Comoros [CG] => Congo (Brazzaville) [CD] => Congo (Kinshasa) [CK] => Cook Islands [CR] => Costa Rica [HR] => Croatia [CU] => Cuba [CW] => Cura?ao [CY] => Cyprus [CZ] => Czech Republic [DK] => Denmark [DJ] => Djibouti [DM] => Dominica [DO] => Dominican Republic [EC] => Ecuador [EG] => Egypt [SV] => El Salvador [GQ] => Equatorial Guinea [ER] => Eritrea [EE] => Estonia [ET] => Ethiopia [FK] => Falkland Islands [FO] => Faroe Islands [FJ] => Fiji [FI] => Finland [FR] => France [GF] => French Guiana [PF] => French Polynesia [TF] => French Southern Territories [GA] => Gabon [GM] => Gambia [GE] => Georgia [DE] => Germany [GH] => Ghana [GI] => Gibraltar [GR] => Greece [GL] => Greenland [GD] => Grenada [GP] => Guadeloupe [GU] => Guam [GT] => Guatemala [GG] => Guernsey [GN] => Guinea [GW] => Guinea-Bissau [GY] => Guyana [HT] => Haiti [HM] => Heard Island and McDonald Islands [HN] => Honduras [HK] => Hong Kong [HU] => Hungary [IS] => Iceland [IN] => India [ID] => Indonesia [IR] => Iran [IQ] => Iraq [IE] => Ireland [IM] => Isle of Man [IL] => Israel [IT] => Italy [CI] => Ivory Coast [JM] => Jamaica [JP] => Japan [JE] => Jersey [JO] => Jordan [KZ] => Kazakhstan [KE] => Kenya [KI] => Kiribati [KW] => Kuwait [KG] => Kyrgyzstan [LA] => Laos [LV] => Latvia [LB] => Lebanon [LS] => Lesotho [LR] => Liberia [LY] => Libya [LI] => Liechtenstein [LT] => Lithuania [LU] => Luxembourg [MO] => Macao S.A.R., China [MK] => Macedonia [MG] => Madagascar [MW] => Malawi [MY] => Malaysia [MV] => Maldives [ML] => Mali [MT] => Malta [MH] => Marshall Islands [MQ] => Martinique [MR] => Mauritania [MU] => Mauritius [YT] => Mayotte [MX] => Mexico [FM] => Micronesia [MD] => Moldova [MC] => Monaco [MN] => Mongolia [ME] => Montenegro [MS] => Montserrat [MA] => Morocco [MZ] => Mozambique [MM] => Myanmar [NA] => Namibia [NR] => Nauru [NP] => Nepal [NL] => Netherlands [NC] => New Caledonia [NZ] => New Zealand [NI] => Nicaragua [NE] => Niger [NG] => Nigeria [NU] => Niue [NF] => Norfolk Island [MP] => Northern Mariana Islands [KP] => North Korea [NO] => Norway [OM] => Oman [PK] => Pakistan [PS] => Palestinian Territory [PA] => Panama [PG] => Papua New Guinea [PY] => Paraguay [PE] => Peru [PH] => Philippines [PN] => Pitcairn [PL] => Poland [PT] => Portugal [PR] => Puerto Rico [QA] => Qatar [RE] => Reunion [RO] => Romania [RU] => Russia [RW] => Rwanda [BL] => Saint Barthélemy [SH] => Saint Helena [KN] => Saint Kitts and Nevis [LC] => Saint Lucia [MF] => Saint Martin (French part) [SX] => Saint Martin (Dutch part) [PM] => Saint Pierre and Miquelon [VC] => Saint Vincent and the Grenadines [SM] => San Marino [ST] => S?o Tomé and Príncipe [SA] => Saudi Arabia [SN] => Senegal [RS] => Serbia [SC] => Seychelles [SL] => Sierra Leone [SG] => Singapore [SK] => Slovakia [SI] => Slovenia [SB] => Solomon Islands [SO] => Somalia [ZA] => South Africa [GS] => South Georgia/Sandwich Islands [KR] => South Korea [SS] => South Sudan [ES] => Spain [LK] => Sri Lanka [SD] => Sudan [SR] => Suriname [SJ] => Svalbard and Jan Mayen [SZ] => Swaziland [SE] => Sweden [CH] => Switzerland [SY] => Syria [TW] => Taiwan [TJ] => Tajikistan [TZ] => Tanzania [TH] => Thailand [TL] => Timor-Leste [TG] => Togo [TK] => Tokelau [TO] => Tonga [TT] => Trinidad and Tobago [TN] => Tunisia [TR] => Turkey [TM] => Turkmenistan [TC] => Turks and Caicos Islands [TV] => Tuvalu [UG] => Uganda [UA] => Ukraine [AE] => United Arab Emirates [GB] => United Kingdom (UK) [US] => United States (US) [UM] => United States (US) Minor Outlying Islands [VI] => United States (US) Virgin Islands [UY] => Uruguay [UZ] => Uzbekistan [VU] => Vanuatu [VA] => Vatican [VE] => Venezuela [VN] => Vietnam [WF] => Wallis and Futuna [EH] => Western Sahara [WS] => Samoa [YE] => Yemen [ZM] => Zambia [ZW] => Zimbabwe ) [condition] => Closure Object ( [parameter] => Array ( [$item] => [$selectedOptions] => ) ) [group] => User ) [languages] => Array ( [id] => languages [type] => multiple [name] => Language [options] => Array ( [en_US] => English (US) ) [condition] => Closure Object ( [parameter] => Array ( [$item] => [$selectedLanguages] => ) ) [group] => Language ) [Language] => Array ( [id] => languages [type] => multiple [name] => Language [options] => Array ( [en_US] => English (US) ) [condition] => Closure Object ( [parameter] => Array ( [$item] => [$selectedLanguages] => ) ) [group] => Language ) )
.
- The topic ‘function error line 110 – breaks site — PLEASE HELP’ is closed to new replies.