Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions extensions/customizer/extension_customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ public function __construct( $parent ) {
if ( empty( $this->extension_dir ) ) {
$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
$this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );

// Easier to read and less buggy way to find out correct url, but applicable
// only if wp-content found. Othewise fall back to old URL detection code.
if ( preg_match("/wp-content\/(.*)/", $this->extension_dir, $match) ) {
$this->extension_url = site_url('/wp-content/'.$match[1]);
}
}

}
Expand Down
8 changes: 7 additions & 1 deletion extensions/edd/extension_edd.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,14 @@ public function __construct( $parent ) {
if ( empty( $this->extension_dir ) ) {
$this->extension_dir = trailingslashit( str_replace( '\\', '/', dirname( __FILE__ ) ) );
$this->extension_url = site_url( str_replace( trailingslashit( str_replace( '\\', '/', ABSPATH ) ), '', $this->extension_dir ) );

// Easier to read and less buggy way to find out correct url, but applicable
// only if wp-content found. Othewise fall back to old URL detection code.
if ( preg_match("/wp-content\/(.*)/", $this->extension_dir, $match) ) {
$this->extension_url = site_url('/wp-content/'.$match[1]);
}
}


if ( isset( $parent->args['edd'] ) && !empty( $parent->args['edd'] ) ) {
// Create defaults array
Expand Down