Skip Navigation

[Resolved] add_filter('get_layout_id_for_render' – Missing argument 2 for {closure}()

This support ticket is created 7 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Noman 7 years, 3 months ago.

Assisted by: Noman.

Author
Posts
#527770

I am trying to:
View the page

I visited this URL:
hidden link

I expected to see:
Normal page
Instead, I got:
The following warning on the top of the page:
Warning: Missing argument 2 for {closure}(), called in /www/trooptravel_653/public/wp-includes/class-wp-hook.php on line 300 and defined in /www/trooptravel_653/public/wp-content/themes/TroopTravel/functions.php on line 163

I have the following code starting on line 163 of functions.php:
add_filter('get_layout_id_for_render', function($layout_id, $slug){

global $post;

if( null !== $post && $post->post_type === 'trip' && isset($_GET['cred-edit-form']) ){
$layout_id = '9540';
}
return $layout_id;
} );

#527871

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Leonard,

Thank you for contacting Toolset Support. I have been checking the issue then suddenly the error goes away from the page. Looks like you may have resolved it already, please advise further.
hidden link

Have a great day,
Thank you

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.