• Resolved uqamsav

    (@uqamsav)


    We run a multisite, and find the import/export feature useful albeit tedious.

    It would be useful to modify the default settings from a filter in our theme.

    Does this exist. is it documented (didn’t find anything)

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter uqamsav

    (@uqamsav)

    Ok, figured it out.
    Along with define( 'WP_DEFAULT_THEME', 'inhouse-theme' );

    add_filter( 'wpseo_defaults', function( $defaults, $option_name ) {
        if( 'wpseo_titles' === $option_name ){
            $defaults['company_or_person'] = 'company';
            $defaults['company_name'] = get_bloginfo('name');
            $defaults['company_logo'] = get_stylesheet_directory_uri() . '/assets/images/logo.svg';
            $defaults['separator'] = 'sc-pipe';
            $defaults['breadcrumbs-enable'] = '1';
            $defaults['stripcategorybase'] = true;
        }
        return $defaults;
    }, 20, 2);
    Thread Starter uqamsav

    (@uqamsav)

    So the above code left the logo url empty in the json-ld output.

    add_filter( 'wpseo_schema_organization', function ( $data ) {
        if ( empty( $data['logo']['url']) ) {
            $data['logo']['url'] = get_stylesheet_directory_uri() . '/assets/images/logo.jpg';
        }
        return $data;
    }, 20 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Default settings filter’ is closed to new replies.