Skip to content

Admin Styles and Scripts not loading due to wrong path #432

@bitstarr

Description

@bitstarr

As said in title, CSS and JS get the wrong path (absolute file system path) on registration.

<link rel='stylesheet' id='cmb2-styles-css'  href='http://developer.dev/home/dev/web/wordpress/wp-content/plugins/cmb2/css/cmb2.min.css?ver=4.2.4' type='text/css' media='all' />

The problem is, that the url function in CMB2_Utils class utilizes cmb2_dir() and so the CMB2_DIR constant which is constructed for for includes.

I replaced the line

$this->url = trailingslashit( apply_filters( 'cmb2_meta_box_url', set_url_scheme( $cmb2_url ), CMB2_VERSION ) );

with

$this->url = plugins_url( '', __FILE__ ) . '/../';

as a workaround.

Please find a better solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions