Skip to content

Get default helper function not displaying default #37

@jamigibbs

Description

@jamigibbs

I'm having some trouble working out why the default helper function isn't returning my option defaults. Example usage:

$options['home-posts-section-title'] = array(
    'id'             => 'home-posts-section-title',
    'label'        => __( 'Section Title', 'themename' ),
    'section'     => $section,
    'type'          => 'textarea',
    'default'      => __( 'Latest News', 'themename' ),
    'transport'   => 'postMessage'
);

The setting is being called like this:

echo esc_attr( get_theme_mod( 'home-posts-section-title', customizer_library_get_default( 'home-posts-section-title' ) ) );

The default displays in the customizer screen but not on the live site.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions