inboundnow / retired-landing-pages

Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
http://www.inboundnow.com/landing-pages/
GNU General Public License v2.0
4 stars 2 forks source link

Standardize lp_get_parent_directory function #220

Closed DavidWells closed 9 years ago

DavidWells commented 9 years ago

We need to make this a generic function that lives in /shared/ so all templates can use the same function to grab this path.

This is for standardizing templating across all post types

Something like: inbound_get_parent_directory will work

atwellpub commented 9 years ago

This is available now. Also went ahead and converted landing pages templates to use the shared function. Legacy still exists.

atwellpub commented 9 years ago

Looks like b/c landing page's config files are loaded before init and plugins_loaded the config.php cannot use methods defined in shared. Shared is loaded in plugins_loaded hook. I reversed my commit the changed lp_get_parent_directory to inbound_get_parent_directory.

DavidWells commented 9 years ago

We are going to need some functionality loaded from /shared/ before the plugins_loaded hook.

Look like we might need to have a loader for stuff that needs to register quicker?

like:

trigger on init
private static function load_init_shared_files() {

}
trigger on plugins_loaded
private static function load_shared_files() {

}
atwellpub commented 9 years ago

Loading the template config data in init (init happens after plugins_loaded) has allowed us to convert lp_get_parent_directory to inbound_get_parent_directory().