TinyMCE in WordPress Plugins

Posted in WordPress on January 12th, 2010 by Cam – Be the first to comment

I’ve been to the edge of the internet and back, before I found this tidbit of code that will allow you to use TinyMCE in your WordPress plugins!

1. Add the following code to your plugin

1
2
3
4
5
6
7
8
9
10
11
12
add_filter('admin_head','myplugin_tinymce');
 
function myplugin_tinymce() {
    wp_admin_css('thickbox');
    wp_print_scripts('jquery-ui-core');
    wp_print_scripts('jquery-ui-tabs');
    wp_print_scripts('post');
    wp_print_scripts('editor');
    add_thickbox();
    wp_print_scripts('media-upload');
    if (function_exists('wp_tiny_mce')) { wp_tiny_mce(); }
}

2. Call the editor in your plugin

1
the_editor($content_to_load);

Parallax Component

Posted in Flash CS4 Components on July 23rd, 2009 by Cam – Be the first to comment

Get Adobe Flash player

  • Language Version: ActionScript 3.0
  • Runtime Version: AIR 1.0, Flash Player 9+
  • Description: Parallax FX
  • Version: 1.0.1
  • Author: Cameron Tullos
  • [download]
    read more »

str_replace() function

Posted in ActionScript 3.0 Snippets on May 22nd, 2009 by Cam – Be the first to comment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function str_replace(search, replace, string) {
	while(string.indexOf(search) != -1) {
		var array = string.split(search);
		string = array.join(replace);
	}
	return string;
}
 
// Example
var str = 'testing\r\nthis';
trace(str);
 
var newString = str;
newString = str_replace("\r", '', newString);
newString = str_replace("\n", ' ', newString);
 
trace(newString);