This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Options toggler hanlder | |
// To turn on/off other options base on toggler selection | |
function initOptionToggler() { | |
$(document).delegate('.yk-toggler', 'click', function(){ | |
var toggler_name = $(this).attr("name").replace("option_tree[","").replace("]",""); | |
var toggler_value = $(".yk-toggler[name*="+toggler_name+"]:checked").val(); | |
// Turn off all .yk-toggle-able fields | |
$(".yk-toggle-able[class*="+toggler_name+"]").parents(".format-settings").slideUp(); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check for WP 3.5. wp object only available in WP 3.5 | |
if (typeof wp !== 'undefined') { | |
OT_UI.init_upload = function() { | |
var _custom_media = true, | |
_orig_send_attachment = wp.media.editor.send.attachment; | |
$('.ot_upload_media').live('click', function(event) { | |
var field_id = $(this).parent('.option-tree-ui-upload-parent').find('input').attr('id'), | |
post_id = $(this).attr('rel'), | |
btnContent = ''; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inserts CSS with field_id markers. | |
* | |
* Inserts CSS into a dynamic.css file, placing it between | |
* BEGIN and END field_id markers. Replaces existing marked info, | |
* but still retains surrounding data. | |
* | |
* @param string $field_id The CSS option field ID. | |
* @param array $options The current option_tree array. | |
* @return bool True on write success, false on failure. |