Wordpress - Call snippet on another snippet - How to manage bracket? - wordpress

I'm block into something silly.
I want to call another snippet into one snippet on Wordpress. This is the idea :
[ snippet01 param=[snippet02 param="awesomeParameter"]]
Badly, that is not working out of the box. I've trying with another bracket like "{", but this is also not working.
Do you have an answer ?
Thanks in advance,

Here is another approach for your case:
Instead of [ snippet01 param=[snippet02 param="awesomeParameter"]]
you can use this format:
[ snippet01 param="subsnippet-snippet02,param,awesomeParameter"]
Then easily parse and use it inside first shortcode:
function first_shortcode_function($args){
if (strpos($args["param"],"subsnippet-")===0){
$parts=explode("-",$args["param"]);
$snippe2_final=explode(",",$parts[1]);
do_shortcode("[".$snippe2_final[0]." ".$snippe2_final[1]."=".$snippe2_final[2]."]");
}
}

Related

How is Handlebars handling of ".." (up level) correct?

Using Handlebars Cookbook for example material...
Data:
{
"foo": {
"bar": {
"moo": "No"
}
},
"moo": "Yes!"
}
Template:
{{#foo.bar}}
{{../moo}}
{{/foo.bar}}
Expected Output:
Yes!
This just seems wrong to me, and I'm hoping someone can help me with the logic.
If Handlebars navigates context down the first lookup "foo.bar", the context inside the block should be bar, or {"moo":"No"}. In fact it seems to be. If I put {{moo}} in the block body I'd see "No" for output.
So it would seem logical that, ".." goes up 1 level to context foo, {"bar":{"moo","No"}}. There is no "moo" in the "foo" object. The logical/expected way to get "Yes!" would be to use {{../../moo}}, but that's not how it works.
What is the logic here?
I think I see. I'm assuming (wrongly) that Handlebars resolves each path component into a context: Context[foo] -> Context[bar]. That's not how it seems to work. Rather it creates Context[foo.bar]. So ".." from that is indeed root, so "../moo" is "Yes!".
It's not a path stack in the programming sense, but seemly rather a stack/history of block contexts.

Protractor-Cucumber: how to generate HTML report

After add line resultJsonOutputFile: 'report.json', to config file and run my test in Webstorm, there is a report.json created but there is no content on it. I don't know what's the reason.
Please help me to expland why my report.json has no content? And how to generate Html report for my test?
Use cucumber-html-report You might want to have a look at this:
https://stackoverflow.com/a/33739439/790950
Make sure you add the code snippet to your features/support/hooks.js file and also load that file as part of your protractor.conf file:
cucumberOpts: {
require: [
'../e2e/features/**/steps/*.js',
'../e2e/features/support/hooks.js',
],
format: 'pretty',
},
Notice that you don't have to change the console format as it does it dynamically. Also adds screenshots in case of failures.

RunWait() - add parameters

My AutoIt script launches another script (written in UIAutomation). So I wrote this:
RunWait("C:\AutoUIInst\Test\bin\Debug\" & "Test.exe", "","")
It works fine. But now I have to add a parameter. For example: "Test.exe -someParam" . So i tried RunWait() :
RunWait('"C:\AutoUIInst\Test\bin\Debug\" & "Test.exe" -someParam', "","")
That won't work. Can someone help?
Maybe there is only a space missing right before the paramter.
RunWait("C:\AutoUIInst\Test\bin\Debug\Test.exe -someParam", "","")
You can also try ShellexecuteWait which also has a Parameter option!
I had similar problems some time ago when running another applications from my script and I solved it by using ShellExecuteWait. You can rewrite your call like this:
ShellExecuteWait("C:\AutoUIInst\Test\bin\Debug\Test.exe", "-someParam")

Less css - Can we use more variables seperate with coma

Like this
#ShuttleGrey: #606369;
I need same output color value from more variables [I am looking for a single line solution]
#themeOne:, #themeTwo:, #themeThree: #ShuttleGrey;
I know my code is an error , Does anyone know to fix this situation ?
Thanks
Assuming that you want the same properties to apply in many places you can do something like this
.aProperty{
color:#606369
}
Then you can do something like this to add the same properties to other elements
.anotherProperty{
background:#000; //just like that
.aProperty;
}
This way .anotherProperty will inherit the properties of aProperty.
This way you can even add other properties and use them at many places.
.aProperty{
color:#606369
}
Then you can do something like this to add the same properties to other elements
.anotherProperty{
background:#000; //just like that
.aProperty;
}
Since no answer is accepted I am trying my luck:)

Looking for a filter to modify the months

Hi making a simple plugin that replaces the wrong russian month with the right ones.
But I can't find any filters that works.
I have tried these filters without success:
add_filter('get_the_modified_date', 'russian-month');
add_filter('the_modified_date', 'russian-month');
add_filter('date_rewrite_rules', 'russian-month');
Just found out that you can use more functions as filters and not only the ones on http://codex.wordpress.org/Plugin_API/Filter_Reference#Date_and_Time_Filters
add_filter('get_the_date', 'russian-month');
did the trick for me :)

Resources