WordPress.org

Ready to get started?Download WordPress

Forums

Need help with this function.. (1 post)

  1. Alex.R
    Member
    Posted 2 years ago #

    How can I convert this function to make $path a subdomain.
    Right now it's outputting

    http://blog.mysite.com/static/plugins/translator/image_map.png

    I need it to be:

    http://static.mysite.com/plugins/translator/image_map.png

    Can anyone help me with this? My plugin folder is in a subdomain now, and the translator plugin stopped working, so I'm trying to make this plugin work now. Thanks in advance.

    function gltr_get_flag_image_path($language) {
      return dirname(__file__) . '/flag_' . $language . '.png';
    }
    
    function gltr_get_flag_image($language) {
      //thanks neanton!
      $path = strstr(realpath(dirname(__file__)), 'static');
      $path = str_replace('\\', '/', $path);
      return get_settings('siteurl') . '/' . $path . '/flag_' . $language . '.png';
    }
    
    function gltr_get_flags_image() {
      $path = strstr(realpath(dirname(__file__)), 'static');
      $path = str_replace('\\', '/', $path);
      return get_settings('siteurl') . '/' . $path . '/image_map.png';
    }

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.