Ok – system converted last example – of course… 🙂
I can get <Supplier-Catalog timestamp=”28-11-2019 12:31:25″>
Damn… ‘AND-SIGNlt;Supplier-Catalog timestamp=”28-11-2019 12:31:25″>’
Hi @elkurczako,
I believe what you need is:
AND-SIGNlt;Supplier-Catalog timestamp="[alg_current_datetime datetime_format='d-m-Y H:i:s']">
AND-SIGN in the snippet above should be replaced with &
-
This reply was modified 6 years, 5 months ago by
Algoritmika.
The problem is, that with < I get output:
& lt;Supplier-Catalog timestamp="28-11-2019 23:24:57">
and yes I know, there should be no space between & and lt; – WordPress.org forum forms just changes HTML entities to characters. And my WordPress doesn’t.
@elkurczako,
I’ve just checked and you are correct, < is not converted in resulting XML file, however, it seems that file is still parsed normally, e.g. if you open it in your browser it shows “normal” XML structure.
Hi @elkurczako,
I was thinking – if you need HTML entities converted to characters in XML file – there is a solution. All plugin’s shortcodes have custom_function attribute available, so if you add this to your (child) theme’s functions.php file:
if ( ! function_exists( 'my_alg_wc_xml_wrap_supplier_catalog' ) ) {
/**
* my_alg_wc_xml_wrap_supplier_catalog.
*/
function my_alg_wc_xml_wrap_supplier_catalog( $result ) {
return '<Supplier-Catalog timestamp="' . $result . '"/>';
}
}
then you can just add this to your XML “Template” option:
[alg_current_datetime datetime_format="d-m-Y H:i:s" custom_function="my_alg_wc_xml_wrap_supplier_catalog"]
P.S. Also I think you need to have / symbol for closing tag at the end, i.e.:
<Supplier-Catalog timestamp="29-11-2019 13:17:23"/>
and not:
<Supplier-Catalog timestamp="29-11-2019 13:17:23">
Hope that helps.
That did the trick!
Thank you very much for your time and effort. Great support!
@elkurczako,
Great, happy to hear it’s solved!
P.S. And if you like the plugin, please consider leaving us a rating.