Soft Reject : "properly load files" problem

Hello !

My theme has been soft reject, I am solving issues but one seems unsolvable for me.

Reviewer sent this :

Theme needs to properly load files, but also to be consistent as well.

There are several functions available for getting the path:

  • get_template_directory - Filter the current theme directory path.
  • get_template_directory_uri - Filter the current theme directory URI.
  • get_stylesheet_directory - Filter the stylesheet directory path for current theme.
  • get_stylesheet_directory_uri - Filter the stylesheet directory URI.

http://justintadlock.com/archives/2010/11/17/how-to-load-files-within-wordpress-themes

http://envato.d.pr/7qkM/5zy3k5u7

As you can see on the screenshot, I need the file “wp-admin/includes/nav-menu.php” with absolute path in order to customize the back-office menu options page.
But the only solution the reviewer gave me are functions like get_template_directory() etc… I really don’t see how I’m supposed to do with these functions. I use all these functions for every files into my theme but not in this case, it’s not possible. Even admin_url() is not useful, as I said I need the absolute path.

So if someone has an idea, he is welcome !
Thanks.

Finally I found a solution. Instead of “require_once( ABSPATH . ‘wp-admin/includes/nav-menu.php’ );” I replace with “require_once( get_stylesheet_directory() . ‘/…/…/…/wp-admin/includes/nav-menu.php’ );”… it’s ugly, but I don’t know what else to do if reviewer doesn’t accept ABSPATH.

1 Like

Hi,

If I am not wrong, you want modify the backend of the default wordpress navigation menu, if this is what you are looking for, I suggest you to use a custom walker class, because what you are doing now (absolute path) is not a good idea

good luck

same issue for me , ABSPATH is the only thing to remove ?