{"action":"created","issue":{"url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/432","repository_url":"https://api.github.com/repos/WebDevStudios/CMB2","labels_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/432/labels{/name}","comments_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/432/comments","events_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/432/events","html_url":"https://github.com/WebDevStudios/CMB2/issues/432","id":101666603,"number":432,"title":"Admin Styles and Scripts not loading due to wrong path","user":{"login":"bitstarr","id":3891444,"avatar_url":"https://avatars.githubusercontent.com/u/3891444?v=3","gravatar_id":"","url":"https://api.github.com/users/bitstarr","html_url":"https://github.com/bitstarr","followers_url":"https://api.github.com/users/bitstarr/followers","following_url":"https://api.github.com/users/bitstarr/following{/other_user}","gists_url":"https://api.github.com/users/bitstarr/gists{/gist_id}","starred_url":"https://api.github.com/users/bitstarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitstarr/subscriptions","organizations_url":"https://api.github.com/users/bitstarr/orgs","repos_url":"https://api.github.com/users/bitstarr/repos","events_url":"https://api.github.com/users/bitstarr/events{/privacy}","received_events_url":"https://api.github.com/users/bitstarr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":15,"created_at":"2015-08-18T14:16:17Z","updated_at":"2016-10-04T11:03:36Z","closed_at":"2015-08-18T16:46:12Z","body":"As said in title, CSS and JS get the wrong path (absolute file system path) on registration.\r\n```\r\n<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' />\r\n```\r\n\r\nThe 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.\r\n\r\nI replaced the line\r\n```\r\n$this->url = trailingslashit( apply_filters( 'cmb2_meta_box_url', set_url_scheme( $cmb2_url ), CMB2_VERSION ) );\r\n```\r\nwith\r\n```\r\n$this->url = plugins_url( '', __FILE__ ) . '/../';\r\n```\r\nas a workaround.\r\n\r\nPlease find a better solution.\r\n"},"comment":{"url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/comments/251358498","html_url":"https://github.com/WebDevStudios/CMB2/issues/432#issuecomment-251358498","issue_url":"https://api.github.com/repos/WebDevStudios/CMB2/issues/432","id":251358498,"user":{"login":"justnorris","id":988095,"avatar_url":"https://avatars.githubusercontent.com/u/988095?v=3","gravatar_id":"","url":"https://api.github.com/users/justnorris","html_url":"https://github.com/justnorris","followers_url":"https://api.github.com/users/justnorris/followers","following_url":"https://api.github.com/users/justnorris/following{/other_user}","gists_url":"https://api.github.com/users/justnorris/gists{/gist_id}","starred_url":"https://api.github.com/users/justnorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justnorris/subscriptions","organizations_url":"https://api.github.com/users/justnorris/orgs","repos_url":"https://api.github.com/users/justnorris/repos","events_url":"https://api.github.com/users/justnorris/events{/privacy}","received_events_url":"https://api.github.com/users/justnorris/received_events","type":"User","site_admin":false},"created_at":"2016-10-04T11:03:36Z","updated_at":"2016-10-04T11:03:36Z","body":"This works perfectly for me:\r\n```\r\nif ( defined( \"WP_DEBUG\" ) && WP_DEBUG ) {\r\n\tfunction update_cmb2_meta_box_url( $url ) {\r\n\r\n\t\treturn plugin_dir_url( __FILE__ ) . '/vendor/webdevstudios/cmb2';\r\n\t}\r\n\r\n\tadd_filter( 'cmb2_meta_box_url', 'update_cmb2_meta_box_url' );\r\n}\r\n```"}}
{"actor":{"display_login":"justnorris"}}