In developing a plugin, a variable $staging_site
is assigned a value, e.g., $staging_site = 'some_value'
in the plugin's php file. Later in the same file a function is defined as
function stl_page($stagingSite) {
$url = get_site_url();
$allowed = strpos($url, $stagingSite) > 0;
...
}
Further context:
add_action('admin_menu', 'stl_action_page');
function stl_action_page($stagingSite) {
add_submenu_page(
'tools.php', 'STL Update', 'STL Update', 'manage_options', 'update_live', ['stl_page', 'stagingSite' => $stagingSite]);
add_action('admin_footer', 'stl_script');
}
Yet the following appears when the plugin is accessed in admin:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, second array member is not a valid method