Last active
August 22, 2024 10:58
-
-
Save thegulshankumar/59d98adf904e1fdc1e0dfacea8cff9ac to your computer and use it in GitHub Desktop.
Checkbox Enabler for Feedify Push Notifications System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Skip this line, beautification only. Start copying from Line #2. | |
function add_feedify_checkbox_enabler() { | |
?> | |
<script type="text/javascript"> | |
(function($) { | |
$(document).ready(function() { | |
function enableFeedifyCheckbox() { | |
var checkbox = $('#s_f_noti'); | |
if (checkbox.length) { | |
checkbox.prop('disabled', false).prop('checked', true); | |
} | |
} | |
enableFeedifyCheckbox(); | |
if (window.wp && wp.data && wp.data.subscribe) { | |
wp.data.subscribe(function () { | |
setTimeout(enableFeedifyCheckbox, 100); | |
}); | |
} | |
}); | |
})(jQuery); | |
</script> | |
<?php | |
} | |
add_action('admin_footer', 'add_feedify_checkbox_enabler'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're using the Feedify plugin and want to enable Push Notifications for all posts by default, this snippet automatically checks the 'Send Notification' checkbox. Normally, this option is unchecked. You can add this snippet to your functions.php file or use the Code Snippets plugin to implement it.