Issue with TGMPA and ABSPATH

Hi friends, I got a new soft rejection on ThemeForest because TGMPA uses ABSPATH function and it’s not allowed on themes .

Any idea what can replace this function?

best regards

There are loads of functions to use including:

  • get theme directory url
  • get plugin url
  • get plugin path

it depends on what you want to include and from where

but just 4 functions are allowed

The reviewer message :

Theme needs to properly load files. There are several functions available for getting the path: 
- get_template_directory(): Returns the absolute template directory path 
- get_template_directory_uri(): Returns the template directory URI 
- get_stylesheet_directory(): Returns the absolute stylesheet directory path
- get_stylesheet_directory_uri(): Returns the stylesheet directory URI.

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

no, there are way more, depending on what you need to include e.g. plugin_path is to get a file in a plugin, and template / stylesheets are for theme based files.

but ABSPATH it’s dedicated for files outside of themes , and tgmpa uses this function .

it’s not the right function though, it’s a php function, WP uses it’s own versions of the functions, google will be your friend to find what you need

it’s not about googling , the problem is that reviewers give us 4 functions that can’t be used in this case …!!

they don’t say you have to use those functions, you can use any WP function, they are just giving you examples of functions you can use, there are many many functions so use Google and find the one that does as WP will have a function that does what you need.

i understand now ; thanks for your great feedback :slight_smile: