Tagged with " wpalchemy"
Dec 18, 2014 - Genesis, Notes, PlugIns, WordPress    Comments Off on MSDLAB Toolkit

MSDLAB Toolkit

This is what I use for most of my WordPress Sites. The GitHub repository has most of the custom stuff that I use over and over. Generally speaking, I simply customize as needed per client. Not the “properest” way to do it, but faster and more cost effective for the client. Sometimes I do a major update when I find myself doing very similar customizations over and over.


Genesis Framework

Mad Science themes are built as child themes for the Genesis framework by StudioPress. Genesis themes work differently from other WordPress themes, because they rely strongly on hooks and actions. These two important keywords can take a bit of fiddling with to wrap your head around, but they are built into every part of WordPress, and once you understand them, they make it very simple to customize layout, activity, and even functionality of a WordPress site.

There are some nice reference sites for Genesis. I find myself going back to the visual hook guide frequently, as well as other areas of Genesis Tutorials.

You will need to install the Genesis theme on any site that you will be installing a genesis child theme.

MSDLAB Starter Theme

A Genesis starter theme with Twitter Bootstrap & Font Awesome support using LESS. On GitHub. Copy and rename to use.


Premium Plugins

Custom Plugins

The GitHub repository has a number of customized plugins. The one that is used on almost every site I do is MSD Site Settings. The others are mostly customizations of existing plugins. As I have time I am making them into “child plugins” so that they don’t need to be updated every time a source plugin is updated.

Plugin Directory Plugins

Can be found as favorites under my username, Foxydot. I don’t use all of these on every site, obviously, but these are ones I use often and trust.


The one tool I rely on quite a bit is WPAlchemy. There is a copy in the GitHub repository, at the WP_CONTENT_DIR level, because that’s where my plugins and themes call it from. You can place it anywhere you like, and there are probably old copies in my plugins too. Yes, you can do all of this the Tadlock Way (and the Tadlock Way is usually the right way), but I find WPAlchemy to be a small overhead price to pay for ease of use and function.

Feb 18, 2014 - Admin Area, WordPress    Comments Off on WPAlchemy repeating fileds and the wp_editor()

WPAlchemy repeating fileds and the wp_editor()

I may have something working. I’m still doing some testing, but I think the problem lies here:
” $editor_id (string) (required) HTML id attribute value for the textarea and TinyMCE. (may only contain lower-case letters)” (http://codex.wordpress.org/Function_Reference/wp_editor)

When you try to pass $mb->get_the_name(), it inputs all kinds of brackets and such, which are disallowed characters. Here’s where I’m at:

Using sanitize_key removes those illegal characters. Adding ‘textarea_name’=>$mb->get_the_name() to the settings array re-targets the input to that hidden textbox.

I’m using Extract Mode (I always do, for searchability) and so far it seems to be working.

Feb 13, 2013 - Admin Area, WordPress    Comments Off on Move meta box above editor

Move meta box above editor

function subtitle_footer_hook()
	?><script type="text/javascript">
Nov 14, 2012 - WordPress    Comments Off on WPAlchemy Data Storage Modes

WPAlchemy Data Storage Modes

Be careful to do this to make data searchable. Out of the box WPAlchemy uses WPALCHEMY_MODE_ARRAY which is not very useful for meta searches!

$custom_metabox = new WPAlchemy_MetaBox(array
    'id' => '_custom_meta',
    'title' => 'My Custom Meta',
    'template' => TEMPLATEPATH . '/custom/meta.php',
    'prefix' => '_my_'

If you forget, use this:

    if ( ! function_exists( 'msd_convert_storage' ) ) :
            function msd_convert_storage($key,$prefix,$posttype) {
                    $args = array(
                        'numberposts'     => -1,
                        'post_type'       => $posttype,
                    $items = get_posts($args);
                    foreach($items AS $item){
                            $the_meta = get_post_meta($item->ID,$key);
                            $fields = array();
                            foreach($the_meta[0] AS $meta_key => $meta_value){
                                    $meta_key = $prefix.$meta_key;
                                    update_post_meta($item->ID, $meta_key, $meta_value);
                                    $fields[] = $meta_key;