本文整理汇总了PHP中Options::get_options方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::get_options方法的具体用法?PHP Options::get_options怎么用?PHP Options::get_options使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::get_options方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: arras_flush_options
function arras_flush_options()
{
global $arras_options;
$arras_options = new Options();
$arras_options->get_options();
if (!get_option('arras_options')) {
$arras_options->default_options();
}
}
示例2: thesis_get_option
function thesis_get_option($option_name)
{
$thesis_options = new Options();
$thesis_options->get_options();
return $thesis_options->{$option_name};
}
示例3: get_tiles
public function get_tiles($posts = array(), $opts = array())
{
//
// SETUP
//
// This is a double-up when called from the shortcode, but makes the
// method more reliable.
$opts = shortcode_atts($this->options->get_options(), $opts);
/**
* Set the variables in the instance
*/
$wp_tiles_id = "wp_tiles_" . $this->tiles_id;
$this->tiles_id++;
/**
* Cleanup grids and set names
*/
$opts['grids'] = $this->get_grids($opts['grids']);
$grid_pretty_names = array_keys($opts['grids']);
$opts['grids'] = $this->sanitize_grid_keys($opts['grids']);
$grid_names = array_combine(array_keys($opts['grids']), $grid_pretty_names);
$small_screen_grids = $this->get_grids($opts['small_screen_grid']);
$opts['small_screen_grid'] = end($small_screen_grids);
//
// GET POSTS
//
if (!$posts) {
$posts = array();
}
// Is $posts a query?
if (is_array($posts) && (empty($posts) || count(array_filter(array_keys($posts), 'is_string')))) {
if (isset($posts['posts_per_page']) && 'auto' === $posts['posts_per_page']) {
$posts_in_grid = $this->get_posts_in_grid(reset($opts['grids']));
$posts['posts_per_page'] = $posts_in_grid ? $posts_in_grid : 10;
}
// Automatically set paged var if tile pagination is on
if ($opts['pagination']) {
$paged_query_var = is_front_page() ? get_query_var('page') : get_query_var('paged');
$posts['paged'] = $paged_query_var ? $paged_query_var : 1;
}
$posts = new \WP_Query(apply_filters('wp_tiles_get_posts_query', $posts));
}
// Is posts a WP_Query or Network_Query or similar? (enables pagination)
$wp_query = false;
if (is_object($posts) && isset($posts->posts) && isset($posts->max_num_pages)) {
$wp_query = $posts;
$posts = $wp_query->posts;
}
if (empty($posts)) {
return false;
}
//
// OPTIONS
//
$opts['byline_color'] = $this->options->get_byline_color($opts);
$opts['colors'] = $this->options->get_colors($opts);
/**
* Make sure carousel module isn't loaded in vain
*/
if ('carousel' == $opts['link'] && (!class_exists('No_Jetpack_Carousel') && !class_exists('Jetpack_Carousel'))) {
$opts['link'] = 'thickbox';
}
/**
* Pagination
*/
// Only allow pagination when we have a WP Query
$opts['next_query'] = false;
$next_page = false;
if ($wp_query) {
$max_page = $wp_query->max_num_pages;
$current_page = intval($wp_query->get('paged', 1));
if ($current_page < 1) {
$current_page = 1;
}
$next_page = $current_page + 1;
if ($next_page > $max_page) {
$next_page = false;
}
// If AJAX pagination, sign the query and pass it to JS
if ($next_page && 'ajax' == $opts['pagination']) {
$next_query = $wp_query->query;
$max_page = $wp_query->max_num_pages;
if ($next_page <= $max_page) {
$next_query['paged'] = $next_page;
$opts['next_query'] = array('query' => $next_query, 'action' => Ajax::ACTION_GET_POSTS, '_ajax_nonce' => $this->ajax->get_query_nonce($next_query));
$opts['ajaxurl'] = admin_url('admin-ajax.php');
}
}
}
/**
* Pass the required info to the JS
*/
$this->add_data_for_js($wp_tiles_id, $opts);
//
// RENDER HTML
//
/**
* Get the classes
*/
$classes = array('top' == $opts['byline_align'] ? 'wp-tiles-byline-align-top' : 'wp-tiles-byline-align-bottom');
if (!empty($opts['byline_effect']) && in_array($opts['byline_effect'], $this->options->get_allowed_byline_effects())) {
//.........这里部分代码省略.........
示例4: thesis_upgrade_design_options
function thesis_upgrade_design_options()
{
// Retrieve Design Options and Design Options defaults
$design_options = new Design();
$design_options->get_design_options();
$default_design_options = new Design();
$default_design_options->default_design_options();
// Retrieve Thesis Options and Thesis Options defaults
$thesis_options = new Options();
$thesis_options->get_options();
$default_options = new Options();
$default_options->default_options();
if (isset($design_options->teasers) && !is_array($design_options->teasers)) {
unset($design_options->teasers);
}
if (isset($design_options->feature_box_condition)) {
$feature_box = $design_options->feature_box;
unset($design_options->feature_box);
}
if (isset($thesis_options->multimedia_box)) {
$multimedia_box = $thesis_options->multimedia_box;
}
// Ubiquitous options upgrade code
foreach ($default_design_options as $option_name => $value) {
if (!isset($design_options->{$option_name})) {
$design_options->{$option_name} = $value;
}
}
// 1.6b niceness
if (!isset($design_options->nav['link']['parent'])) {
$design_options->nav['link']['parent'] = $default_design_options->nav['link']['parent'];
}
if (!isset($design_options->nav['background']['parent'])) {
$design_options->nav['background']['parent'] = $default_design_options->nav['background']['parent'];
}
// Version-specific upgrade code
if (isset($design_options->font_sizes)) {
foreach ($design_options->fonts as $area => $family) {
$design_options->fonts['families'][$area] = $family ? $family : false;
}
foreach ($design_options->font_sizes as $area => $size) {
$design_options->fonts['sizes'][$area] = $size;
}
}
if (isset($design_options->num_columns)) {
$design_options->layout['columns'] = $design_options->num_columns;
}
if (isset($design_options->widths)) {
$design_options->layout['widths']['content'] = $design_options->widths['content'] ? $design_options->widths['content'] : 480;
$design_options->layout['widths']['sidebar_1'] = $design_options->widths['sidebar_1'] ? $design_options->widths['sidebar_1'] : 195;
$design_options->layout['widths']['sidebar_2'] = $design_options->widths['sidebar_2'] ? $design_options->widths['sidebar_2'] : 195;
}
if (isset($design_options->column_order)) {
$design_options->layout['order'] = $design_options->column_order;
}
if (isset($design_options->html_framework)) {
$design_options->layout['framework'] = $design_options->html_framework ? $design_options->html_framework : 'page';
}
if (isset($design_options->page_padding)) {
$design_options->layout['page_padding'] = $design_options->page_padding;
}
if (isset($design_options->teaser_options) && isset($design_options->teaser_content)) {
foreach ($design_options->teaser_content as $teaser_area) {
$new_teaser_options[$teaser_area]['name'] = $design_options->teasers['options'][$teaser_area]['name'];
$new_teaser_options[$teaser_area]['show'] = (bool) $design_options->teaser_options[$teaser_area];
}
if ($new_teaser_options) {
$design_options->teasers['options'] = $new_teaser_options;
}
}
if (isset($design_options->teaser_date)) {
$design_options->teasers['date']['format'] = $design_options->teaser_date ? $design_options->teaser_date : 'standard';
}
if (isset($design_options->teaser_date_custom)) {
$design_options->teasers['date']['custom'] = $design_options->teaser_date_custom ? $design_options->teaser_date_custom : 'F j, Y';
}
if (isset($design_options->teaser_font_sizes)) {
foreach ($design_options->teaser_font_sizes as $teaser_area => $size) {
$design_options->teasers['font_sizes'][$teaser_area] = $size;
}
}
if (isset($design_options->teaser_link_text)) {
$design_options->teasers['link_text'] = $design_options->teaser_link_text ? $design_options->teaser_link_text : false;
}
if (isset($feature_box)) {
$design_options->feature_box['position'] = $feature_box;
if (isset($design_options->feature_box_condition)) {
$design_options->feature_box['status'] = $design_options->feature_box_condition;
}
if (isset($design_options->feature_box_after_post)) {
$design_options->feature_box['after_post'] = $design_options->feature_box_after_post;
}
}
// Multimedia box
if (isset($multimedia_box) && is_array($multimedia_box)) {
foreach ($multimedia_box as $item => $value) {
$design_options->multimedia_box[$item] = $value;
}
} elseif (isset($multimedia_box)) {
$design_options->multimedia_box['status'] = $multimedia_box;
//.........这里部分代码省略.........