themexpert / onepager

Onepage Theme/Website Builder for WordPress
https://themesgrove.com/wp-onepager/
Other
304 stars 101 forks source link

Blocks for custom post types and taxonomies #108

Closed serranoabq closed 9 years ago

serranoabq commented 9 years ago

I'm trying to create custom blocks within my theme to support a custom post type and taxonomies created by another plugin, but when the config file is parsed the cpt is not available (It seems onepager runs before the cpt is registered). Im trying to allow the user to select only certain taxonomies from the cpt, if desired, from the configuration page. Basically, I would get the taxonomy list and pass it to the settings array. But as it stands, the cpt is not registered when config.php is run, so I can't get the taxonomies

Is there a hook or something I can use to delay the parsing of config until after the cpt is registered?

nadimtuhin commented 9 years ago

@serranoabq good point we are trying to solve this issue :) I will let you know as soon as possible

nadimtuhin commented 9 years ago

@serranoabq please https://github.com/themexpert/onepager/blob/ef640a55121281174cde3f4e18a191255886d71d/app/Loaders/BlocksLoader.php replace this file and let us know if it fixes your problem. We will be releasing 1.2.5 soon with this

serranoabq commented 9 years ago

The priority number was in the wrong position in the fix. After the correction as below it worked like a charm! Thanks!

add_action( 'init', [ $this, 'loadOnepagerBlocks' ], 99997 );
nadimtuhin commented 9 years ago

@serranoabq can you send us a pull request :D ?

nadimtuhin commented 9 years ago

and sorry I messed up :p