Commit 1a4265a3 authored by Dave Lane's avatar Dave Lane
Browse files

adding new shortcode for WEnotesPost which includes a 'context' like 'tag' or...

adding new shortcode for WEnotesPost which includes a 'context' like 'tag' or 'page' to allow differentiation of feeds based on a context argument used on WE when embedding a feed
parent 54fcc372
......@@ -489,18 +489,28 @@ ${idbody}
// use WEnotes plugin
$(".WEnotes").each(function() {
var tag = $(this).data("tag"),
context = 'tag',
count = $(this).data("count");
$(this).replaceWith(`[WEnotes tag="${tag}" count="${count}"]`);
if ($(this).hasOwnProperty("context")) {
context = $(this).data("context");
}
$(this).replaceWith(`[WEnotes tag="${tag}" count="${count}" context="${context}"]`);
});
$(".WEnotesPost").each(function() {
var tag = $.trim($(this).data("tag")),
context = 'tag',
button = $.trim($(this).data("button")),
buttonAttr = button ? ` button="${button}"` : "",
leftmargin = $.trim($(this).data("leftmargin")),
leftmarginAttr = leftmargin ? ` leftmargin="${leftmargin}"` : "";
/*if ($(this).data("context") != undefined) {
context = $(this).data("context");
}*/
$(this).replaceWith(
`[WEnotesPost tag="${tag}"${buttonAttr}${leftmarginAttr}]`
);
/*$(this).replaceWith(
`[WEnotesPost tag="${tag}"${buttonAttr}${leftmarginAttr} context="${context}"]`*/
);
});
}
};
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment