Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6941195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:51:15+00:00 2026-05-27T12:51:15+00:00

The code is below – it uses a wordpress shortcode which is [my_hmg=widget.xml] but

  • 0

The code is below – it uses a wordpress shortcode which is [my_hmg=widget.xml] but if you try change the xml file like this [my_hmg=example_gallery.xml] it just always reverts to the default widget.xml

The problem is in the function my_hmg_filter_Callback in particular these 2 lines;

@$my_hmg_file = @$output['filename'];
if($my_hmg_file==""){$my_hmg_file = "widget.xml";}

For some reason it always thinks the file name is blank so always reverts to widget.xml.

The files can be downloaded from here – http://www.gopiplus.com/work/2010/07/18/horizontal-motion-gallery/

function my_hmg_show_filter($content){
    return  preg_replace_callback('/\[my_hmg=(.*?)\]/sim','my_hmg_filter_Callback',$content);
}


function my_hmg_filter_Callback($matches) 
{
    $my_hmg_package = "";
    $var = $matches[1];
    parse_str($var, $output);

    @$my_hmg_file = @$output['filename'];
    if($my_hmg_file==""){$my_hmg_file = "widget.xml";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T12:51:16+00:00Added an answer on May 27, 2026 at 12:51 pm

    Firstly change the short code to [my_hmg file='file.xml']

    Then if you have a quick read of WordPress’s short code API you’ll see that the first argument in the callback function are the attributes of the short code.

    This way you can the reference the attribute ‘file’ in the array and get the proper url.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The code below does what I need it to do, but it looks like
Code below select the <td> in which I'd like to select an <a> tag.
The code below won't work; it produces a blank screen. But if I change
The code below works. But if I comment out the line Dim objRequest As
Code below is pseudo code. Imagine a class Fruit which has a factory method
The code below works, but I suspect there is be a cleaner. Any alternative
My code below kinda works, it creates the User object and saves but it
Code below show date in format 02/15/2012. how to change it to 15/02/2012 Private
code below. i'm tryind to obtain string answers like a1, c4 this is what
Code below is a simple c# function return an int array. I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.