├── images
├── top.png
├── close.png
├── next.png
├── prev.png
├── weibo.png
├── default.jpg
├── github.png
├── loading.gif
├── twitter.png
└── header-bg.gif
├── inc
├── .DS_Store
├── images
│ └── ico-delete.png
├── js
│ ├── options-custom.js
│ └── media-uploader.js
├── options-framework.php
├── includes
│ ├── class-options-framework.php
│ ├── class-options-media-uploader.php
│ ├── class-options-framework-admin.php
│ ├── class-options-sanitization.php
│ └── class-options-interface.php
└── comments-ajax.php
├── screenshot.jpg
├── README.md
├── fonts
├── lato
│ ├── lato-bold.eot
│ ├── lato-bold.ttf
│ ├── lato-black.eot
│ ├── lato-black.ttf
│ ├── lato-black.woff
│ ├── lato-bold.woff
│ ├── lato-italic.eot
│ ├── lato-italic.ttf
│ ├── lato-light.eot
│ ├── lato-light.ttf
│ ├── lato-light.woff
│ ├── lato-italic.woff
│ ├── lato-regular.eot
│ ├── lato-regular.ttf
│ ├── lato-regular.woff
│ ├── lato-bolditalic.eot
│ ├── lato-bolditalic.ttf
│ └── lato-bolditalic.woff
├── glyphicons-halflings-regular.eot
├── glyphicons-halflings-regular.ttf
├── glyphicons-halflings-regular.woff
├── glyphicons-halflings-regular.woff2
└── glyphicons
│ ├── flat-ui-pro-icons-regular.eot
│ ├── flat-ui-pro-icons-regular.ttf
│ └── flat-ui-pro-icons-regular.woff
├── expand
├── info.json
├── comment.func.php
├── index
│ └── exhibition.php
├── nav.class.php
├── update.php
└── func.func.php
├── ajax-comment
├── ajax-comment.css
├── ajax-comment.js
└── do.php
├── page.php
├── single.php
├── pages
├── fluid-page.php
└── link-page.php
├── sidebar.php
├── css
├── prism.css
└── lightbox.css
├── footer.php
├── header.php
├── comments.php
├── js
├── jquery.lazyload.min.js
├── main.js
└── lightbox.js
├── functions.php
├── index.php
└── options.php
/images/top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/top.png
--------------------------------------------------------------------------------
/inc/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/inc/.DS_Store
--------------------------------------------------------------------------------
/screenshot.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/screenshot.jpg
--------------------------------------------------------------------------------
/images/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/close.png
--------------------------------------------------------------------------------
/images/next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/next.png
--------------------------------------------------------------------------------
/images/prev.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/prev.png
--------------------------------------------------------------------------------
/images/weibo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/weibo.png
--------------------------------------------------------------------------------
/images/default.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/default.jpg
--------------------------------------------------------------------------------
/images/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/github.png
--------------------------------------------------------------------------------
/images/loading.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/loading.gif
--------------------------------------------------------------------------------
/images/twitter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/twitter.png
--------------------------------------------------------------------------------
/images/header-bg.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/images/header-bg.gif
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Ysnv-theme
2 | WordPress themes Ysnv
3 | ## 详情请看https://www.stayma.cn/ysnv-theme.html
4 |
--------------------------------------------------------------------------------
/fonts/lato/lato-bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-bold.eot
--------------------------------------------------------------------------------
/fonts/lato/lato-bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-bold.ttf
--------------------------------------------------------------------------------
/fonts/lato/lato-black.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-black.eot
--------------------------------------------------------------------------------
/fonts/lato/lato-black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-black.ttf
--------------------------------------------------------------------------------
/fonts/lato/lato-black.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-black.woff
--------------------------------------------------------------------------------
/fonts/lato/lato-bold.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-bold.woff
--------------------------------------------------------------------------------
/fonts/lato/lato-italic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-italic.eot
--------------------------------------------------------------------------------
/fonts/lato/lato-italic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-italic.ttf
--------------------------------------------------------------------------------
/fonts/lato/lato-light.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-light.eot
--------------------------------------------------------------------------------
/fonts/lato/lato-light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-light.ttf
--------------------------------------------------------------------------------
/fonts/lato/lato-light.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-light.woff
--------------------------------------------------------------------------------
/inc/images/ico-delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/inc/images/ico-delete.png
--------------------------------------------------------------------------------
/fonts/lato/lato-italic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-italic.woff
--------------------------------------------------------------------------------
/fonts/lato/lato-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-regular.eot
--------------------------------------------------------------------------------
/fonts/lato/lato-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-regular.ttf
--------------------------------------------------------------------------------
/fonts/lato/lato-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-regular.woff
--------------------------------------------------------------------------------
/fonts/lato/lato-bolditalic.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-bolditalic.eot
--------------------------------------------------------------------------------
/fonts/lato/lato-bolditalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-bolditalic.ttf
--------------------------------------------------------------------------------
/fonts/lato/lato-bolditalic.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/lato/lato-bolditalic.woff
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/fonts/glyphicons/flat-ui-pro-icons-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/glyphicons/flat-ui-pro-icons-regular.eot
--------------------------------------------------------------------------------
/fonts/glyphicons/flat-ui-pro-icons-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/glyphicons/flat-ui-pro-icons-regular.ttf
--------------------------------------------------------------------------------
/fonts/glyphicons/flat-ui-pro-icons-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ysnv1997/Ysnv-theme/HEAD/fonts/glyphicons/flat-ui-pro-icons-regular.woff
--------------------------------------------------------------------------------
/expand/info.json:
--------------------------------------------------------------------------------
1 | {
2 | "version" : "1.0",
3 | "details_url" : "https://www.stayma.cn/ysnv",
4 | "download_url" : "http://tp.yigujin.wang/Three2.0.zip"
5 | }
--------------------------------------------------------------------------------
/ajax-comment/ajax-comment.css:
--------------------------------------------------------------------------------
1 | .hide{
2 | display: none
3 | }
4 | #comment_message{
5 | font-size:12px;
6 | background-color: #eee;
7 | padding: 5px;
8 | margin:10px 0;
9 | }
10 |
--------------------------------------------------------------------------------
/expand/comment.func.php:
--------------------------------------------------------------------------------
1 |
8 |
id="li-comment-">
9 |
33 | ';
36 | }
--------------------------------------------------------------------------------
/page.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ID); ?>
24 |
25 |
26 | 条评论
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/single.php:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | ID); ?>
24 |
25 |
26 | 条评论
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/expand/index/exhibition.php:
--------------------------------------------------------------------------------
1 |
2 |
39 |
--------------------------------------------------------------------------------
/pages/fluid-page.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | ID); ?>
29 |
30 |
31 | 条评论
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
43 |
44 |
45 |
46 |
47 |
48 |
56 |
57 |
--------------------------------------------------------------------------------
/pages/link-page.php:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | ID); ?>
29 |
30 |
31 | 条评论
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
46 |
47 |
48 |
49 |
50 |
51 |
59 |
60 |
--------------------------------------------------------------------------------
/sidebar.php:
--------------------------------------------------------------------------------
1 |
2 |
25 |
26 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
42 |
54 |
55 |
56 |
62 |
--------------------------------------------------------------------------------
/inc/js/options-custom.js:
--------------------------------------------------------------------------------
1 | /**
2 |
3 | * Custom scripts needed for the colorpicker, image button selectors,
4 |
5 | * and navigation tabs.
6 |
7 | */
8 |
9 |
10 |
11 | jQuery(document).ready(function($) {
12 |
13 |
14 |
15 | // Loads the color pickers
16 |
17 | $('.of-color').wpColorPicker();
18 |
19 |
20 |
21 | // Image Options
22 |
23 | $('.of-radio-img-img').click(function(){
24 |
25 | $(this).parent().parent().find('.of-radio-img-img').removeClass('of-radio-img-selected');
26 |
27 | $(this).addClass('of-radio-img-selected');
28 |
29 | });
30 |
31 |
32 |
33 | $('.of-radio-img-label').hide();
34 |
35 | $('.of-radio-img-img').show();
36 |
37 | $('.of-radio-img-radio').hide();
38 |
39 |
40 |
41 | // Loads tabbed sections if they exist
42 |
43 | if ( $('.nav-tab-wrapper').length > 0 ) {
44 |
45 | options_framework_tabs();
46 |
47 | }
48 |
49 |
50 |
51 | function options_framework_tabs() {
52 |
53 |
54 |
55 | var $group = $('.group'),
56 |
57 | $navtabs = $('.nav-tab-wrapper a'),
58 |
59 | active_tab = '';
60 |
61 |
62 |
63 | // Hides all the .group sections to start
64 |
65 | $group.hide();
66 |
67 |
68 |
69 | // Find if a selected tab is saved in localStorage
70 |
71 | if ( typeof(localStorage) != 'undefined' ) {
72 |
73 | active_tab = localStorage.getItem('active_tab');
74 |
75 | }
76 |
77 |
78 |
79 | // If active tab is saved and exists, load it's .group
80 |
81 | if ( active_tab != '' && $(active_tab).length ) {
82 |
83 | $(active_tab).fadeIn();
84 |
85 | $(active_tab + '-tab').addClass('nav-tab-active');
86 |
87 | } else {
88 |
89 | $('.group:first').fadeIn();
90 |
91 | $('.nav-tab-wrapper a:first').addClass('nav-tab-active');
92 |
93 | }
94 |
95 |
96 |
97 | // Bind tabs clicks
98 |
99 | $navtabs.click(function(e) {
100 |
101 |
102 |
103 | e.preventDefault();
104 |
105 |
106 |
107 | // Remove active class from all tabs
108 |
109 | $navtabs.removeClass('nav-tab-active');
110 |
111 |
112 |
113 | $(this).addClass('nav-tab-active').blur();
114 |
115 |
116 |
117 | if (typeof(localStorage) != 'undefined' ) {
118 |
119 | localStorage.setItem('active_tab', $(this).attr('href') );
120 |
121 | }
122 |
123 |
124 |
125 | var selected = $(this).attr('href');
126 |
127 |
128 |
129 | $group.hide();
130 |
131 | $(selected).fadeIn();
132 |
133 |
134 |
135 | });
136 |
137 | }
138 |
139 | // Image Options
140 | $('.optionsframework-radio-img-img').click(function(){
141 | $(this).parent().parent().find('.optionsframework-radio-img-img').removeClass('optionsframework-radio-img-selected');
142 | $(this).addClass('optionsframework-radio-img-selected');
143 | });
144 |
145 | $('.optionsframework-radio-img-label').hide();
146 | $('.optionsframework-radio-img-img').show();
147 | $('.optionsframework-radio-img-radio').hide();
148 |
149 | });
--------------------------------------------------------------------------------
/css/prism.css:
--------------------------------------------------------------------------------
1 | /* PrismJS 1.15.0
2 | https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+markup-templating+json+php+php-extras */
3 | /**
4 | * prism.js default theme for JavaScript, CSS and HTML
5 | * Based on dabblet (http://dabblet.com)
6 | * @author Lea Verou
7 | */
8 |
9 | code[class*="language-"],
10 | pre[class*="language-"] {
11 | color: black;
12 | background: none;
13 | text-shadow: 0 1px white;
14 | font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
15 | text-align: left;
16 | white-space: pre;
17 | word-spacing: normal;
18 | word-break: normal;
19 | word-wrap: normal;
20 | line-height: 1.5;
21 |
22 | -moz-tab-size: 4;
23 | -o-tab-size: 4;
24 | tab-size: 4;
25 |
26 | -webkit-hyphens: none;
27 | -moz-hyphens: none;
28 | -ms-hyphens: none;
29 | hyphens: none;
30 | }
31 |
32 | pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
33 | code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
34 | text-shadow: none;
35 | background: #b3d4fc;
36 | }
37 |
38 | pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
39 | code[class*="language-"]::selection, code[class*="language-"] ::selection {
40 | text-shadow: none;
41 | background: #b3d4fc;
42 | }
43 |
44 | @media print {
45 | code[class*="language-"],
46 | pre[class*="language-"] {
47 | text-shadow: none;
48 | }
49 | }
50 |
51 | /* Code blocks */
52 | pre[class*="language-"] {
53 | padding: 1em;
54 | margin: .5em 0;
55 | overflow: auto;
56 | }
57 |
58 | :not(pre) > code[class*="language-"],
59 | pre[class*="language-"] {
60 | background: #f5f2f0;
61 | }
62 |
63 | /* Inline code */
64 | :not(pre) > code[class*="language-"] {
65 | padding: .1em;
66 | border-radius: .3em;
67 | white-space: normal;
68 | }
69 |
70 | .token.comment,
71 | .token.prolog,
72 | .token.doctype,
73 | .token.cdata {
74 | color: slategray;
75 | }
76 |
77 | .token.punctuation {
78 | color: #999;
79 | }
80 |
81 | .namespace {
82 | opacity: .7;
83 | }
84 |
85 | .token.property,
86 | .token.tag,
87 | .token.boolean,
88 | .token.number,
89 | .token.constant,
90 | .token.symbol,
91 | .token.deleted {
92 | color: #905;
93 | }
94 |
95 | .token.selector,
96 | .token.attr-name,
97 | .token.string,
98 | .token.char,
99 | .token.builtin,
100 | .token.inserted {
101 | color: #690;
102 | }
103 |
104 | .token.operator,
105 | .token.entity,
106 | .token.url,
107 | .language-css .token.string,
108 | .style .token.string {
109 | color: #9a6e3a;
110 | background: hsla(0, 0%, 100%, .5);
111 | }
112 |
113 | .token.atrule,
114 | .token.attr-value,
115 | .token.keyword {
116 | color: #07a;
117 | }
118 |
119 | .token.function,
120 | .token.class-name {
121 | color: #DD4A68;
122 | }
123 |
124 | .token.regex,
125 | .token.important,
126 | .token.variable {
127 | color: #e90;
128 | }
129 |
130 | .token.important,
131 | .token.bold {
132 | font-weight: bold;
133 | }
134 | .token.italic {
135 | font-style: italic;
136 | }
137 |
138 | .token.entity {
139 | cursor: help;
140 | }
141 |
142 |
--------------------------------------------------------------------------------
/inc/options-framework.php:
--------------------------------------------------------------------------------
1 |
12 |
13 | * @license GPL-2.0+
14 |
15 | * @link http://wptheming.com
16 |
17 | * @copyright 2010-2014 WP Theming
18 |
19 | *
20 |
21 | * @wordpress-plugin
22 |
23 | * Plugin Name: Options Framework
24 |
25 | * Plugin URI: http://wptheming.com
26 |
27 | * Description: A framework for building theme options.
28 |
29 | * Version: 1.8.0
30 |
31 | * Author: Devin Price
32 |
33 | * Author URI: http://wptheming.com
34 |
35 | * License: GPL-2.0+
36 |
37 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
38 |
39 | * Text Domain: optionsframework
40 |
41 | * Domain Path: /languages
42 |
43 | */
44 |
45 | // If this file is called directly, abort.
46 |
47 | if (!defined('WPINC')) {
48 |
49 | die;
50 |
51 | }
52 |
53 | // Don't load if optionsframework_init is already defined
54 |
55 | if (is_admin() && !function_exists('optionsframework_init')):
56 |
57 | function optionsframework_init() {
58 |
59 | // If user can't edit theme options, exit
60 |
61 | if (!current_user_can('edit_theme_options')) {
62 | return;
63 | }
64 |
65 | // Loads the required Options Framework classes.
66 |
67 | require plugin_dir_path(__FILE__) . 'includes/class-options-framework.php';
68 |
69 | require plugin_dir_path(__FILE__) . 'includes/class-options-framework-admin.php';
70 |
71 | require plugin_dir_path(__FILE__) . 'includes/class-options-interface.php';
72 |
73 | require plugin_dir_path(__FILE__) . 'includes/class-options-media-uploader.php';
74 |
75 | require plugin_dir_path(__FILE__) . 'includes/class-options-sanitization.php';
76 |
77 | // Instantiate the main plugin class.
78 |
79 | $options_framework = new Options_Framework;
80 |
81 | $options_framework->init();
82 |
83 | // Instantiate the options page.
84 |
85 | $options_framework_admin = new Options_Framework_Admin;
86 |
87 | $options_framework_admin->init();
88 |
89 | // Instantiate the media uploader class
90 |
91 | $options_framework_media_uploader = new Options_Framework_Media_Uploader;
92 |
93 | $options_framework_media_uploader->init();
94 |
95 | }
96 |
97 | add_action('init', 'optionsframework_init', 20);
98 |
99 | endif;
100 |
101 | /**
102 |
103 | * Helper function to return the theme option value.
104 |
105 | * If no value has been saved, it returns $default.
106 |
107 | * Needed because options are saved as serialized strings.
108 |
109 | *
110 |
111 | * Not in a class to support backwards compatibility in themes.
112 |
113 | */
114 |
115 | if (!function_exists('stayma')):
116 |
117 | function stayma($name, $default = false) {
118 |
119 | $config = get_option('optionsframework');
120 |
121 | if (!isset($config['id'])) {
122 |
123 | return $default;
124 |
125 | }
126 |
127 | $options = get_option($config['id']);
128 |
129 | if (isset($options[$name])) {
130 |
131 | return $options[$name];
132 |
133 | }
134 |
135 | return $default;
136 |
137 | }
138 |
139 | endif;
--------------------------------------------------------------------------------
/inc/js/media-uploader.js:
--------------------------------------------------------------------------------
1 | jQuery(document).ready(function($){
2 |
3 | var optionsframework_upload;
4 | var optionsframework_selector;
5 |
6 | function optionsframework_add_file(event, selector) {
7 |
8 | var upload = $(".uploaded-file"), frame;
9 | var $el = $(this);
10 | optionsframework_selector = selector;
11 |
12 | event.preventDefault();
13 |
14 | // If the media frame already exists, reopen it.
15 | if ( optionsframework_upload ) {
16 | optionsframework_upload.open();
17 | } else {
18 | // Create the media frame.
19 | optionsframework_upload = wp.media.frames.optionsframework_upload = wp.media({
20 | // Set the title of the modal.
21 | title: $el.data('choose'),
22 |
23 | // Customize the submit button.
24 | button: {
25 | // Set the text of the button.
26 | text: $el.data('update'),
27 | // Tell the button not to close the modal, since we're
28 | // going to refresh the page when the image is selected.
29 | close: false
30 | }
31 | });
32 |
33 | // When an image is selected, run a callback.
34 | optionsframework_upload.on( 'select', function() {
35 | // Grab the selected attachment.
36 | var attachment = optionsframework_upload.state().get('selection').first();
37 | optionsframework_upload.close();
38 | optionsframework_selector.find('.upload').val(attachment.attributes.url);
39 | if ( attachment.attributes.type == 'image' ) {
40 | optionsframework_selector.find('.screenshot').empty().hide().append('
Remove').slideDown('fast');
41 | }
42 | optionsframework_selector.find('.upload-button').unbind().addClass('remove-file').removeClass('upload-button').val(optionsframework_l10n.remove);
43 | optionsframework_selector.find('.of-background-properties').slideDown();
44 | optionsframework_selector.find('.remove-image, .remove-file').on('click', function() {
45 | optionsframework_remove_file( $(this).parents('.section') );
46 | });
47 | });
48 |
49 | }
50 |
51 | // Finally, open the modal.
52 | optionsframework_upload.open();
53 | }
54 |
55 | function optionsframework_remove_file(selector) {
56 | selector.find('.remove-image').hide();
57 | selector.find('.upload').val('');
58 | selector.find('.of-background-properties').hide();
59 | selector.find('.screenshot').slideUp();
60 | selector.find('.remove-file').unbind().addClass('upload-button').removeClass('remove-file').val(optionsframework_l10n.upload);
61 | // We don't display the upload button if .upload-notice is present
62 | // This means the user doesn't have the WordPress 3.5 Media Library Support
63 | if ( $('.section-upload .upload-notice').length > 0 ) {
64 | $('.upload-button').remove();
65 | }
66 | selector.find('.upload-button').on('click', function(event) {
67 | optionsframework_add_file(event, $(this).parents('.section'));
68 | });
69 | }
70 |
71 | $('.remove-image, .remove-file').on('click', function() {
72 | optionsframework_remove_file( $(this).parents('.section') );
73 | });
74 |
75 | $('.upload-button').click( function( event ) {
76 | optionsframework_add_file(event, $(this).parents('.section'));
77 | });
78 |
79 | });
--------------------------------------------------------------------------------
/footer.php:
--------------------------------------------------------------------------------
1 |
9 |
59 |
60 |
61 |
62 |
; ?>/images/top.png)
63 |
64 |
65 |
66 |
67 |
68 |