Skip to content

Instantly share code, notes, and snippets.

@tnchuntic
Last active May 10, 2023 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tnchuntic/4ca028ca69b8a5b2916065dcaaf87eef to your computer and use it in GitHub Desktop.
Save tnchuntic/4ca028ca69b8a5b2916065dcaaf87eef to your computer and use it in GitHub Desktop.
Fixed id-awesome-header null selector. Wrap call of class in ACF/Init and move set selector after init method.
add_action('acf/init', 'ini_acf_func');
function ini_acf_func(){
if ( function_exists( 'get_field' ) ) :
$ID_Awesome_Header = new ID_Awesome_Header();
$ID_Awesome_Header -> id_add_options_sub_page( 'id-awesome-header-module' );
$ID_Awesome_Header -> add_theme_support( array( 'post', 'page', 'product' ) );
$ID_Awesome_Header -> init();
// move set selector after init to fixed null value of settings id.
// 10/05/2023
$ID_Awesome_Header -> set_selector( get_field( 'selector', $ID_Awesome_Header -> settings_id ) );
endif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment