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 | |
add_action('admin_init', function () { | |
// Redirect any user trying to access comments page | |
global $pagenow; | |
if ($pagenow === 'edit-comments.php') { | |
wp_redirect(admin_url()); | |
exit; | |
} |
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
var countries = { | |
"Afghanistan": [ | |
"Badakhshan", | |
"Badghis", | |
"Baghlan", | |
"Balkh", | |
"Bamian", | |
"Daykondi", | |
"Farah", | |
"Faryab", |
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
<!-- Jinja Unique ID Generator --> | |
{% macro random_int(len) -%} | |
{% for n in range(len) %} | |
{{ [0,1,2,3,4,5,6,7,8,9]|random }} | |
{% endfor %} | |
{%- endmacro %} | |
{% macro unique_id(count_groups=5, group_len=6, separator='-') -%} | |
{% set parts %} |
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
window.onbeforeunload = function(e) { | |
var message = "Your confirmation message goes here.", e = e || window.event; | |
// For IE and Firefox | |
if (e) { | |
e.returnValue = message; | |
} | |
// For Safari | |
return message; | |
}; |
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 | |
/** | |
* @name WP Auto Login | |
* @desc Automatically login a single WordPress user upon arrival to main page. | |
* @author Alex Zappa | |
* @link https://gist.github.com/reatlat/b3de420eee85cac3e344f981e8f27f87 | |
*/ | |
function auto_login() { | |
if (!is_user_logged_in()) { | |
// Admin user_id |
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
{# Helpers: slugify #} | |
{# Returns the slug version of a string #} | |
{# Parameters #} | |
{# string | String to convert into a slug | Required #} | |
{# How to import this macro to my module #} | |
{# {% from '[folder]/slugify.html' import slugify %} #} | |
{# How to use this macro #} |
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
module.exports = (...args) => { | |
if (location.hostname.match("local")) | |
console.log("🦄:", ...args); | |
}; |
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 | |
return [ | |
'' => '3d_rotation', | |
'' => 'access_alarm', | |
'' => 'access_alarms', | |
'' => 'access_time', | |
'' => 'accessibility', | |
'' => 'account_balance', | |
'' => 'account_balance_wallet', |
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
<a href="#" onclick="download_table_as_csv('my_id_table_to_export');">Download as CSV</a> |
NewerOlder