Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block netzgestaltung

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
netzgestaltung / admin.js
Last active Oct 25, 2017 — forked from zerosignalproductions/admin.js
Insert an image into the wordpress editor always wrapped in a figure tag. The javascript is used to remove the figure element from the editor if the delete button is used. Editing alingnment left/right/center/none is supported.
View admin.js
(function($) {
$(document).ready(function() {
$('body').on('mousedown', 'div[aria-label="Remove"]', function(e) {
var editor = tinyMCE.activeEditor,
element = editor.selection.getNode();
if(element.tagName !== 'FIGURE') {
View wf_wp_content_excerpt
* @description Echoes custom the_excerpt from any post id. the_excerpt is 7 words long as default
* @arguments mixed
* @param array $arguments default NULL array of arguments - the below mentioned + $limit
* @param int $post_id default NULL the id of the post, if null, the current post is taken
* @param string $cut default '...' when nothing setted it will take the current Postcontent from loop and excerpt it
You can’t perform that action at this time.