Skip to content

Instantly share code, notes, and snippets.

View Remove Editor Options from Profile
remove_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
add_action( 'admin_head', function(){
ob_start();
?>
<style>
#your-profile > h2,
.user-rich-editing-wrap,
.user-syntax-highlighting-wrap
/*.user-comment-shortcuts-wrap,*/
View Add word count to excerpts
/** Add word count to excerpts */
function excerpt_count_js() {
if ('page' != get_post_type()) {
?>
<style>.span-excerpt_counter{font-size:12px;font-weight:normal;float:right;}</style>
<?php
echo '<script>jQuery(document).ready(function($) {
$("#postexcerpt .hndle").append("<span class=\"span-excerpt_counter\">Excerpt length: <span id=\"excerpt_counter\"></span><span> / 10 </span><span>character(s).</span></span>");
$("span#excerpt_counter").text($("#excerpt").val().length);
$("#excerpt").keyup( function() {
@dwesolowski
dwesolowski / YamlConfig.java
Last active Dec 3, 2020
Multi file config class for Spigot / Bukkit plugins
View YamlConfig.java
package com.github.dwesolowski.testing;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
import java.io.IOException;