Version Description
- Updated width of text input
- New media uploader
- Dropped custom post types for file attachments
- Update routine to remove unused 'optionsframework' post types
- Updated IDs for .tabs and .groups
- Italian translations (andreabersi.com)
- Russian translations (verha.net)
- Swedish translations (kjeell.se)
Download this release
Release Info
Developer | downstairsdev |
Plugin | Options Framework |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.5
- css/optionsframework.css +5 -2
- js/media-uploader.js +77 -0
- js/of-medialibrary-uploader.js +0 -163
- js/options-custom.js +9 -9
- lang/{options-framework-hu.po → options-framework-hu_HU.po} +0 -0
- lang/optionsframework-it_IT.mo +0 -0
- lang/optionsframework-it_IT.po +142 -0
- lang/optionsframework-ru_RU.mo +0 -0
- lang/optionsframework-ru_RU.po +143 -0
- lang/optionsframework-sv_SE.mo +0 -0
- lang/optionsframework-sv_SE.po +146 -0
- options-framework.php +45 -41
- options-interface.php +24 -24
- options-media-uploader.php +107 -0
- options-medialibrary-uploader.php +0 -286
- options-sanitize.php +4 -4
- readme.txt +13 -2
- screenshot-1.png +0 -0
- upgrade.php +80 -0
css/optionsframework.css
CHANGED
@@ -48,6 +48,9 @@
|
|
48 |
#optionsframework .section-checkbox .explain {
|
49 |
max-width:94%;
|
50 |
}
|
|
|
|
|
|
|
51 |
#optionsframework .controls select, #optionsframework .controls textarea {
|
52 |
margin-bottom:10px;
|
53 |
width:100%;
|
@@ -192,7 +195,7 @@
|
|
192 |
padding:4px;
|
193 |
margin-bottom:10px;
|
194 |
}
|
195 |
-
#optionsframework .screenshot .
|
196 |
background:url("../images/ico-delete.png") no-repeat;
|
197 |
border:medium none;
|
198 |
bottom:4px;
|
@@ -208,7 +211,7 @@
|
|
208 |
#optionsframework .screenshot .no_image .file_link {
|
209 |
margin-left: 20px;
|
210 |
}
|
211 |
-
#optionsframework .screenshot .no_image .
|
212 |
bottom: 0px;
|
213 |
}
|
214 |
#optionsframework .reset-button {
|
48 |
#optionsframework .section-checkbox .explain {
|
49 |
max-width:94%;
|
50 |
}
|
51 |
+
#optionsframework .of-input {
|
52 |
+
width:100%;
|
53 |
+
}
|
54 |
#optionsframework .controls select, #optionsframework .controls textarea {
|
55 |
margin-bottom:10px;
|
56 |
width:100%;
|
195 |
padding:4px;
|
196 |
margin-bottom:10px;
|
197 |
}
|
198 |
+
#optionsframework .screenshot .remove-image {
|
199 |
background:url("../images/ico-delete.png") no-repeat;
|
200 |
border:medium none;
|
201 |
bottom:4px;
|
211 |
#optionsframework .screenshot .no_image .file_link {
|
212 |
margin-left: 20px;
|
213 |
}
|
214 |
+
#optionsframework .screenshot .no_image .remove-button {
|
215 |
bottom: 0px;
|
216 |
}
|
217 |
#optionsframework .reset-button {
|
js/media-uploader.js
ADDED
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
(function($) {
|
2 |
+
$(document).ready(function() {
|
3 |
+
|
4 |
+
function optionsframework_add_file(event, selector) {
|
5 |
+
|
6 |
+
var upload = $(".uploaded-file"), frame;
|
7 |
+
var $el = $(this);
|
8 |
+
|
9 |
+
event.preventDefault();
|
10 |
+
|
11 |
+
// If the media frame already exists, reopen it.
|
12 |
+
if ( frame ) {
|
13 |
+
frame.open();
|
14 |
+
return;
|
15 |
+
}
|
16 |
+
|
17 |
+
// Create the media frame.
|
18 |
+
frame = wp.media({
|
19 |
+
// Set the title of the modal.
|
20 |
+
title: $el.data('choose'),
|
21 |
+
|
22 |
+
// Customize the submit button.
|
23 |
+
button: {
|
24 |
+
// Set the text of the button.
|
25 |
+
text: $el.data('update'),
|
26 |
+
// Tell the button not to close the modal, since we're
|
27 |
+
// going to refresh the page when the image is selected.
|
28 |
+
close: false
|
29 |
+
}
|
30 |
+
});
|
31 |
+
|
32 |
+
// When an image is selected, run a callback.
|
33 |
+
frame.on( 'select', function() {
|
34 |
+
// Grab the selected attachment.
|
35 |
+
var attachment = frame.state().get('selection').first();
|
36 |
+
frame.close();
|
37 |
+
selector.find('.upload').val(attachment.attributes.url);
|
38 |
+
if ( attachment.attributes.type == 'image' ) {
|
39 |
+
selector.find('.screenshot').empty().hide().append('<img src="' + attachment.attributes.url + '"><a class="remove-image">Remove</a>').slideDown('fast');
|
40 |
+
}
|
41 |
+
selector.find('.upload-button').unbind().addClass('remove-file').removeClass('upload-button').val(optionsframework_l10n.remove);
|
42 |
+
selector.find('.of-background-properties').slideDown();
|
43 |
+
optionsframework_file_bindings();
|
44 |
+
});
|
45 |
+
|
46 |
+
// Finally, open the modal.
|
47 |
+
frame.open();
|
48 |
+
}
|
49 |
+
|
50 |
+
function optionsframework_remove_file(selector) {
|
51 |
+
selector.find('.remove-image').hide();
|
52 |
+
selector.find('.upload').val('');
|
53 |
+
selector.find('.of-background-properties').hide();
|
54 |
+
selector.find('.screenshot').slideUp();
|
55 |
+
selector.find('.remove-file').unbind().addClass('upload-button').removeClass('remove-file').val(optionsframework_l10n.upload);
|
56 |
+
// We don't display the upload button if .upload-notice is present
|
57 |
+
// This means the user doesn't have the WordPress 3.5 Media Library Support
|
58 |
+
if ( $('.section-upload .upload-notice').length > 0 ) {
|
59 |
+
$('.upload-button').remove();
|
60 |
+
}
|
61 |
+
optionsframework_file_bindings();
|
62 |
+
}
|
63 |
+
|
64 |
+
function optionsframework_file_bindings() {
|
65 |
+
$('.remove-image, .remove-file').on('click', function() {
|
66 |
+
optionsframework_remove_file( $(this).parents('.section') );
|
67 |
+
});
|
68 |
+
|
69 |
+
$('.upload-button').click( function( event ) {
|
70 |
+
optionsframework_add_file(event, $(this).parents('.section'));
|
71 |
+
});
|
72 |
+
}
|
73 |
+
|
74 |
+
optionsframework_file_bindings();
|
75 |
+
});
|
76 |
+
|
77 |
+
})(jQuery);
|
js/of-medialibrary-uploader.js
DELETED
@@ -1,163 +0,0 @@
|
|
1 |
-
/*-----------------------------------------------------------------------------------*/
|
2 |
-
/* WooFramework Media Library-driven AJAX File Uploader Module
|
3 |
-
/* JavaScript Functions (2010-11-05)
|
4 |
-
/*
|
5 |
-
/* The code below is designed to work as a part of the WooFramework Media Library-driven
|
6 |
-
/* AJAX File Uploader Module. It is included only on screens where this module is used.
|
7 |
-
/*
|
8 |
-
/* Used with (very) slight modifications for Options Framework.
|
9 |
-
/*-----------------------------------------------------------------------------------*/
|
10 |
-
|
11 |
-
(function ($) {
|
12 |
-
|
13 |
-
optionsframeworkMLU = {
|
14 |
-
|
15 |
-
/*-----------------------------------------------------------------------------------*/
|
16 |
-
/* Remove file when the "remove" button is clicked.
|
17 |
-
/*-----------------------------------------------------------------------------------*/
|
18 |
-
|
19 |
-
removeFile: function () {
|
20 |
-
|
21 |
-
$('.mlu_remove').live('click', function(event) {
|
22 |
-
$(this).hide();
|
23 |
-
$(this).parents().parents().children('.upload').attr('value', '');
|
24 |
-
$(this).parents('.screenshot').slideUp();
|
25 |
-
$(this).parents('.screenshot').siblings('.of-background-properties').hide(); //remove background properties
|
26 |
-
return false;
|
27 |
-
});
|
28 |
-
|
29 |
-
// Hide the delete button on the first row
|
30 |
-
$('a.delete-inline', "#option-1").hide();
|
31 |
-
|
32 |
-
}, // End removeFile
|
33 |
-
|
34 |
-
/*-----------------------------------------------------------------------------------*/
|
35 |
-
/* Replace the default file upload field with a customised version.
|
36 |
-
/*-----------------------------------------------------------------------------------*/
|
37 |
-
|
38 |
-
recreateFileField: function () {
|
39 |
-
|
40 |
-
$('input.file').each(function(){
|
41 |
-
var uploadbutton = '<input class="upload_file_button" type="button" value="Upload" />';
|
42 |
-
$(this).wrap('<div class="file_wrap" />');
|
43 |
-
$(this).addClass('file').css('opacity', 0); //set to invisible
|
44 |
-
$(this).parent().append($('<div class="fake_file" />').append($('<input type="text" class="upload" />').attr('id',$(this).attr('id')+'_file')).val( $(this).val() ).append(uploadbutton));
|
45 |
-
|
46 |
-
$(this).bind('change', function() {
|
47 |
-
$('#'+$(this).attr('id')+'_file').val($(this).val());
|
48 |
-
});
|
49 |
-
$(this).bind('mouseout', function() {
|
50 |
-
$('#'+$(this).attr('id')+'_file').val($(this).val());
|
51 |
-
});
|
52 |
-
});
|
53 |
-
|
54 |
-
}, // End recreateFileField
|
55 |
-
|
56 |
-
/*-----------------------------------------------------------------------------------*/
|
57 |
-
/* Use a custom function when working with the Media Uploads popup.
|
58 |
-
/* Requires jQuery, Media Upload and Thickbox JavaScripts.
|
59 |
-
/*-----------------------------------------------------------------------------------*/
|
60 |
-
|
61 |
-
mediaUpload: function () {
|
62 |
-
|
63 |
-
jQuery.noConflict();
|
64 |
-
|
65 |
-
$( 'input.upload_button' ).removeAttr('style');
|
66 |
-
|
67 |
-
var formfield,
|
68 |
-
formID,
|
69 |
-
btnContent = true,
|
70 |
-
tbframe_interval;
|
71 |
-
// On Click
|
72 |
-
$('input.upload_button').live("click", function () {
|
73 |
-
formfield = $(this).prev('input').attr('id');
|
74 |
-
formID = $(this).attr('rel');
|
75 |
-
|
76 |
-
//Change "insert into post" to "Use this Button"
|
77 |
-
tbframe_interval = setInterval(function() {jQuery('#TB_iframeContent').contents().find('.savesend .button').val('Use This Image');}, 2000);
|
78 |
-
|
79 |
-
// Display a custom title for each Thickbox popup.
|
80 |
-
var woo_title = '';
|
81 |
-
|
82 |
-
if ( $(this).parents('.section').find('.heading') ) { woo_title = $(this).parents('.section').find('.heading').text(); } // End IF Statement
|
83 |
-
|
84 |
-
tb_show( woo_title, 'media-upload.php?post_id='+formID+'&TB_iframe=1' );
|
85 |
-
return false;
|
86 |
-
});
|
87 |
-
|
88 |
-
window.original_send_to_editor = window.send_to_editor;
|
89 |
-
window.send_to_editor = function(html) {
|
90 |
-
|
91 |
-
if (formfield) {
|
92 |
-
|
93 |
-
//clear interval for "Use this Button" so button text resets
|
94 |
-
clearInterval(tbframe_interval);
|
95 |
-
|
96 |
-
// itemurl = $(html).attr('href'); // Use the URL to the main image.
|
97 |
-
|
98 |
-
if ( $(html).html(html).find('img').length > 0 ) {
|
99 |
-
|
100 |
-
itemurl = $(html).html(html).find('img').attr('src'); // Use the URL to the size selected.
|
101 |
-
|
102 |
-
} else {
|
103 |
-
|
104 |
-
// It's not an image. Get the URL to the file instead.
|
105 |
-
|
106 |
-
var htmlBits = html.split("'"); // jQuery seems to strip out XHTML when assigning the string to an object. Use alternate method.
|
107 |
-
itemurl = htmlBits[1]; // Use the URL to the file.
|
108 |
-
|
109 |
-
var itemtitle = htmlBits[2];
|
110 |
-
|
111 |
-
itemtitle = itemtitle.replace( '>', '' );
|
112 |
-
itemtitle = itemtitle.replace( '</a>', '' );
|
113 |
-
|
114 |
-
} // End IF Statement
|
115 |
-
|
116 |
-
var image = /(^.*\.jpg|jpeg|png|gif|ico*)/gi;
|
117 |
-
var document = /(^.*\.pdf|doc|docx|ppt|pptx|odt*)/gi;
|
118 |
-
var audio = /(^.*\.mp3|m4a|ogg|wav*)/gi;
|
119 |
-
var video = /(^.*\.mp4|m4v|mov|wmv|avi|mpg|ogv|3gp|3g2*)/gi;
|
120 |
-
|
121 |
-
if (itemurl.match(image)) {
|
122 |
-
btnContent = '<img src="'+itemurl+'" alt="" /><a href="#" class="mlu_remove button">Remove Image</a>';
|
123 |
-
} else {
|
124 |
-
|
125 |
-
// No output preview if it's not an image.
|
126 |
-
// btnContent = '';
|
127 |
-
// Standard generic output if it's not an image.
|
128 |
-
|
129 |
-
html = '<a href="'+itemurl+'" target="_blank" rel="external">View File</a>';
|
130 |
-
btnContent = '<div class="no_image"><span class="file_link">'+html+'</span><a href="#" class="mlu_remove button">Remove</a></div>';
|
131 |
-
}
|
132 |
-
|
133 |
-
$('#' + formfield).val(itemurl);
|
134 |
-
// $('#' + formfield).next().next('div').slideDown().html(btnContent);
|
135 |
-
$('#' + formfield).siblings('.screenshot').slideDown().html(btnContent);
|
136 |
-
$('#' + formfield).siblings('.of-background-properties').show(); //show background properties
|
137 |
-
tb_remove();
|
138 |
-
|
139 |
-
} else {
|
140 |
-
window.original_send_to_editor(html);
|
141 |
-
}
|
142 |
-
|
143 |
-
// Clear the formfield value so the other media library popups can work as they are meant to. - 2010-11-11.
|
144 |
-
formfield = '';
|
145 |
-
}
|
146 |
-
|
147 |
-
} // End mediaUpload
|
148 |
-
|
149 |
-
}; // End optionsframeworkMLU Object // Don't remove this, or the sky will fall on your head.
|
150 |
-
|
151 |
-
/*-----------------------------------------------------------------------------------*/
|
152 |
-
/* Execute the above methods in the optionsframeworkMLU object.
|
153 |
-
/*-----------------------------------------------------------------------------------*/
|
154 |
-
|
155 |
-
$(document).ready(function () {
|
156 |
-
|
157 |
-
optionsframeworkMLU.removeFile();
|
158 |
-
optionsframeworkMLU.recreateFileField();
|
159 |
-
optionsframeworkMLU.mediaUpload();
|
160 |
-
|
161 |
-
});
|
162 |
-
|
163 |
-
})(jQuery);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/options-custom.js
CHANGED
@@ -12,12 +12,12 @@ jQuery(document).ready(function($) {
|
|
12 |
|
13 |
// Switches option sections
|
14 |
$('.group').hide();
|
15 |
-
var
|
16 |
if (typeof(localStorage) != 'undefined' ) {
|
17 |
-
|
18 |
}
|
19 |
-
if (
|
20 |
-
$(
|
21 |
} else {
|
22 |
$('.group:first').fadeIn();
|
23 |
}
|
@@ -31,19 +31,19 @@ jQuery(document).ready(function($) {
|
|
31 |
$(this).filter('.hidden').removeClass('hidden');
|
32 |
});
|
33 |
});
|
34 |
-
|
35 |
-
|
36 |
-
$(activetab + '-tab').addClass('nav-tab-active');
|
37 |
}
|
38 |
else {
|
39 |
$('.nav-tab-wrapper a:first').addClass('nav-tab-active');
|
40 |
}
|
|
|
41 |
$('.nav-tab-wrapper a').click(function(evt) {
|
42 |
$('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
43 |
$(this).addClass('nav-tab-active').blur();
|
44 |
var clicked_group = $(this).attr('href');
|
45 |
if (typeof(localStorage) != 'undefined' ) {
|
46 |
-
localStorage.setItem("
|
47 |
}
|
48 |
$('.group').hide();
|
49 |
$(clicked_group).fadeIn();
|
@@ -88,4 +88,4 @@ jQuery(document).ready(function($) {
|
|
88 |
$('.of-radio-img-img').show();
|
89 |
$('.of-radio-img-radio').hide();
|
90 |
|
91 |
-
});
|
12 |
|
13 |
// Switches option sections
|
14 |
$('.group').hide();
|
15 |
+
var active_tab = '';
|
16 |
if (typeof(localStorage) != 'undefined' ) {
|
17 |
+
active_tab = localStorage.getItem("active_tab");
|
18 |
}
|
19 |
+
if (active_tab != '' && $(active_tab).length ) {
|
20 |
+
$(active_tab).fadeIn();
|
21 |
} else {
|
22 |
$('.group:first').fadeIn();
|
23 |
}
|
31 |
$(this).filter('.hidden').removeClass('hidden');
|
32 |
});
|
33 |
});
|
34 |
+
if (active_tab != '' && $(active_tab + '-tab').length ) {
|
35 |
+
$(active_tab + '-tab').addClass('nav-tab-active');
|
|
|
36 |
}
|
37 |
else {
|
38 |
$('.nav-tab-wrapper a:first').addClass('nav-tab-active');
|
39 |
}
|
40 |
+
|
41 |
$('.nav-tab-wrapper a').click(function(evt) {
|
42 |
$('.nav-tab-wrapper a').removeClass('nav-tab-active');
|
43 |
$(this).addClass('nav-tab-active').blur();
|
44 |
var clicked_group = $(this).attr('href');
|
45 |
if (typeof(localStorage) != 'undefined' ) {
|
46 |
+
localStorage.setItem("active_tab", $(this).attr('href'));
|
47 |
}
|
48 |
$('.group').hide();
|
49 |
$(clicked_group).fadeIn();
|
88 |
$('.of-radio-img-img').show();
|
89 |
$('.of-radio-img-radio').hide();
|
90 |
|
91 |
+
});
|
lang/{options-framework-hu.po → options-framework-hu_HU.po}
RENAMED
File without changes
|
lang/optionsframework-it_IT.mo
ADDED
Binary file
|
lang/optionsframework-it_IT.po
ADDED
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Options Framework Plugin\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-04-22 19:13-0300\n"
|
6 |
+
"PO-Revision-Date: 2012-12-08 17:55+0100\n"
|
7 |
+
"Last-Translator: Andrea Bersi\n"
|
8 |
+
"Language-Team: Matt Varone <contact@mattvarone.com>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;_x;__;esc_attr_e\n"
|
13 |
+
"X-Poedit-Basepath: ../\n"
|
14 |
+
"X-Poedit-Language: Spanish\n"
|
15 |
+
"X-Poedit-SearchPath-0: .\n"
|
16 |
+
|
17 |
+
#: options-framework.php:71
|
18 |
+
#, php-format
|
19 |
+
msgid "Your current theme does not have support for the Options Framework plugin. <a href=\"%1$s\" target=\"_blank\">Learn More</a> | <a href=\"%2$s\">Hide Notice</a>"
|
20 |
+
msgstr "SIl tema corrente non supporta Options Framework. <a href=\"%1$s\" target=\"_blank\">Leggi info</a> | <a href=\"%2$s\">Nascondi avviso</a>"
|
21 |
+
|
22 |
+
#: options-framework.php:254
|
23 |
+
#: options-framework.php:456
|
24 |
+
msgid "Theme Options"
|
25 |
+
msgstr "Opzioni tema"
|
26 |
+
|
27 |
+
#: options-framework.php:323
|
28 |
+
msgid "Save Options"
|
29 |
+
msgstr "Salva Opzioni"
|
30 |
+
|
31 |
+
#: options-framework.php:324
|
32 |
+
msgid "Restore Defaults"
|
33 |
+
msgstr "Ripristina default"
|
34 |
+
|
35 |
+
#: options-framework.php:324
|
36 |
+
msgid "Click OK to reset. Any theme settings will be lost!"
|
37 |
+
msgstr "Clicca su OK. Tutte le impostazioni verranno perse!"
|
38 |
+
|
39 |
+
#: options-framework.php:358
|
40 |
+
msgid "Default options restored."
|
41 |
+
msgstr "Impostazioni default ripristinate."
|
42 |
+
|
43 |
+
#: options-framework.php:400
|
44 |
+
msgid "Options saved."
|
45 |
+
msgstr "Opzioni salvate."
|
46 |
+
|
47 |
+
#: options-medialibrary-uploader.php:26
|
48 |
+
msgid "Options Framework Internal Container"
|
49 |
+
msgstr "Options Framework contenitore interno"
|
50 |
+
|
51 |
+
#: options-medialibrary-uploader.php:128
|
52 |
+
msgid "Upload"
|
53 |
+
msgstr "Upload"
|
54 |
+
|
55 |
+
#: options-medialibrary-uploader.php:151
|
56 |
+
msgid "View File"
|
57 |
+
msgstr "Vedi file"
|
58 |
+
|
59 |
+
#: options-medialibrary-uploader.php:288
|
60 |
+
msgid "Gallery"
|
61 |
+
msgstr "Galleria"
|
62 |
+
|
63 |
+
#: options-medialibrary-uploader.php:288
|
64 |
+
msgid "Previously Uploaded"
|
65 |
+
msgstr "caricato in precedenza"
|
66 |
+
|
67 |
+
#: options-sanitize.php:232
|
68 |
+
msgid "No Repeat"
|
69 |
+
msgstr "Non ripetere"
|
70 |
+
|
71 |
+
#: options-sanitize.php:233
|
72 |
+
msgid "Repeat Horizontally"
|
73 |
+
msgstr "Ripeti orizzontalmente"
|
74 |
+
|
75 |
+
#: options-sanitize.php:234
|
76 |
+
msgid "Repeat Vertically"
|
77 |
+
msgstr "Ripeti verticalmente"
|
78 |
+
|
79 |
+
#: options-sanitize.php:235
|
80 |
+
msgid "Repeat All"
|
81 |
+
msgstr "Ripeti tutto"
|
82 |
+
|
83 |
+
#: options-sanitize.php:248
|
84 |
+
msgid "Top Left"
|
85 |
+
msgstr "Alto sinistra"
|
86 |
+
|
87 |
+
#: options-sanitize.php:249
|
88 |
+
msgid "Top Center"
|
89 |
+
msgstr "Alto centro"
|
90 |
+
|
91 |
+
#: options-sanitize.php:250
|
92 |
+
msgid "Top Right"
|
93 |
+
msgstr "Alto destra"
|
94 |
+
|
95 |
+
#: options-sanitize.php:251
|
96 |
+
msgid "Middle Left"
|
97 |
+
msgstr "Centro sinistra"
|
98 |
+
|
99 |
+
#: options-sanitize.php:252
|
100 |
+
msgid "Middle Center"
|
101 |
+
msgstr "Allineato al centro"
|
102 |
+
|
103 |
+
#: options-sanitize.php:253
|
104 |
+
msgid "Middle Right"
|
105 |
+
msgstr "Centro destra"
|
106 |
+
|
107 |
+
#: options-sanitize.php:254
|
108 |
+
msgid "Bottom Left"
|
109 |
+
msgstr "Basso sinistra"
|
110 |
+
|
111 |
+
#: options-sanitize.php:255
|
112 |
+
msgid "Bottom Center"
|
113 |
+
msgstr "Basso centro"
|
114 |
+
|
115 |
+
#: options-sanitize.php:256
|
116 |
+
msgid "Bottom Right"
|
117 |
+
msgstr "Basso destra"
|
118 |
+
|
119 |
+
#: options-sanitize.php:269
|
120 |
+
msgid "Scroll Normally"
|
121 |
+
msgstr "Scrolla normalmente"
|
122 |
+
|
123 |
+
#: options-sanitize.php:270
|
124 |
+
msgid "Fixed in Place"
|
125 |
+
msgstr "Blocca nella posizione"
|
126 |
+
|
127 |
+
#: options-sanitize.php:344
|
128 |
+
msgid "Normal"
|
129 |
+
msgstr "Normalw"
|
130 |
+
|
131 |
+
#: options-sanitize.php:345
|
132 |
+
msgid "Italic"
|
133 |
+
msgstr "Italico"
|
134 |
+
|
135 |
+
#: options-sanitize.php:346
|
136 |
+
msgid "Bold"
|
137 |
+
msgstr "Grassetto"
|
138 |
+
|
139 |
+
#: options-sanitize.php:347
|
140 |
+
msgid "Bold Italic"
|
141 |
+
msgstr "Grassetto italico"
|
142 |
+
|
lang/optionsframework-ru_RU.mo
ADDED
Binary file
|
lang/optionsframework-ru_RU.po
ADDED
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Options Framework\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-04-22 15:51-0300\n"
|
6 |
+
"PO-Revision-Date: 2012-12-07 21:40+0400\n"
|
7 |
+
"Last-Translator: evgeny <work@verha.net>\n"
|
8 |
+
"Language-Team: Evgeny Vlasov <work@verha.net>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e;esc_attr_e\n"
|
13 |
+
"X-Poedit-Basepath: /Users/weslly/Desktop/options-framework-plugin\n"
|
14 |
+
"X-Poedit-Language: Russian\n"
|
15 |
+
"X-Poedit-Country: RUSSIAN FEDERATION\n"
|
16 |
+
"X-Poedit-SearchPath-0: .\n"
|
17 |
+
|
18 |
+
#: options-framework.php:71
|
19 |
+
#, php-format
|
20 |
+
msgid "Your current theme does not have support for the Options Framework plugin. <a href=\"%1$s\" target=\"_blank\">Learn More</a> | <a href=\"%2$s\">Hide Notice</a>"
|
21 |
+
msgstr "Ваша текущая тема не поддерживает плагин Options Framework. <a href=\"%1$s\" target=\"_blank\">Подробности</a> | <a href=\"%2$s\">Скрыть уведомление</a>"
|
22 |
+
|
23 |
+
#: options-framework.php:254
|
24 |
+
#: options-framework.php:456
|
25 |
+
msgid "Theme Options"
|
26 |
+
msgstr "Настройки темы"
|
27 |
+
|
28 |
+
#: options-framework.php:323
|
29 |
+
msgid "Save Options"
|
30 |
+
msgstr "Сохранить настройки"
|
31 |
+
|
32 |
+
#: options-framework.php:324
|
33 |
+
msgid "Restore Defaults"
|
34 |
+
msgstr "Восстановить значения по умолчанию"
|
35 |
+
|
36 |
+
#: options-framework.php:324
|
37 |
+
msgid "Click OK to reset. Any theme settings will be lost!"
|
38 |
+
msgstr "Нажмите ОК для сброса настроек. Произведнные ранее настройки темы будут удалены."
|
39 |
+
|
40 |
+
#: options-framework.php:358
|
41 |
+
msgid "Default options restored."
|
42 |
+
msgstr "Значения по умолчанию восстановлены."
|
43 |
+
|
44 |
+
#: options-framework.php:400
|
45 |
+
msgid "Options saved."
|
46 |
+
msgstr "Настройки сохранены."
|
47 |
+
|
48 |
+
#: options-medialibrary-uploader.php:26
|
49 |
+
msgid "Options Framework Internal Container"
|
50 |
+
msgstr "Внутренний контейнер Options Framework"
|
51 |
+
|
52 |
+
#: options-medialibrary-uploader.php:128
|
53 |
+
msgid "Upload"
|
54 |
+
msgstr "Обзор"
|
55 |
+
|
56 |
+
#: options-medialibrary-uploader.php:151
|
57 |
+
msgid "View File"
|
58 |
+
msgstr "Просмотреть файл"
|
59 |
+
|
60 |
+
#: options-medialibrary-uploader.php:288
|
61 |
+
msgid "Gallery"
|
62 |
+
msgstr "Галерея"
|
63 |
+
|
64 |
+
#: options-medialibrary-uploader.php:288
|
65 |
+
msgid "Previously Uploaded"
|
66 |
+
msgstr "Ранее загруженный"
|
67 |
+
|
68 |
+
#: options-sanitize.php:232
|
69 |
+
msgid "No Repeat"
|
70 |
+
msgstr "Без повтора"
|
71 |
+
|
72 |
+
#: options-sanitize.php:233
|
73 |
+
msgid "Repeat Horizontally"
|
74 |
+
msgstr "Повторить по горизонтали"
|
75 |
+
|
76 |
+
#: options-sanitize.php:234
|
77 |
+
msgid "Repeat Vertically"
|
78 |
+
msgstr "Повторить по вертикали"
|
79 |
+
|
80 |
+
#: options-sanitize.php:235
|
81 |
+
msgid "Repeat All"
|
82 |
+
msgstr "Повторить во всех направлениях"
|
83 |
+
|
84 |
+
#: options-sanitize.php:248
|
85 |
+
msgid "Top Left"
|
86 |
+
msgstr "Сверху слева"
|
87 |
+
|
88 |
+
#: options-sanitize.php:249
|
89 |
+
msgid "Top Center"
|
90 |
+
msgstr "Сверху по центру"
|
91 |
+
|
92 |
+
#: options-sanitize.php:250
|
93 |
+
msgid "Top Right"
|
94 |
+
msgstr "Сверху справа"
|
95 |
+
|
96 |
+
#: options-sanitize.php:251
|
97 |
+
msgid "Middle Left"
|
98 |
+
msgstr "По центру слева"
|
99 |
+
|
100 |
+
#: options-sanitize.php:252
|
101 |
+
msgid "Middle Center"
|
102 |
+
msgstr "Центровать по горизонтали и вертикали"
|
103 |
+
|
104 |
+
#: options-sanitize.php:253
|
105 |
+
msgid "Middle Right"
|
106 |
+
msgstr "По центру справа"
|
107 |
+
|
108 |
+
#: options-sanitize.php:254
|
109 |
+
msgid "Bottom Left"
|
110 |
+
msgstr "Снизу слева"
|
111 |
+
|
112 |
+
#: options-sanitize.php:255
|
113 |
+
msgid "Bottom Center"
|
114 |
+
msgstr "Снизу по центру"
|
115 |
+
|
116 |
+
#: options-sanitize.php:256
|
117 |
+
msgid "Bottom Right"
|
118 |
+
msgstr "Снизу справа"
|
119 |
+
|
120 |
+
#: options-sanitize.php:269
|
121 |
+
msgid "Scroll Normally"
|
122 |
+
msgstr "Обычное поведение"
|
123 |
+
|
124 |
+
#: options-sanitize.php:270
|
125 |
+
msgid "Fixed in Place"
|
126 |
+
msgstr "Фиксировать фон"
|
127 |
+
|
128 |
+
#: options-sanitize.php:344
|
129 |
+
msgid "Normal"
|
130 |
+
msgstr "Нормальный"
|
131 |
+
|
132 |
+
#: options-sanitize.php:345
|
133 |
+
msgid "Italic"
|
134 |
+
msgstr "Курсив"
|
135 |
+
|
136 |
+
#: options-sanitize.php:346
|
137 |
+
msgid "Bold"
|
138 |
+
msgstr "Полужирный"
|
139 |
+
|
140 |
+
#: options-sanitize.php:347
|
141 |
+
msgid "Bold Italic"
|
142 |
+
msgstr "Полужирный курсив"
|
143 |
+
|
lang/optionsframework-sv_SE.mo
ADDED
Binary file
|
lang/optionsframework-sv_SE.po
ADDED
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Options Framework 1.4\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-04-22 15:51-0300\n"
|
6 |
+
"PO-Revision-Date: 2012-12-20 08:33+0100\n"
|
7 |
+
"Last-Translator: Kjeell.se <digidocs@kjeell.se>\n"
|
8 |
+
"Language-Team: Kjeell.se <digidocs@kjeell.se>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.5.4\n"
|
13 |
+
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"Language: sv_SE\n"
|
16 |
+
|
17 |
+
#: options-framework.php:71
|
18 |
+
#, php-format
|
19 |
+
msgid ""
|
20 |
+
"Your current theme does not have support for the Options Framework plugin. "
|
21 |
+
"<a href=\"%1$s\" target=\"_blank\">Learn More</a> | <a href=\"%2$s\">Hide "
|
22 |
+
"Notice</a>"
|
23 |
+
msgstr ""
|
24 |
+
"Ditt nuvarande tema stödjer inte Options Framework Plugin. <a href=\"%1$s\" "
|
25 |
+
"target=\"_blank\">Mer information</a> | <a href=\"%2$s\">Dölj meddelande</a>"
|
26 |
+
|
27 |
+
#: options-framework.php:254 options-framework.php:456
|
28 |
+
msgid "Theme Options"
|
29 |
+
msgstr "Tema inställningar"
|
30 |
+
|
31 |
+
#: options-framework.php:323
|
32 |
+
msgid "Save Options"
|
33 |
+
msgstr "Spara Inställningar"
|
34 |
+
|
35 |
+
#: options-framework.php:324
|
36 |
+
msgid "Restore Defaults"
|
37 |
+
msgstr "Återställ standardinställningar"
|
38 |
+
|
39 |
+
#: options-framework.php:324
|
40 |
+
msgid "Click OK to reset. Any theme settings will be lost!"
|
41 |
+
msgstr ""
|
42 |
+
"Klicka OK för att återställa. Alla temainställningar kommer att gå förlorade!"
|
43 |
+
|
44 |
+
#: options-framework.php:358
|
45 |
+
msgid "Default options restored."
|
46 |
+
msgstr "Standardinställningar återställda."
|
47 |
+
|
48 |
+
#: options-framework.php:400
|
49 |
+
msgid "Options saved."
|
50 |
+
msgstr "Inställningar sparade."
|
51 |
+
|
52 |
+
#: options-medialibrary-uploader.php:26
|
53 |
+
msgid "Options Framework Internal Container"
|
54 |
+
msgstr "Options Framework internt"
|
55 |
+
|
56 |
+
#: options-medialibrary-uploader.php:128
|
57 |
+
msgid "Upload"
|
58 |
+
msgstr "Ladda upp"
|
59 |
+
|
60 |
+
#: options-medialibrary-uploader.php:151
|
61 |
+
msgid "View File"
|
62 |
+
msgstr "Visa fil"
|
63 |
+
|
64 |
+
#: options-medialibrary-uploader.php:288
|
65 |
+
msgid "Gallery"
|
66 |
+
msgstr "Galleri"
|
67 |
+
|
68 |
+
#: options-medialibrary-uploader.php:288
|
69 |
+
msgid "Previously Uploaded"
|
70 |
+
msgstr "Tidigare uppladdad"
|
71 |
+
|
72 |
+
#: options-sanitize.php:232
|
73 |
+
msgid "No Repeat"
|
74 |
+
msgstr "Upprepa inte"
|
75 |
+
|
76 |
+
#: options-sanitize.php:233
|
77 |
+
msgid "Repeat Horizontally"
|
78 |
+
msgstr "Upprepa horizontalt"
|
79 |
+
|
80 |
+
#: options-sanitize.php:234
|
81 |
+
msgid "Repeat Vertically"
|
82 |
+
msgstr "Upprepa vertikalt"
|
83 |
+
|
84 |
+
#: options-sanitize.php:235
|
85 |
+
msgid "Repeat All"
|
86 |
+
msgstr "Upprepa alla"
|
87 |
+
|
88 |
+
#: options-sanitize.php:248
|
89 |
+
msgid "Top Left"
|
90 |
+
msgstr "Vänster topp"
|
91 |
+
|
92 |
+
#: options-sanitize.php:249
|
93 |
+
msgid "Top Center"
|
94 |
+
msgstr "Centrerat topp"
|
95 |
+
|
96 |
+
#: options-sanitize.php:250
|
97 |
+
msgid "Top Right"
|
98 |
+
msgstr "Höger topp"
|
99 |
+
|
100 |
+
#: options-sanitize.php:251
|
101 |
+
msgid "Middle Left"
|
102 |
+
msgstr "Vänster Mitt"
|
103 |
+
|
104 |
+
#: options-sanitize.php:252
|
105 |
+
msgid "Middle Center"
|
106 |
+
msgstr "Centrerat Mitt"
|
107 |
+
|
108 |
+
#: options-sanitize.php:253
|
109 |
+
msgid "Middle Right"
|
110 |
+
msgstr "Höger Mitt"
|
111 |
+
|
112 |
+
#: options-sanitize.php:254
|
113 |
+
msgid "Bottom Left"
|
114 |
+
msgstr "Vänster nederkant"
|
115 |
+
|
116 |
+
#: options-sanitize.php:255
|
117 |
+
msgid "Bottom Center"
|
118 |
+
msgstr "Centrerad nederkant"
|
119 |
+
|
120 |
+
#: options-sanitize.php:256
|
121 |
+
msgid "Bottom Right"
|
122 |
+
msgstr "Höger nederkant"
|
123 |
+
|
124 |
+
#: options-sanitize.php:269
|
125 |
+
msgid "Scroll Normally"
|
126 |
+
msgstr "Scrolla normalt"
|
127 |
+
|
128 |
+
#: options-sanitize.php:270
|
129 |
+
msgid "Fixed in Place"
|
130 |
+
msgstr "Fixerad placering"
|
131 |
+
|
132 |
+
#: options-sanitize.php:344
|
133 |
+
msgid "Normal"
|
134 |
+
msgstr "Normal"
|
135 |
+
|
136 |
+
#: options-sanitize.php:345
|
137 |
+
msgid "Italic"
|
138 |
+
msgstr "Kursiv"
|
139 |
+
|
140 |
+
#: options-sanitize.php:346
|
141 |
+
msgid "Bold"
|
142 |
+
msgstr "Fet"
|
143 |
+
|
144 |
+
#: options-sanitize.php:347
|
145 |
+
msgid "Bold Italic"
|
146 |
+
msgstr "Fet Kursiv"
|
options-framework.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Options Framework
|
4 |
Plugin URI: http://www.wptheming.com
|
5 |
Description: A framework for building theme options.
|
6 |
-
Version: 1.
|
7 |
Author: Devin Price
|
8 |
Author URI: http://www.wptheming.com
|
9 |
License: GPLv2
|
@@ -27,8 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
27 |
|
28 |
/* Basic plugin definitions */
|
29 |
|
30 |
-
define('OPTIONS_FRAMEWORK_VERSION', '1.
|
31 |
-
define('OPTIONS_FRAMEWORK_URL', plugin_dir_url( __FILE__ ));
|
32 |
|
33 |
load_plugin_textdomain( 'optionsframework', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
|
34 |
|
@@ -41,29 +41,28 @@ if ( !function_exists( 'add_action' ) ) {
|
|
41 |
|
42 |
/* If the user can't edit theme options, no use running this plugin */
|
43 |
|
44 |
-
add_action('init', 'optionsframework_rolescheck' );
|
45 |
|
46 |
function optionsframework_rolescheck() {
|
47 |
if ( current_user_can( 'edit_theme_options' ) ) {
|
48 |
$options =& _optionsframework_options();
|
49 |
if ( $options ) {
|
50 |
// If the user can edit theme options, let the fun begin!
|
51 |
-
add_action( 'admin_menu', 'optionsframework_add_page');
|
52 |
add_action( 'admin_init', 'optionsframework_init' );
|
53 |
-
add_action( 'admin_init', 'optionsframework_mlu_init' );
|
54 |
add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
|
55 |
}
|
56 |
else {
|
57 |
// Display a notice if options aren't present in the theme
|
58 |
-
add_action('admin_notices', 'optionsframework_admin_notice');
|
59 |
-
add_action('admin_init', 'optionsframework_nag_ignore');
|
60 |
}
|
61 |
}
|
62 |
}
|
63 |
|
64 |
function optionsframework_admin_notice() {
|
65 |
global $pagenow;
|
66 |
-
if ( !is_multisite() && ( $pagenow == 'plugins.php' ||
|
67 |
global $current_user ;
|
68 |
$user_id = $current_user->ID;
|
69 |
if ( ! get_user_meta($user_id, 'optionsframework_ignore_notice') ) {
|
@@ -77,14 +76,14 @@ function optionsframework_admin_notice() {
|
|
77 |
function optionsframework_nag_ignore() {
|
78 |
global $current_user;
|
79 |
$user_id = $current_user->ID;
|
80 |
-
if ( isset($_GET['optionsframework_nag_ignore']) && '0' == $_GET['optionsframework_nag_ignore'] ) {
|
81 |
-
add_user_meta($user_id, 'optionsframework_ignore_notice', 'true', true);
|
82 |
}
|
83 |
}
|
84 |
|
85 |
/* Register plugin activation hooks */
|
86 |
|
87 |
-
register_activation_hook(__FILE__,'optionsframework_activation_hook');
|
88 |
|
89 |
function optionsframework_activation_hook() {
|
90 |
register_uninstall_hook( __FILE__, 'optionsframework_delete_options' );
|
@@ -96,22 +95,22 @@ register_uninstall_hook( __FILE__, 'optionsframework_delete_options' );
|
|
96 |
|
97 |
function optionsframework_delete_options() {
|
98 |
|
99 |
-
$optionsframework_settings = get_option('optionsframework');
|
100 |
|
101 |
// Each theme saves its data in a seperate option, which all gets deleted
|
102 |
$knownoptions = $optionsframework_settings['knownoptions'];
|
103 |
-
if ($knownoptions) {
|
104 |
-
foreach ($knownoptions as $key) {
|
105 |
-
delete_option($key);
|
106 |
}
|
107 |
}
|
108 |
-
delete_option('optionsframework');
|
109 |
-
delete_user_meta($user_id, 'optionsframework_ignore_notice', 'true');
|
110 |
}
|
111 |
|
112 |
/* Loads the file for option sanitization */
|
113 |
|
114 |
-
add_action('init', 'optionsframework_load_sanitization' );
|
115 |
|
116 |
function optionsframework_load_sanitization() {
|
117 |
require_once dirname( __FILE__ ) . '/options-sanitize.php';
|
@@ -136,7 +135,7 @@ function optionsframework_init() {
|
|
136 |
|
137 |
// Include the required files
|
138 |
require_once dirname( __FILE__ ) . '/options-interface.php';
|
139 |
-
require_once dirname( __FILE__ ) . '/options-
|
140 |
|
141 |
// Optionally Loads the options file from the theme
|
142 |
$location = apply_filters( 'options_framework_location', array('options.php') );
|
@@ -144,6 +143,11 @@ function optionsframework_init() {
|
|
144 |
|
145 |
// Load settings
|
146 |
$optionsframework_settings = get_option( 'optionsframework' );
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
// Updates the unique option id in the database if it has changed
|
149 |
if ( function_exists( 'optionsframework_option_name' ) ) {
|
@@ -206,7 +210,7 @@ function optionsframework_page_capability( $capability ) {
|
|
206 |
|
207 |
function optionsframework_setdefaults() {
|
208 |
|
209 |
-
$optionsframework_settings = get_option('optionsframework');
|
210 |
|
211 |
// Gets the unique option id
|
212 |
$option_name = $optionsframework_settings['id'];
|
@@ -219,12 +223,12 @@ function optionsframework_setdefaults() {
|
|
219 |
*
|
220 |
*/
|
221 |
|
222 |
-
if ( isset($optionsframework_settings['knownoptions']) ) {
|
223 |
$knownoptions = $optionsframework_settings['knownoptions'];
|
224 |
if ( !in_array($option_name, $knownoptions) ) {
|
225 |
array_push( $knownoptions, $option_name );
|
226 |
$optionsframework_settings['knownoptions'] = $knownoptions;
|
227 |
-
update_option('optionsframework', $optionsframework_settings);
|
228 |
}
|
229 |
} else {
|
230 |
$newoptionname = array($option_name);
|
@@ -248,10 +252,11 @@ function optionsframework_setdefaults() {
|
|
248 |
if ( !function_exists( 'optionsframework_add_page' ) ) {
|
249 |
|
250 |
function optionsframework_add_page() {
|
251 |
-
$of_page = add_theme_page(__('Theme Options', 'optionsframework'), __('Theme Options', 'optionsframework'), 'edit_theme_options', 'options-framework','optionsframework_page');
|
252 |
|
253 |
// Load the required CSS and javscript
|
254 |
-
add_action('admin_enqueue_scripts', 'optionsframework_load_scripts');
|
|
|
255 |
add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' );
|
256 |
}
|
257 |
|
@@ -260,7 +265,7 @@ if ( !function_exists( 'optionsframework_add_page' ) ) {
|
|
260 |
/* Loads the CSS */
|
261 |
|
262 |
function optionsframework_load_styles() {
|
263 |
-
wp_enqueue_style('optionsframework', OPTIONS_FRAMEWORK_URL.'css/optionsframework.css');
|
264 |
if ( !wp_style_is( 'wp-color-picker','registered' ) ) {
|
265 |
wp_register_style('wp-color-picker', OPTIONS_FRAMEWORK_URL.'css/color-picker.min.css');
|
266 |
}
|
@@ -274,9 +279,7 @@ function optionsframework_load_scripts($hook) {
|
|
274 |
if ( 'appearance_page_options-framework' != $hook )
|
275 |
return;
|
276 |
|
277 |
-
// Enqueue colorpicker scripts for versions below 3.5
|
278 |
-
// for compatibility
|
279 |
-
|
280 |
if ( !wp_script_is( 'wp-color-picker', 'registered' ) ) {
|
281 |
wp_register_script( 'iris', OPTIONS_FRAMEWORK_URL . 'js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
|
282 |
wp_register_script( 'wp-color-picker', OPTIONS_FRAMEWORK_URL . 'js/color-picker.min.js', array( 'jquery', 'iris' ) );
|
@@ -325,7 +328,7 @@ function optionsframework_page() {
|
|
325 |
<div id="optionsframework-metabox" class="metabox-holder">
|
326 |
<div id="optionsframework" class="postbox">
|
327 |
<form action="options.php" method="post">
|
328 |
-
<?php settings_fields('optionsframework'); ?>
|
329 |
<?php optionsframework_fields(); /* Settings */ ?>
|
330 |
<div id="optionsframework-submit">
|
331 |
<input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options', 'optionsframework' ); ?>" />
|
@@ -335,7 +338,7 @@ function optionsframework_page() {
|
|
335 |
</form>
|
336 |
</div> <!-- / #container -->
|
337 |
</div>
|
338 |
-
<?php do_action('optionsframework_after'); ?>
|
339 |
</div> <!-- / .wrap -->
|
340 |
|
341 |
<?php
|
@@ -470,15 +473,15 @@ function optionsframework_adminbar() {
|
|
470 |
));
|
471 |
}
|
472 |
|
473 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
474 |
|
475 |
-
|
476 |
-
* Get Option.
|
477 |
-
*
|
478 |
-
* Helper function to return the theme option value.
|
479 |
-
* If no value has been saved, it returns $default.
|
480 |
-
* Needed because options are saved as serialized strings.
|
481 |
-
*/
|
482 |
|
483 |
function of_get_option( $name, $default = false ) {
|
484 |
$config = get_option( 'optionsframework' );
|
@@ -495,6 +498,7 @@ if ( ! function_exists( 'of_get_option' ) ) :
|
|
495 |
|
496 |
return $default;
|
497 |
}
|
|
|
498 |
endif;
|
499 |
|
500 |
/**
|
@@ -530,14 +534,14 @@ endif;
|
|
530 |
function &_optionsframework_options() {
|
531 |
static $options = null;
|
532 |
|
533 |
-
if (!$options) {
|
534 |
// Load options from options.php file (if it exists)
|
535 |
$location = apply_filters( 'options_framework_location', array('options.php') );
|
536 |
if ( $optionsfile = locate_template( $location ) ) {
|
537 |
$maybe_options = require_once $optionsfile;
|
538 |
if (is_array($maybe_options)) {
|
539 |
$options = $maybe_options;
|
540 |
-
} else if (function_exists('optionsframework_options')) {
|
541 |
$options = optionsframework_options();
|
542 |
}
|
543 |
}
|
3 |
Plugin Name: Options Framework
|
4 |
Plugin URI: http://www.wptheming.com
|
5 |
Description: A framework for building theme options.
|
6 |
+
Version: 1.5
|
7 |
Author: Devin Price
|
8 |
Author URI: http://www.wptheming.com
|
9 |
License: GPLv2
|
27 |
|
28 |
/* Basic plugin definitions */
|
29 |
|
30 |
+
define( 'OPTIONS_FRAMEWORK_VERSION', '1.5' );
|
31 |
+
define( 'OPTIONS_FRAMEWORK_URL', plugin_dir_url( __FILE__ ) );
|
32 |
|
33 |
load_plugin_textdomain( 'optionsframework', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
|
34 |
|
41 |
|
42 |
/* If the user can't edit theme options, no use running this plugin */
|
43 |
|
44 |
+
add_action( 'init', 'optionsframework_rolescheck', 20 );
|
45 |
|
46 |
function optionsframework_rolescheck() {
|
47 |
if ( current_user_can( 'edit_theme_options' ) ) {
|
48 |
$options =& _optionsframework_options();
|
49 |
if ( $options ) {
|
50 |
// If the user can edit theme options, let the fun begin!
|
51 |
+
add_action( 'admin_menu', 'optionsframework_add_page' );
|
52 |
add_action( 'admin_init', 'optionsframework_init' );
|
|
|
53 |
add_action( 'wp_before_admin_bar_render', 'optionsframework_adminbar' );
|
54 |
}
|
55 |
else {
|
56 |
// Display a notice if options aren't present in the theme
|
57 |
+
add_action( 'admin_notices', 'optionsframework_admin_notice' );
|
58 |
+
add_action( 'admin_init', 'optionsframework_nag_ignore' );
|
59 |
}
|
60 |
}
|
61 |
}
|
62 |
|
63 |
function optionsframework_admin_notice() {
|
64 |
global $pagenow;
|
65 |
+
if ( !is_multisite() && ( $pagenow == 'plugins.php' || $pagenow == 'themes.php' ) ) {
|
66 |
global $current_user ;
|
67 |
$user_id = $current_user->ID;
|
68 |
if ( ! get_user_meta($user_id, 'optionsframework_ignore_notice') ) {
|
76 |
function optionsframework_nag_ignore() {
|
77 |
global $current_user;
|
78 |
$user_id = $current_user->ID;
|
79 |
+
if ( isset( $_GET['optionsframework_nag_ignore'] ) && '0' == $_GET['optionsframework_nag_ignore'] ) {
|
80 |
+
add_user_meta( $user_id, 'optionsframework_ignore_notice', 'true', true );
|
81 |
}
|
82 |
}
|
83 |
|
84 |
/* Register plugin activation hooks */
|
85 |
|
86 |
+
register_activation_hook( __FILE__,'optionsframework_activation_hook' );
|
87 |
|
88 |
function optionsframework_activation_hook() {
|
89 |
register_uninstall_hook( __FILE__, 'optionsframework_delete_options' );
|
95 |
|
96 |
function optionsframework_delete_options() {
|
97 |
|
98 |
+
$optionsframework_settings = get_option( 'optionsframework' );
|
99 |
|
100 |
// Each theme saves its data in a seperate option, which all gets deleted
|
101 |
$knownoptions = $optionsframework_settings['knownoptions'];
|
102 |
+
if ( $knownoptions ) {
|
103 |
+
foreach ( $knownoptions as $key ) {
|
104 |
+
delete_option( $key );
|
105 |
}
|
106 |
}
|
107 |
+
delete_option( 'optionsframework' );
|
108 |
+
delete_user_meta( $user_id, 'optionsframework_ignore_notice', 'true' );
|
109 |
}
|
110 |
|
111 |
/* Loads the file for option sanitization */
|
112 |
|
113 |
+
add_action( 'init', 'optionsframework_load_sanitization' );
|
114 |
|
115 |
function optionsframework_load_sanitization() {
|
116 |
require_once dirname( __FILE__ ) . '/options-sanitize.php';
|
135 |
|
136 |
// Include the required files
|
137 |
require_once dirname( __FILE__ ) . '/options-interface.php';
|
138 |
+
require_once dirname( __FILE__ ) . '/options-media-uploader.php';
|
139 |
|
140 |
// Optionally Loads the options file from the theme
|
141 |
$location = apply_filters( 'options_framework_location', array('options.php') );
|
143 |
|
144 |
// Load settings
|
145 |
$optionsframework_settings = get_option( 'optionsframework' );
|
146 |
+
|
147 |
+
if ( $optionsframework_settings && !isset($optionsframework_settings['version']) ) {
|
148 |
+
require_once dirname( __FILE__ ) . '/upgrade.php';
|
149 |
+
optionsframework_upgrade_routine();
|
150 |
+
}
|
151 |
|
152 |
// Updates the unique option id in the database if it has changed
|
153 |
if ( function_exists( 'optionsframework_option_name' ) ) {
|
210 |
|
211 |
function optionsframework_setdefaults() {
|
212 |
|
213 |
+
$optionsframework_settings = get_option( 'optionsframework' );
|
214 |
|
215 |
// Gets the unique option id
|
216 |
$option_name = $optionsframework_settings['id'];
|
223 |
*
|
224 |
*/
|
225 |
|
226 |
+
if ( isset( $optionsframework_settings['knownoptions'] ) ) {
|
227 |
$knownoptions = $optionsframework_settings['knownoptions'];
|
228 |
if ( !in_array($option_name, $knownoptions) ) {
|
229 |
array_push( $knownoptions, $option_name );
|
230 |
$optionsframework_settings['knownoptions'] = $knownoptions;
|
231 |
+
update_option( 'optionsframework', $optionsframework_settings);
|
232 |
}
|
233 |
} else {
|
234 |
$newoptionname = array($option_name);
|
252 |
if ( !function_exists( 'optionsframework_add_page' ) ) {
|
253 |
|
254 |
function optionsframework_add_page() {
|
255 |
+
$of_page = add_theme_page( __( 'Theme Options', 'optionsframework'), __('Theme Options', 'optionsframework'), 'edit_theme_options', 'options-framework','optionsframework_page' );
|
256 |
|
257 |
// Load the required CSS and javscript
|
258 |
+
add_action( 'admin_enqueue_scripts', 'optionsframework_load_scripts');
|
259 |
+
add_action( 'admin_enqueue_scripts', 'optionsframework_media_scripts');
|
260 |
add_action( 'admin_print_styles-' . $of_page, 'optionsframework_load_styles' );
|
261 |
}
|
262 |
|
265 |
/* Loads the CSS */
|
266 |
|
267 |
function optionsframework_load_styles() {
|
268 |
+
wp_enqueue_style( 'optionsframework', OPTIONS_FRAMEWORK_URL.'css/optionsframework.css' );
|
269 |
if ( !wp_style_is( 'wp-color-picker','registered' ) ) {
|
270 |
wp_register_style('wp-color-picker', OPTIONS_FRAMEWORK_URL.'css/color-picker.min.css');
|
271 |
}
|
279 |
if ( 'appearance_page_options-framework' != $hook )
|
280 |
return;
|
281 |
|
282 |
+
// Enqueue colorpicker scripts for versions below 3.5 for compatibility
|
|
|
|
|
283 |
if ( !wp_script_is( 'wp-color-picker', 'registered' ) ) {
|
284 |
wp_register_script( 'iris', OPTIONS_FRAMEWORK_URL . 'js/iris.min.js', array( 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ), false, 1 );
|
285 |
wp_register_script( 'wp-color-picker', OPTIONS_FRAMEWORK_URL . 'js/color-picker.min.js', array( 'jquery', 'iris' ) );
|
328 |
<div id="optionsframework-metabox" class="metabox-holder">
|
329 |
<div id="optionsframework" class="postbox">
|
330 |
<form action="options.php" method="post">
|
331 |
+
<?php settings_fields( 'optionsframework' ); ?>
|
332 |
<?php optionsframework_fields(); /* Settings */ ?>
|
333 |
<div id="optionsframework-submit">
|
334 |
<input type="submit" class="button-primary" name="update" value="<?php esc_attr_e( 'Save Options', 'optionsframework' ); ?>" />
|
338 |
</form>
|
339 |
</div> <!-- / #container -->
|
340 |
</div>
|
341 |
+
<?php do_action( 'optionsframework_after' ); ?>
|
342 |
</div> <!-- / .wrap -->
|
343 |
|
344 |
<?php
|
473 |
));
|
474 |
}
|
475 |
|
476 |
+
/**
|
477 |
+
* Get Option.
|
478 |
+
*
|
479 |
+
* Helper function to return the theme option value.
|
480 |
+
* If no value has been saved, it returns $default.
|
481 |
+
* Needed because options are saved as serialized strings.
|
482 |
+
*/
|
483 |
|
484 |
+
if ( ! function_exists( 'of_get_option' ) ) :
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
|
486 |
function of_get_option( $name, $default = false ) {
|
487 |
$config = get_option( 'optionsframework' );
|
498 |
|
499 |
return $default;
|
500 |
}
|
501 |
+
|
502 |
endif;
|
503 |
|
504 |
/**
|
534 |
function &_optionsframework_options() {
|
535 |
static $options = null;
|
536 |
|
537 |
+
if ( !$options ) {
|
538 |
// Load options from options.php file (if it exists)
|
539 |
$location = apply_filters( 'options_framework_location', array('options.php') );
|
540 |
if ( $optionsfile = locate_template( $location ) ) {
|
541 |
$maybe_options = require_once $optionsfile;
|
542 |
if (is_array($maybe_options)) {
|
543 |
$options = $maybe_options;
|
544 |
+
} else if ( function_exists( 'optionsframework_options' ) ) {
|
545 |
$options = optionsframework_options();
|
546 |
}
|
547 |
}
|
options-interface.php
CHANGED
@@ -6,18 +6,17 @@
|
|
6 |
|
7 |
function optionsframework_tabs() {
|
8 |
$counter = 0;
|
9 |
-
$
|
10 |
-
$options =& _optionsframework_options();
|
11 |
$menu = '';
|
12 |
|
13 |
-
foreach ($options as $value) {
|
14 |
-
$counter++;
|
15 |
// Heading for Navigation
|
16 |
-
if ($value['type'] == "heading") {
|
17 |
-
$
|
18 |
-
$
|
19 |
-
$
|
20 |
-
$
|
|
|
21 |
}
|
22 |
}
|
23 |
|
@@ -31,7 +30,7 @@ function optionsframework_tabs() {
|
|
31 |
function optionsframework_fields() {
|
32 |
|
33 |
global $allowedtags;
|
34 |
-
$optionsframework_settings = get_option('optionsframework');
|
35 |
|
36 |
// Gets the unique option id
|
37 |
if ( isset( $optionsframework_settings['id'] ) ) {
|
@@ -49,7 +48,6 @@ function optionsframework_fields() {
|
|
49 |
|
50 |
foreach ( $options as $value ) {
|
51 |
|
52 |
-
$counter++;
|
53 |
$val = '';
|
54 |
$select_value = '';
|
55 |
$checked = '';
|
@@ -63,7 +61,7 @@ function optionsframework_fields() {
|
|
63 |
|
64 |
$id = 'section-' . $value['id'];
|
65 |
|
66 |
-
$class = 'section
|
67 |
if ( isset( $value['type'] ) ) {
|
68 |
$class .= ' section-' . $value['type'];
|
69 |
}
|
@@ -211,7 +209,8 @@ function optionsframework_fields() {
|
|
211 |
|
212 |
// Uploader
|
213 |
case "upload":
|
214 |
-
$output .=
|
|
|
215 |
break;
|
216 |
|
217 |
// Typography
|
@@ -294,18 +293,19 @@ function optionsframework_fields() {
|
|
294 |
|
295 |
// Background Color
|
296 |
$default_color = '';
|
297 |
-
if ( isset($value['std']['color']) ) {
|
298 |
if ( $val != $value['std']['color'] )
|
299 |
$default_color = ' data-default-color="' .$value['std']['color'] . '" ';
|
300 |
}
|
301 |
$output .= '<input name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" class="of-color of-background-color" type="text" value="' . esc_attr( $background['color'] ) . '"' . $default_color .' />';
|
302 |
|
303 |
-
// Background Image
|
304 |
-
if (!isset($background['image'])) {
|
305 |
$background['image'] = '';
|
306 |
}
|
307 |
-
|
308 |
-
$output .=
|
|
|
309 |
$class = 'of-background-properties';
|
310 |
if ( '' == $background['image'] ) {
|
311 |
$class .= ' hide';
|
@@ -387,16 +387,16 @@ function optionsframework_fields() {
|
|
387 |
|
388 |
// Heading for Navigation
|
389 |
case "heading":
|
390 |
-
|
|
|
391 |
$output .= '</div>'."\n";
|
392 |
}
|
393 |
-
$
|
394 |
-
$
|
395 |
-
$
|
396 |
-
$output .= '<div
|
397 |
$output .= '<h3>' . esc_html( $value['name'] ) . '</h3>' . "\n";
|
398 |
break;
|
399 |
-
|
400 |
}
|
401 |
|
402 |
if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) {
|
6 |
|
7 |
function optionsframework_tabs() {
|
8 |
$counter = 0;
|
9 |
+
$options = optionsframework_options();
|
|
|
10 |
$menu = '';
|
11 |
|
12 |
+
foreach ( $options as $value ) {
|
|
|
13 |
// Heading for Navigation
|
14 |
+
if ( $value['type'] == "heading" ) {
|
15 |
+
$counter++;
|
16 |
+
$class = '';
|
17 |
+
$class = ! empty( $value['id'] ) ? $value['id'] : $value['name'];
|
18 |
+
$class = preg_replace( '/[^a-zA-Z0-9._\-]/', '', strtolower($class) ) . '-tab';
|
19 |
+
$menu .= '<a id="options-group-'. $counter . '-tab" class="nav-tab ' . $class .'" title="' . esc_attr( $value['name'] ) . '" href="' . esc_attr( '#options-group-'. $counter ) . '">' . esc_html( $value['name'] ) . '</a>';
|
20 |
}
|
21 |
}
|
22 |
|
30 |
function optionsframework_fields() {
|
31 |
|
32 |
global $allowedtags;
|
33 |
+
$optionsframework_settings = get_option( 'optionsframework' );
|
34 |
|
35 |
// Gets the unique option id
|
36 |
if ( isset( $optionsframework_settings['id'] ) ) {
|
48 |
|
49 |
foreach ( $options as $value ) {
|
50 |
|
|
|
51 |
$val = '';
|
52 |
$select_value = '';
|
53 |
$checked = '';
|
61 |
|
62 |
$id = 'section-' . $value['id'];
|
63 |
|
64 |
+
$class = 'section';
|
65 |
if ( isset( $value['type'] ) ) {
|
66 |
$class .= ' section-' . $value['type'];
|
67 |
}
|
209 |
|
210 |
// Uploader
|
211 |
case "upload":
|
212 |
+
$output .= optionsframework_uploader( $value['id'], $val, null );
|
213 |
+
|
214 |
break;
|
215 |
|
216 |
// Typography
|
293 |
|
294 |
// Background Color
|
295 |
$default_color = '';
|
296 |
+
if ( isset( $value['std']['color'] ) ) {
|
297 |
if ( $val != $value['std']['color'] )
|
298 |
$default_color = ' data-default-color="' .$value['std']['color'] . '" ';
|
299 |
}
|
300 |
$output .= '<input name="' . esc_attr( $option_name . '[' . $value['id'] . '][color]' ) . '" id="' . esc_attr( $value['id'] . '_color' ) . '" class="of-color of-background-color" type="text" value="' . esc_attr( $background['color'] ) . '"' . $default_color .' />';
|
301 |
|
302 |
+
// Background Image
|
303 |
+
if ( !isset($background['image']) ) {
|
304 |
$background['image'] = '';
|
305 |
}
|
306 |
+
|
307 |
+
$output .= optionsframework_uploader( $value['id'], $background['image'], null, esc_attr( $option_name . '[' . $value['id'] . '][image]' ) );
|
308 |
+
|
309 |
$class = 'of-background-properties';
|
310 |
if ( '' == $background['image'] ) {
|
311 |
$class .= ' hide';
|
387 |
|
388 |
// Heading for Navigation
|
389 |
case "heading":
|
390 |
+
$counter++;
|
391 |
+
if ( $counter >= 2 ) {
|
392 |
$output .= '</div>'."\n";
|
393 |
}
|
394 |
+
$class = '';
|
395 |
+
$class = ! empty( $value['id'] ) ? $value['id'] : $value['name'];
|
396 |
+
$class = preg_replace('/[^a-zA-Z0-9._\-]/', '', strtolower($class) );
|
397 |
+
$output .= '<div id="options-group-' . $counter . '" class="group ' . $class . '">';
|
398 |
$output .= '<h3>' . esc_html( $value['name'] ) . '</h3>' . "\n";
|
399 |
break;
|
|
|
400 |
}
|
401 |
|
402 |
if ( ( $value['type'] != "heading" ) && ( $value['type'] != "info" ) ) {
|
options-media-uploader.php
ADDED
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Media Uploader Using the WordPress Media Library.
|
5 |
+
*
|
6 |
+
* Parameters:
|
7 |
+
* - string $_id - A token to identify this field (the name).
|
8 |
+
* - string $_value - The value of the field, if present.
|
9 |
+
* - string $_desc - An optional description of the field.
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
|
13 |
+
if ( ! function_exists( 'optionsframework_uploader' ) ) :
|
14 |
+
|
15 |
+
function optionsframework_uploader( $_id, $_value, $_desc = '', $_name = '' ) {
|
16 |
+
|
17 |
+
$optionsframework_settings = get_option( 'optionsframework' );
|
18 |
+
|
19 |
+
// Gets the unique option id
|
20 |
+
$option_name = $optionsframework_settings['id'];
|
21 |
+
|
22 |
+
$output = '';
|
23 |
+
$id = '';
|
24 |
+
$class = '';
|
25 |
+
$int = '';
|
26 |
+
$value = '';
|
27 |
+
$name = '';
|
28 |
+
|
29 |
+
$id = strip_tags( strtolower( $_id ) );
|
30 |
+
|
31 |
+
// If a value is passed and we don't have a stored value, use the value that's passed through.
|
32 |
+
if ( $_value != '' && $value == '' ) {
|
33 |
+
$value = $_value;
|
34 |
+
}
|
35 |
+
|
36 |
+
if ($_name != '') {
|
37 |
+
$name = $_name;
|
38 |
+
}
|
39 |
+
else {
|
40 |
+
$name = $option_name.'['.$id.']';
|
41 |
+
}
|
42 |
+
|
43 |
+
if ( $value ) {
|
44 |
+
$class = ' has-file';
|
45 |
+
}
|
46 |
+
$output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="'.$name.'" value="' . $value . '" placeholder="' . __('No file chosen', 'optionsframework') .'" />' . "\n";
|
47 |
+
if ( function_exists( 'wp_enqueue_media' ) ) {
|
48 |
+
if ( ( $value == '' ) ) {
|
49 |
+
$output .= '<input id="upload-' . $id . '" class="upload-button button" type="button" value="' . __( 'Upload', 'optionsframework' ) . '" />' . "\n";
|
50 |
+
} else {
|
51 |
+
$output .= '<input id="remove-' . $id . '" class="remove-file button" type="button" value="' . __( 'Remove', 'optionsframework' ) . '" />' . "\n";
|
52 |
+
}
|
53 |
+
} else {
|
54 |
+
$output .= '<p><i>' . __( 'Upgrade your version of WordPress for full media support.', 'optionsframework' ) . '</i></p>';
|
55 |
+
}
|
56 |
+
|
57 |
+
if ( $_desc != '' ) {
|
58 |
+
$output .= '<span class="of-metabox-desc">' . $_desc . '</span>' . "\n";
|
59 |
+
}
|
60 |
+
|
61 |
+
$output .= '<div class="screenshot" id="' . $id . '-image">' . "\n";
|
62 |
+
|
63 |
+
if ( $value != '' ) {
|
64 |
+
$remove = '<a class="remove-image">Remove</a>';
|
65 |
+
$image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value );
|
66 |
+
if ( $image ) {
|
67 |
+
$output .= '<img src="' . $value . '" alt="" />' . $remove;
|
68 |
+
} else {
|
69 |
+
$parts = explode( "/", $value );
|
70 |
+
for( $i = 0; $i < sizeof( $parts ); ++$i ) {
|
71 |
+
$title = $parts[$i];
|
72 |
+
}
|
73 |
+
|
74 |
+
// No output preview if it's not an image.
|
75 |
+
$output .= '';
|
76 |
+
|
77 |
+
// Standard generic output if it's not an image.
|
78 |
+
$title = __( 'View File', 'optionsframework' );
|
79 |
+
$output .= '<div class="no-image"><span class="file_link"><a href="' . $value . '" target="_blank" rel="external">'.$title.'</a></span></div>';
|
80 |
+
}
|
81 |
+
}
|
82 |
+
$output .= '</div>' . "\n";
|
83 |
+
return $output;
|
84 |
+
}
|
85 |
+
|
86 |
+
endif;
|
87 |
+
|
88 |
+
/**
|
89 |
+
* Enqueue scripts for file uploader
|
90 |
+
*/
|
91 |
+
|
92 |
+
if ( ! function_exists( 'optionsframework_media_scripts' ) ) :
|
93 |
+
|
94 |
+
add_action( 'admin_enqueue_scripts', 'optionsframework_media_scripts' );
|
95 |
+
|
96 |
+
function optionsframework_media_scripts() {
|
97 |
+
if ( function_exists( 'wp_enqueue_media' ) )
|
98 |
+
wp_enqueue_media();
|
99 |
+
wp_register_script( 'of-media-uploader', OPTIONS_FRAMEWORK_URL .'js/media-uploader.js', array( 'jquery' ) );
|
100 |
+
wp_enqueue_script( 'of-media-uploader' );
|
101 |
+
wp_localize_script( 'of-media-uploader', 'optionsframework_l10n', array(
|
102 |
+
'upload' => __( 'Upload', 'optionsframework' ),
|
103 |
+
'remove' => __( 'Remove', 'optionsframework' )
|
104 |
+
) );
|
105 |
+
}
|
106 |
+
|
107 |
+
endif;
|
options-medialibrary-uploader.php
DELETED
@@ -1,286 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* WooThemes Media Library-driven AJAX File Uploader Module (2010-11-05)
|
5 |
-
*
|
6 |
-
* Slightly modified for use in the Options Framework.
|
7 |
-
*/
|
8 |
-
|
9 |
-
if ( is_admin() ) {
|
10 |
-
// Load additional css and js for image uploads on the Options Framework page
|
11 |
-
$of_page= 'appearance_page_options-framework';
|
12 |
-
add_action( "admin_print_styles-$of_page", 'optionsframework_mlu_css', 0 );
|
13 |
-
add_action( "admin_print_scripts-$of_page", 'optionsframework_mlu_js', 0 );
|
14 |
-
}
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Sets up a custom post type to attach image to. This allows us to have
|
18 |
-
* individual galleries for different uploaders.
|
19 |
-
*/
|
20 |
-
|
21 |
-
if ( ! function_exists( 'optionsframework_mlu_init' ) ) :
|
22 |
-
|
23 |
-
function optionsframework_mlu_init () {
|
24 |
-
register_post_type( 'optionsframework', array(
|
25 |
-
'labels' => array(
|
26 |
-
'name' => __( 'Theme Options Media', 'optionsframework' ),
|
27 |
-
),
|
28 |
-
'public' => true,
|
29 |
-
'show_ui' => false,
|
30 |
-
'capability_type' => 'post',
|
31 |
-
'hierarchical' => false,
|
32 |
-
'rewrite' => false,
|
33 |
-
'supports' => array( 'title', 'editor' ),
|
34 |
-
'query_var' => false,
|
35 |
-
'can_export' => true,
|
36 |
-
'show_in_nav_menus' => false,
|
37 |
-
'public' => false
|
38 |
-
) );
|
39 |
-
}
|
40 |
-
|
41 |
-
endif;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Adds the Thickbox CSS file and specific loading and button images to the header
|
45 |
-
* on the pages where this function is called.
|
46 |
-
*/
|
47 |
-
|
48 |
-
if ( ! function_exists( 'optionsframework_mlu_css' ) ) :
|
49 |
-
|
50 |
-
function optionsframework_mlu_css () {
|
51 |
-
$_html = '';
|
52 |
-
$_html .= '<link rel="stylesheet" href="' . site_url() . '/' . WPINC . '/js/thickbox/thickbox.css" type="text/css" media="screen" />' . "\n";
|
53 |
-
$_html .= '<script type="text/javascript">
|
54 |
-
var tb_pathToImage = "' . site_url() . '/' . WPINC . '/js/thickbox/loadingAnimation.gif";
|
55 |
-
var tb_closeImage = "' . site_url() . '/' . WPINC . '/js/thickbox/tb-close.png";
|
56 |
-
</script>' . "\n";
|
57 |
-
echo $_html;
|
58 |
-
}
|
59 |
-
|
60 |
-
endif;
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Registers and enqueues (loads) the necessary JavaScript file for working with the
|
64 |
-
* Media Library-driven AJAX File Uploader Module.
|
65 |
-
*/
|
66 |
-
|
67 |
-
if ( ! function_exists( 'optionsframework_mlu_js' ) ) :
|
68 |
-
|
69 |
-
function optionsframework_mlu_js () {
|
70 |
-
// Registers custom scripts for the Media Library AJAX uploader.
|
71 |
-
wp_register_script( 'of-medialibrary-uploader', OPTIONS_FRAMEWORK_URL .'js/of-medialibrary-uploader.js', array( 'jquery', 'thickbox' ) );
|
72 |
-
wp_enqueue_script( 'of-medialibrary-uploader' );
|
73 |
-
wp_enqueue_script( 'media-upload' );
|
74 |
-
}
|
75 |
-
|
76 |
-
endif;
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Media Uploader Using the WordPress Media Library.
|
80 |
-
*
|
81 |
-
* Parameters:
|
82 |
-
* - string $_id - A token to identify this field (the name).
|
83 |
-
* - string $_value - The value of the field, if present.
|
84 |
-
* - string $_mode - The display mode of the field.
|
85 |
-
* - string $_desc - An optional description of the field.
|
86 |
-
* - int $_postid - An optional post id (used in the meta boxes).
|
87 |
-
*
|
88 |
-
* Dependencies:
|
89 |
-
* - optionsframework_mlu_get_silentpost()
|
90 |
-
*/
|
91 |
-
|
92 |
-
if ( ! function_exists( 'optionsframework_medialibrary_uploader' ) ) :
|
93 |
-
|
94 |
-
function optionsframework_medialibrary_uploader( $_id, $_value, $_mode = 'full', $_desc = '', $_postid = 0, $_name = '') {
|
95 |
-
|
96 |
-
$optionsframework_settings = get_option('optionsframework');
|
97 |
-
|
98 |
-
// Gets the unique option id
|
99 |
-
$option_name = $optionsframework_settings['id'];
|
100 |
-
|
101 |
-
$output = '';
|
102 |
-
$id = '';
|
103 |
-
$class = '';
|
104 |
-
$int = '';
|
105 |
-
$value = '';
|
106 |
-
$name = '';
|
107 |
-
|
108 |
-
$id = strip_tags( strtolower( $_id ) );
|
109 |
-
// Change for each field, using a "silent" post. If no post is present, one will be created.
|
110 |
-
$int = optionsframework_mlu_get_silentpost( $id );
|
111 |
-
|
112 |
-
// If a value is passed and we don't have a stored value, use the value that's passed through.
|
113 |
-
if ( $_value != '' && $value == '' ) {
|
114 |
-
$value = $_value;
|
115 |
-
}
|
116 |
-
|
117 |
-
if ($_name != '') {
|
118 |
-
$name = $option_name.'['.$id.']['.$_name.']';
|
119 |
-
}
|
120 |
-
else {
|
121 |
-
$name = $option_name.'['.$id.']';
|
122 |
-
}
|
123 |
-
|
124 |
-
if ( $value ) { $class = ' has-file'; }
|
125 |
-
$output .= '<input id="' . $id . '" class="upload' . $class . '" type="text" name="'.$name.'" value="' . $value . '" />' . "\n";
|
126 |
-
$output .= '<input id="upload_' . $id . '" class="upload_button button" type="button" value="' . __( 'Upload', 'optionsframework' ) . '" rel="' . $int . '" />' . "\n";
|
127 |
-
|
128 |
-
if ( $_desc != '' ) {
|
129 |
-
$output .= '<span class="of_metabox_desc">' . $_desc . '</span>' . "\n";
|
130 |
-
}
|
131 |
-
|
132 |
-
$output .= '<div class="screenshot" id="' . $id . '_image">' . "\n";
|
133 |
-
|
134 |
-
if ( $value != '' ) {
|
135 |
-
$remove = '<a href="javascript:(void);" class="mlu_remove button">Remove</a>';
|
136 |
-
$image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $value );
|
137 |
-
if ( $image ) {
|
138 |
-
$output .= '<img src="' . $value . '" alt="" />'.$remove.'';
|
139 |
-
} else {
|
140 |
-
$parts = explode( "/", $value );
|
141 |
-
for( $i = 0; $i < sizeof( $parts ); ++$i ) {
|
142 |
-
$title = $parts[$i];
|
143 |
-
}
|
144 |
-
|
145 |
-
// No output preview if it's not an image.
|
146 |
-
$output .= '';
|
147 |
-
|
148 |
-
// Standard generic output if it's not an image.
|
149 |
-
$title = __( 'View File', 'optionsframework' );
|
150 |
-
$output .= '<div class="no_image"><span class="file_link"><a href="' . $value . '" target="_blank" rel="external">'.$title.'</a></span>' . $remove . '</div>';
|
151 |
-
}
|
152 |
-
}
|
153 |
-
$output .= '</div>' . "\n";
|
154 |
-
return $output;
|
155 |
-
}
|
156 |
-
|
157 |
-
endif;
|
158 |
-
|
159 |
-
/**
|
160 |
-
* Uses "silent" posts in the database to store relationships for images.
|
161 |
-
* This also creates the facility to collect galleries of, for example, logo images.
|
162 |
-
*
|
163 |
-
* Return: $_postid.
|
164 |
-
*
|
165 |
-
* If no "silent" post is present, one will be created with the type "optionsframework"
|
166 |
-
* and the post_name of "of-$_token".
|
167 |
-
*
|
168 |
-
* Example Usage:
|
169 |
-
* optionsframework_mlu_get_silentpost ( 'of_logo' );
|
170 |
-
*/
|
171 |
-
|
172 |
-
if ( ! function_exists( 'optionsframework_mlu_get_silentpost' ) ) :
|
173 |
-
|
174 |
-
function optionsframework_mlu_get_silentpost ( $_token ) {
|
175 |
-
|
176 |
-
global $wpdb;
|
177 |
-
$_id = 0;
|
178 |
-
|
179 |
-
// Check if the token is valid against a whitelist.
|
180 |
-
// $_whitelist = array( 'of_logo', 'of_custom_favicon', 'of_ad_top_image' );
|
181 |
-
// Sanitise the token.
|
182 |
-
|
183 |
-
$_token = strtolower( str_replace( ' ', '_', $_token ) );
|
184 |
-
|
185 |
-
// if ( in_array( $_token, $_whitelist ) ) {
|
186 |
-
if ( $_token ) {
|
187 |
-
|
188 |
-
// Tell the function what to look for in a post.
|
189 |
-
|
190 |
-
$_args = array( 'post_type' => 'optionsframework', 'post_name' => 'of-' . $_token, 'post_status' => 'draft', 'comment_status' => 'closed', 'ping_status' => 'closed' );
|
191 |
-
|
192 |
-
// Look in the database for a "silent" post that meets our criteria.
|
193 |
-
$query = 'SELECT ID FROM ' . $wpdb->posts . ' WHERE post_parent = 0';
|
194 |
-
foreach ( $_args as $k => $v ) {
|
195 |
-
$query .= ' AND ' . $k . ' = "' . $v . '"';
|
196 |
-
} // End FOREACH Loop
|
197 |
-
|
198 |
-
$query .= ' LIMIT 1';
|
199 |
-
$_posts = $wpdb->get_row( $query );
|
200 |
-
|
201 |
-
// If we've got a post, loop through and get it's ID.
|
202 |
-
if ( count( $_posts ) ) {
|
203 |
-
$_id = $_posts->ID;
|
204 |
-
} else {
|
205 |
-
|
206 |
-
// If no post is present, insert one.
|
207 |
-
// Prepare some additional data to go with the post insertion.
|
208 |
-
$_words = explode( '_', $_token );
|
209 |
-
$_title = join( ' ', $_words );
|
210 |
-
$_title = ucwords( $_title );
|
211 |
-
$_post_data = array( 'post_title' => $_title );
|
212 |
-
$_post_data = array_merge( $_post_data, $_args );
|
213 |
-
$_id = wp_insert_post( $_post_data );
|
214 |
-
}
|
215 |
-
}
|
216 |
-
return $_id;
|
217 |
-
}
|
218 |
-
endif;
|
219 |
-
|
220 |
-
/**
|
221 |
-
* Trigger code inside the Media Library popup.
|
222 |
-
*/
|
223 |
-
|
224 |
-
if ( ! function_exists( 'optionsframework_mlu_insidepopup' ) ) :
|
225 |
-
function optionsframework_mlu_insidepopup () {
|
226 |
-
if ( isset( $_REQUEST['is_optionsframework'] ) && $_REQUEST['is_optionsframework'] == 'yes' ) {
|
227 |
-
|
228 |
-
add_action( 'admin_head', 'optionsframework_mlu_js_popup' );
|
229 |
-
add_filter( 'media_upload_tabs', 'optionsframework_mlu_modify_tabs' );
|
230 |
-
}
|
231 |
-
}
|
232 |
-
|
233 |
-
endif;
|
234 |
-
|
235 |
-
if ( ! function_exists( 'optionsframework_mlu_js_popup' ) ) :
|
236 |
-
|
237 |
-
function optionsframework_mlu_js_popup () {
|
238 |
-
|
239 |
-
$_of_title = $_REQUEST['of_title'];
|
240 |
-
if ( ! $_of_title ) { $_of_title = 'file'; } // End IF Statement
|
241 |
-
?>
|
242 |
-
<script type="text/javascript">
|
243 |
-
jQuery(function($) {
|
244 |
-
|
245 |
-
jQuery.noConflict();
|
246 |
-
|
247 |
-
// Change the title of each tab to use the custom title text instead of "Media File".
|
248 |
-
$( 'h3.media-title' ).each ( function () {
|
249 |
-
var current_title = $( this ).html();
|
250 |
-
var new_title = current_title.replace( 'media file', '<?php echo $_of_title; ?>' );
|
251 |
-
$( this ).html( new_title );
|
252 |
-
|
253 |
-
} );
|
254 |
-
|
255 |
-
// Change the text of the "Insert into Post" buttons to read "Use this File".
|
256 |
-
$( '.savesend input.button[value*="Insert into Post"], .media-item #go_button' ).attr( 'value', 'Use this File' );
|
257 |
-
|
258 |
-
// Hide the "Insert Gallery" settings box on the "Gallery" tab.
|
259 |
-
$( 'div#gallery-settings' ).hide();
|
260 |
-
|
261 |
-
// Preserve the "is_optionsframework" parameter on the "delete" confirmation button.
|
262 |
-
$( '.savesend a.del-link' ).click ( function () {
|
263 |
-
var continueButton = $( this ).next( '.del-attachment' ).children( 'a.button[id*="del"]' );
|
264 |
-
var continueHref = continueButton.attr( 'href' );
|
265 |
-
continueHref = continueHref + '&is_optionsframework=yes';
|
266 |
-
continueButton.attr( 'href', continueHref );
|
267 |
-
});
|
268 |
-
});
|
269 |
-
</script>
|
270 |
-
<?php
|
271 |
-
}
|
272 |
-
|
273 |
-
endif;
|
274 |
-
|
275 |
-
/**
|
276 |
-
* Triggered inside the Media Library popup to modify the title of the "Gallery" tab.
|
277 |
-
*/
|
278 |
-
|
279 |
-
if ( ! function_exists( 'optionsframework_mlu_modify_tabs' ) ) :
|
280 |
-
|
281 |
-
function optionsframework_mlu_modify_tabs ( $tabs ) {
|
282 |
-
$tabs['gallery'] = str_replace( __( 'Gallery', 'optionsframework' ), __( 'Previously Uploaded', 'optionsframework' ), $tabs['gallery'] );
|
283 |
-
return $tabs;
|
284 |
-
}
|
285 |
-
|
286 |
-
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
options-sanitize.php
CHANGED
@@ -345,10 +345,10 @@ function of_recognized_font_faces() {
|
|
345 |
*/
|
346 |
function of_recognized_font_styles() {
|
347 |
$default = array(
|
348 |
-
'normal' => __('Normal', 'optionsframework'),
|
349 |
-
'italic' => __('Italic', 'optionsframework'),
|
350 |
-
'bold' => __('Bold', 'optionsframework'),
|
351 |
-
'bold italic' => __('Bold Italic', 'optionsframework')
|
352 |
);
|
353 |
return apply_filters( 'of_recognized_font_styles', $default );
|
354 |
}
|
345 |
*/
|
346 |
function of_recognized_font_styles() {
|
347 |
$default = array(
|
348 |
+
'normal' => __( 'Normal', 'optionsframework' ),
|
349 |
+
'italic' => __( 'Italic', 'optionsframework' ),
|
350 |
+
'bold' => __( 'Bold', 'optionsframework' ),
|
351 |
+
'bold italic' => __( 'Bold Italic', 'optionsframework' )
|
352 |
);
|
353 |
return apply_filters( 'of_recognized_font_styles', $default );
|
354 |
}
|
readme.txt
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
|
3 |
Contributors: Devin Price
|
4 |
Tags: options, theme options
|
5 |
-
Donate link: http://bit.ly/options-donate
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.5
|
8 |
-
Stable tag: 1.
|
9 |
License: GPLv2
|
10 |
|
11 |
== Description ==
|
@@ -67,6 +67,17 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
|
|
67 |
|
68 |
== Changelog ==
|
69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
= 1.4 =
|
71 |
|
72 |
* Add missing sanitization to typography color (@weplantmedia)
|
2 |
|
3 |
Contributors: Devin Price
|
4 |
Tags: options, theme options
|
5 |
+
Donate link: http://bit.ly/options-donate-2
|
6 |
Requires at least: 3.3
|
7 |
Tested up to: 3.5
|
8 |
+
Stable tag: 1.5
|
9 |
License: GPLv2
|
10 |
|
11 |
== Description ==
|
67 |
|
68 |
== Changelog ==
|
69 |
|
70 |
+
= 1.5 =
|
71 |
+
|
72 |
+
* Updated width of text input
|
73 |
+
* New media uploader
|
74 |
+
* Dropped custom post types for file attachments
|
75 |
+
* Update routine to remove unused 'optionsframework' post types
|
76 |
+
* Updated IDs for .tabs and .groups
|
77 |
+
* Italian translations (andreabersi.com)
|
78 |
+
* Russian translations (verha.net)
|
79 |
+
* Swedish translations (kjeell.se)
|
80 |
+
|
81 |
= 1.4 =
|
82 |
|
83 |
* Add missing sanitization to typography color (@weplantmedia)
|
screenshot-1.png
CHANGED
File without changes
|
upgrade.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/**
|
4 |
+
* Updates Options Framework Data
|
5 |
+
*
|
6 |
+
* @package Options Framework
|
7 |
+
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
8 |
+
* @since 1.5
|
9 |
+
*/
|
10 |
+
|
11 |
+
function optionsframework_upgrade_routine() {
|
12 |
+
optionsframework_update_to_version_1_5();
|
13 |
+
optionsframework_update_version();
|
14 |
+
}
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Media uploader code changed in Options Framework 1.5
|
18 |
+
* and no longer uses a custom post type.
|
19 |
+
*
|
20 |
+
* Function removes the post type 'optionsframework'
|
21 |
+
* Media attached to the post type remains in the media library
|
22 |
+
*
|
23 |
+
* @access public
|
24 |
+
* @since 1.5
|
25 |
+
* @return void
|
26 |
+
*/
|
27 |
+
|
28 |
+
function optionsframework_update_to_version_1_5() {
|
29 |
+
register_post_type( 'optionsframework', array(
|
30 |
+
'labels' => array(
|
31 |
+
'name' => __( 'Theme Options Media', 'optionsframework' ),
|
32 |
+
),
|
33 |
+
'show_ui' => false,
|
34 |
+
'rewrite' => false,
|
35 |
+
'show_in_nav_menus' => false,
|
36 |
+
'public' => false
|
37 |
+
) );
|
38 |
+
|
39 |
+
// Get all the optionsframework post type
|
40 |
+
$query = new WP_Query( array(
|
41 |
+
'post_type' => 'optionsframework',
|
42 |
+
'numberposts' => -1,
|
43 |
+
) );
|
44 |
+
|
45 |
+
while ( $query->have_posts() ) :
|
46 |
+
$query->the_post();
|
47 |
+
$attachments = get_children( array(
|
48 |
+
'post_parent' => the_ID(),
|
49 |
+
'post_type' => 'attachment'
|
50 |
+
)
|
51 |
+
);
|
52 |
+
if ( !empty( $attachments ) ) {
|
53 |
+
// Unassign each of the attachments from the post
|
54 |
+
foreach ( $attachments as $attachment ) {
|
55 |
+
wp_update_post( array(
|
56 |
+
'ID' => $attachment->ID,
|
57 |
+
'post_parent' => 0
|
58 |
+
)
|
59 |
+
);
|
60 |
+
}
|
61 |
+
}
|
62 |
+
wp_delete_post( the_ID(), true);
|
63 |
+
endwhile;
|
64 |
+
|
65 |
+
wp_reset_postdata();
|
66 |
+
}
|
67 |
+
|
68 |
+
/**
|
69 |
+
* Updates Options Framework version in the database
|
70 |
+
*
|
71 |
+
* @access public
|
72 |
+
* @since 1.5
|
73 |
+
* @return void
|
74 |
+
*/
|
75 |
+
|
76 |
+
function optionsframework_update_version() {
|
77 |
+
$optionsframework_settings = get_option( 'optionsframework' );
|
78 |
+
$optionsframework_settings['version'] = OPTIONS_FRAMEWORK_VERSION;
|
79 |
+
update_option( 'optionsframework', $optionsframework_settings);
|
80 |
+
}
|