• Hi

    Would it not be better if you would do

    function download_from_files_617_icon($icon) {
        $src = '';
        if (!empty($icon)) {
                 $src = plugin_dir_url( __DIR__ ).'/assets/images/'.$icon;
        }
        return $src;
    }

    instead of

    function download_from_files_617_icon($icon) {
        $src = '';
        if (!empty($icon)) {
            $src = esc_url( home_url('/') ) . str_replace(DOWNLOAD_FROM_FILES_617_WP_ROOT, '', DOWNLOAD_FROM_FILES_617_ROOT) . '/assets/images/' . $icon;
        }
        return $src;
    }

    Best regards
    Marco

Viewing 1 replies (of 1 total)
  • Anonymous User 17720058

    (@anonymized-17720058)

    Dear Marco! Thank you for your comment!
    The solution looked complex, but I memorize that the plugin_dir_url() function was a problem if it was not standard for the file system of WordPress installation. (There was no /var/www on Linux on the location of WordPress’s own files.)

Viewing 1 replies (of 1 total)

The topic ‘hooks.php’ is closed to new replies.