Skip to content

Instantly share code, notes, and snippets.

View vladimir-s-snippets's full-sized avatar

vladimir-s-snippets

View GitHub Profile
@vladimir-s-snippets
vladimir-s-snippets / gist:6904995
Created October 9, 2013 17:28
TinyMCE: parsing pasted html
$('#myEditor').tinymce({
...
content_css: '/path_to/styles.css',
paste_preprocess : function(pl, o) {
// Content string containing the HTML from the clipboard
o.content = strip_tags(o.content);
},
...
});
<?php
$categories = get_the_category($post->ID);
if ($categories) {
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
'category__in' => $category_ids,
'post__not_in' => array($post->ID),
'showposts'=>-1, // Number of related posts that will be shown.
'fields' => 'ids',
@vladimir-s-snippets
vladimir-s-snippets / gist:3911349
Created October 18, 2012 11:55
JavaScript: jQuery: plugin template
(function($) {
$.fn.<PLUGIN_NAME> = function(settings) {
//default values
var config = {
};
//using user defined values
if (settings) $.extend(config, settings);
//single element
// var element = this;