Skip to main content
grammar fix
Source Link
Pat J
  • 12.3k
  • 2
  • 28
  • 36

edit.php?post_type=weather isn't a valid PHP function name.

If you're trying to set the menu up as a submenu of your custom post screens? If so, I think edit.php?post_type=weather—the $parent_slug—should be the first parameter, not the last. ie,

add_submenu_page(
  'edit.php?post_type=weather',
  'Weather Information',
  'Weathers',
  'manage_options',
  'weathers',
  [$this, 'weathers']
);

References

edit.php?post_type=weather isn't a valid PHP function name.

If you're trying to set the menu up as a submenu of your custom post screens? If so, I think edit.php?post_type=weather—the $parent_slug—should be the first parameter, not the last. ie,

add_submenu_page(
  'edit.php?post_type=weather',
  'Weather Information',
  'Weathers',
  'manage_options',
  'weathers',
  [$this, 'weathers']
);

References

edit.php?post_type=weather isn't a valid PHP function name.

If you're trying to set the menu up as a submenu of your custom post screens, I think edit.php?post_type=weather—the $parent_slug—should be the first parameter, not the last. ie,

add_submenu_page(
  'edit.php?post_type=weather',
  'Weather Information',
  'Weathers',
  'manage_options',
  'weathers',
  [$this, 'weathers']
);

References

Source Link
Pat J
  • 12.3k
  • 2
  • 28
  • 36

edit.php?post_type=weather isn't a valid PHP function name.

If you're trying to set the menu up as a submenu of your custom post screens? If so, I think edit.php?post_type=weather—the $parent_slug—should be the first parameter, not the last. ie,

add_submenu_page(
  'edit.php?post_type=weather',
  'Weather Information',
  'Weathers',
  'manage_options',
  'weathers',
  [$this, 'weathers']
);

References