Skip to content
Snippets Groups Projects
Commit 0e675a48 authored by Grzegorz Rola's avatar Grzegorz Rola
Browse files

Added notice dismiss link.

parent 3d38b99c
No related branches found
No related tags found
1 merge request!15Feature/notice dismiss link
Pipeline #10139 passed
This commit is part of merge request !15. Comments created here will be created in the context of that merge request.
......@@ -81,7 +81,6 @@ class AjaxHandler implements HookablePluginDependant
*/
public function processAjaxNoticeDismiss()
{
error_log(print_r($_POST,true));
if (isset($_POST[self::POST_FIELD_NOTICE_NAME])) {
$noticeName = $_POST[self::POST_FIELD_NOTICE_NAME];
......
......@@ -61,7 +61,7 @@ class TestAjaxHandler extends WP_UnitTestCase
$ajaxHandler->hooks();
$this->expectOutputString('<script type="text/javascript">
jQuery(document).on("click",".notice-dismiss",function(){var a=jQuery(this).closest("div.notice").data("notice-name");var b=jQuery(this).closest("div.notice").data("source");if(""!==a){jQuery.ajax({url:ajaxurl,type:"post",data:{action:"wpdesk_notice_dismiss",notice_name:a,source:b},success:function(c){}})}});jQuery(document).on("click",".notice-dismiss-link",function(){jQuery(this).closest("div.notice").data("source",jQuery(this).data("source"));jQuery(this).closest("div.notice").find(".notice-dismiss").click()});
jQuery(document).on("click",".notice-dismiss",function(){var a=jQuery(this).closest("div.notice").data("notice-name");var b=jQuery(this).closest("div.notice").data("source");console.log("d");console.log(b);if(""!==a){jQuery.ajax({url:ajaxurl,type:"post",data:{action:"wpdesk_notice_dismiss",notice_name:a,source:b},success:function(c){}})}});jQuery(document).on("click",".notice-dismiss-link",function(){console.log(jQuery(this).data("source"));jQuery(this).closest("div.notice").data("source",jQuery(this).data("source"));jQuery(this).closest("div.notice").find(".notice-dismiss").click()});
</script>
');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment