Air for Android CS5 Extension
If you haven’t heard yet, there’s an update out for the Adobe Air for Android pre-release.
What?
AdobeĀ® AIRĀ® will let you publish ActionScript 3 projects to run as native applications (.apk) for the Android OS. These AIR applications can be delivered to Android devices through Android application stores such as the Android Market.
Developers can write new code or reuse existing web content to build AIR applications for the Android OS. Because the source code and assets are reusable across the Flash Platform runtimes, Adobe AIR and Flash Player, it also gives developers a way to more easily target other mobile and desktop environments.
Get it here: http://bit.ly/c1p6BW
MoreRemoving SWFObject Border around Flash®
If you’re like me and use SWFObject to embed flash into your web pages, then you’ve noticed the thin border around the swf when it has focus. Well that can easily be removed by using a little CSS.
object { outline:none; }
That’s it! Hope it helps.
MoreChanging the WordPress Admin Logo
One of the most useful snippets I’ve found gives you the ability to change the WordPress admin logo.
/** * Custom admin logo & remove thank you footer */ add_action('admin_head', 'adminLogo'); function adminLogo() { echo '<style type="text/css"> #header-logo { background-image: url('.get_bloginfo('url').'/LOGOIMAGE.png) !important; } #footer-left { display: none; } </style>'; }
*Note: The logo image should be 30 x 31 pixels in order to display properly
MoreAccessing WordPress Databases
One of the more useful things I’ve learned while developing with WordPress is the use of the $wpdb class which allows you to use the WordPress database functions in your plugin without including the header and footer. This is useful when you’re using a bit of jQuery or AJAX to submit a form and get a call back w/o getting all the WordPress headers and HTML.
// Wordpress root directory (from plugin's directory) $path = '../../../'; include_once($path . 'wp-config.php'); include_once($path . 'wp-load.php'); include_once($path . 'wp-includes/wp-db.php'); function attachments() { global $wpdb; $sql = "SELECT * FROM ".$wpdb->posts." WHERE post_type = 'attachment'"; $rows = $wpdb->get_results($sql); $html = ''; foreach($rows as $row) { $html .= '<div><a href="'.$row->guid.'">'.$row->post_title.'</a></div>'; } return $html; } // Outputs a list of the attachments (media files) echo attachments(); //
TinyMCE in WordPress Plugin
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
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
the_editor($content_to_load);

