I got it. Let me summarize the process flow that you're trying to do:
- Getting settings
- Use the settings to register a CPT
- Register custom fields for the CPT
If you don't do the step 3, then you can do both steps 1+2 at priority 30. The CPT will be registered without any problem.
A better solution is getting the settings with get_option
, like this:
$option = get_option( 'multi_tema_privado' );
$mb_activacion_articulo = $option['modulo_articulos_activacion'] ?? '';
if ($mb_activacion_articulo == 1) $show_articulo = true;
$mb_slug_articulo = $option['modulo_articulos_slug'] ?? '';