Skip to content

Instantly share code, notes, and snippets.

View mintindeed's full-sized avatar

Gabriel Koen mintindeed

View GitHub Profile
@mintindeed
mintindeed / Add to Common Functions
Created December 5, 2012 01:20 — forked from vickybiswas/Add to Common Functions
Fix for broken menu_order
/**
* WP 3.5 doesn't update menu_order for ordering attachments, so this function updates the menu_order so that you can orderby menu_order
* @param int $id
*/
function pmc_gallery_menu_order_fix($id) {
$regex_pattern = get_shortcode_regex();
preg_match ('/'.$regex_pattern.'/s', stripslashes($_POST['content']), $regex_matches);
if ( ! $regex_matches ) {
return false;
}