1 Star 0 Fork 0

是你的单单呀/HTML5-Reset-WordPress-Theme

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
options.php 5.35 KB
一键复制 编辑 原始数据 按行查看 历史
CK Hicks 提交于 2013-07-03 14:52 . removed a few outdated features
<?php
/**
* A unique identifier is defined to store the options in the database and reference them from the theme.
* By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
* If the identifier changes, it'll appear as if the options have been reset.
*/
function optionsframework_option_name() {
// This gets the theme name from the stylesheet
$themename = get_option( 'stylesheet' );
$themename = preg_replace("/\W/", "_", strtolower($themename) );
$optionsframework_settings = get_option( 'optionsframework' );
$optionsframework_settings['id'] = $themename;
update_option( 'optionsframework', $optionsframework_settings );
}
/**
* Defines an array of options that will be used to generate the settings page and be saved in the database.
* When creating the 'id' fields, make sure to use all lowercase and no spaces.
*
* If you are making your theme translatable, you should replace 'html5reset'
* with the actual text domain for your theme. Read more:
* http://codex.wordpress.org/Function_Reference/load_theme_textdomain
*/
function optionsframework_options() {
// Pull all the categories into an array
$options_categories = array();
$options_categories_obj = get_categories();
foreach ($options_categories_obj as $category) {
$options_categories[$category->cat_ID] = $category->cat_name;
}
// Pull all tags into an array
$options_tags = array();
$options_tags_obj = get_tags();
foreach ( $options_tags_obj as $tag ) {
$options_tags[$tag->term_id] = $tag->name;
}
// Pull all the pages into an array
$options_pages = array();
$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Select a page:';
foreach ($options_pages_obj as $page) {
$options_pages[$page->ID] = $page->post_title;
}
$options = array();
$options[] = array(
'name' => __('Header Meta', 'html5reset'),
'type' => 'heading');
// Standard Meta
$options[] = array(
'name' => __('Head ID', 'html5reset'),
'desc' => __("", 'html5reset'),
'id' => 'meta_headid',
'std' => 'www-sitename-com',
'type' => 'text');
$options[] = array(
'name' => __('Google Webmasters', 'html5reset'),
'desc' => __("Speaking of Google, don't forget to set your site up: <a href='http://google.com/webmasters' target='_blank'>http://google.com/webmasters</a>", 'html5reset'),
'id' => 'meta_google',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Author Name', 'html5reset'),
'desc' => __('Populates meta author tag.', 'html5reset'),
'id' => 'meta_author',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('Mobile Viewport', 'html5reset'),
'desc' => __('Uncomment to use; use thoughtfully!', 'html5reset'),
'id' => 'meta_viewport',
'std' => 'width=device-width, initial-scale=1.0',
'type' => 'text');
// Icons
$options[] = array(
'name' => __('Site Favicon', 'html5reset'),
'desc' => __('', 'html5reset'),
'id' => 'head_favicon',
'type' => 'upload');
$options[] = array(
'name' => __('Apple Touch Icon', 'html5reset'),
'desc' => __('', 'html5reset'),
'id' => 'head_apple_touch_icon',
'type' => 'upload');
// App: Windows 8
$options[] = array(
'name' => __('App: Windows 8', 'html5reset'),
'desc' => __('Application Name', 'html5reset'),
'id' => 'meta_app_win_name',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('Tile Color', 'html5reset'),
'id' => 'meta_app_win_color',
'std' => '',
'type' => 'color');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('Tile Image', 'html5reset'),
'id' => 'meta_app_win_image',
'std' => '',
'type' => 'upload');
// App: Twitter
$options[] = array(
'name' => __('App: Twitter Card', 'html5reset'),
'desc' => __('twitter:card (summary, photo, gallery, product, app, player)', 'html5reset'),
'id' => 'meta_app_twt_card',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('twitter:site (@username of website)', 'html5reset'),
'id' => 'meta_app_twt_site',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __("twitter:title (the user's Twitter ID)", 'html5reset'),
'id' => 'meta_app_twt_title',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('twitter:description (maximum 200 characters)', 'html5reset'),
'id' => 'meta_app_twt_description',
'std' => '',
'type' => 'textarea');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('twitter:url (url for the content)', 'html5reset'),
'id' => 'meta_app_twt_url',
'std' => '',
'type' => 'text');
// App: Facebook
$options[] = array(
'name' => __('App: Facebook', 'html5reset'),
'desc' => __('og:title', 'html5reset'),
'id' => 'meta_app_fb_title',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('og:description', 'html5reset'),
'id' => 'meta_app_fb_description',
'std' => '',
'type' => 'textarea');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('og:url', 'html5reset'),
'id' => 'meta_app_fb_url',
'std' => '',
'type' => 'text');
$options[] = array(
'name' => __('', 'html5reset'),
'desc' => __('og:image', 'html5reset'),
'id' => 'meta_app_fb_image',
'std' => '',
'type' => 'upload');
return $options;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mrchaxs/HTML5-Reset-WordPress-Theme.git
git@gitee.com:mrchaxs/HTML5-Reset-WordPress-Theme.git
mrchaxs
HTML5-Reset-WordPress-Theme
HTML5-Reset-WordPress-Theme
master

搜索帮助