本文整理汇总了PHP中et_generate_wpml_ids函数的典型用法代码示例。如果您正苦于以下问题:PHP et_generate_wpml_ids函数的具体用法?PHP et_generate_wpml_ids怎么用?PHP et_generate_wpml_ids使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了et_generate_wpml_ids函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: et_home_posts_query
/**
* Filters the main query on homepage
*/
function et_home_posts_query($query = false)
{
/* Don't proceed if it's not homepage or the main query */
if (!is_home() || !is_a($query, 'WP_Query') || !$query->is_main_query()) {
return;
}
if ('false' == et_get_option('feather_blog_style', 'false')) {
if ('on' == et_get_option('feather_display_recentwork_section', 'on')) {
$query->set('posts_per_page', (int) et_get_option('feather_posts_media', '8'));
$exclude_media_categories = et_get_option('feather_exlcats_media', false);
if ($exclude_media_categories) {
$query->set('category__not_in', array_map('intval', et_generate_wpml_ids($exclude_media_categories, 'category')));
}
}
return;
}
/* Set the amount of posts per page on homepage */
$query->set('posts_per_page', (int) et_get_option('feather_homepage_posts', '6'));
/* Exclude categories set in ePanel */
$exclude_categories = et_get_option('feather_exlcats_recent', false);
if ($exclude_categories) {
$query->set('category__not_in', array_map('intval', et_generate_wpml_ids($exclude_categories, 'category')));
}
/* Exclude slider posts, if the slider is activated, pages are not featured and posts duplication is disabled in ePanel */
if ('on' == et_get_option('feather_featured', 'on') && 'false' == et_get_option('feather_use_pages', 'false') && 'false' == et_get_option('feather_duplicate', 'on')) {
$query->set('post__not_in', et_get_featured_posts_ids());
}
}
开发者ID:iinspiration,项目名称:theme,代码行数:31,代码来源:functions.php
示例2: et_get_option
function et_get_option($option_name, $default_value = '', $used_for_object = '', $force_default_value = false, $is_global_setting = false, $global_setting_main_name = '', $global_setting_sub_name = '')
{
global $et_theme_options, $shortname;
if ($is_global_setting) {
$option_value = '';
$et_global_setting = get_option($global_setting_main_name);
if (false !== $et_global_setting && isset($et_global_setting[$global_setting_sub_name])) {
$option_value = $et_global_setting[$global_setting_sub_name];
}
} else {
if (et_options_stored_in_one_row()) {
$et_theme_options_name = 'et_' . $shortname;
if (!isset($et_theme_options) || isset($_POST['wp_customize'])) {
$et_theme_options = get_option($et_theme_options_name);
}
$option_value = isset($et_theme_options[$option_name]) ? $et_theme_options[$option_name] : false;
} else {
$option_value = get_option($option_name);
}
}
// option value might be equal to false, so check if the option is not set in the database
if (et_options_stored_in_one_row() && !isset($et_theme_options[$option_name]) && ('' != $default_value || $force_default_value)) {
$option_value = $default_value;
}
if ('' != $used_for_object && in_array($used_for_object, array('page', 'category')) && is_array($option_value)) {
$option_value = et_generate_wpml_ids($option_value, $used_for_object);
}
return $option_value;
}
开发者ID:pacificano,项目名称:pacificano,代码行数:29,代码来源:custom_functions.php
示例3: et_home_posts_query
/**
* Filters the main query on homepage
*/
function et_home_posts_query($query = false)
{
/* Don't proceed if it's not homepage or the main query */
if (!is_home() || !is_a($query, 'WP_Query') || !$query->is_main_query()) {
return;
}
/* Set the amount of posts per page on homepage */
$query->set('posts_per_page', (int) et_get_option('personalpress_homepage_posts', '6'));
/* Exclude categories set in ePanel */
$exclude_categories = et_get_option('personalpress_exlcats_recent', false);
if ($exclude_categories) {
$query->set('category__not_in', array_map('intval', et_generate_wpml_ids($exclude_categories, 'category')));
}
}
开发者ID:damiansu,项目名称:wordpress-es,代码行数:17,代码来源:functions.php
示例4: et_get_option
function et_get_option($option_name, $default_value = '', $used_for_object = '', $force_default_value = false)
{
global $et_divi_builder_plugin_options;
$shortname = 'divi_builder_plugin';
$et_theme_options_name = 'et_' . $shortname;
if (!isset($et_divi_builder_plugin_options)) {
$et_divi_builder_plugin_options = get_option($et_theme_options_name);
}
$option_value = isset($et_divi_builder_plugin_options[$option_name]) ? $et_divi_builder_plugin_options[$option_name] : false;
// option value might be equal to false, so check if the option is not set in the database
if (!isset($et_divi_builder_plugin_options[$option_name]) && ('' != $default_value || $force_default_value)) {
$option_value = $default_value;
}
if ('' != $used_for_object && in_array($used_for_object, array('page', 'category')) && is_array($option_value)) {
$option_value = et_generate_wpml_ids($option_value, $used_for_object);
}
return $option_value;
}
开发者ID:thirteen05,项目名称:icy-install,代码行数:18,代码来源:functions.php
示例5: et_get_option
function et_get_option($option_name, $default_value = '', $used_for_object = '')
{
global $et_theme_options, $shortname;
if (et_options_stored_in_one_row()) {
$et_theme_options_name = 'et_' . $shortname;
if (!isset($et_theme_options)) {
$et_theme_options = get_option($et_theme_options_name);
}
$option_value = isset($et_theme_options[$option_name]) ? $et_theme_options[$option_name] : false;
} else {
$option_value = get_option($option_name);
}
if (!$option_value && '' != $default_value) {
$option_value = $default_value;
}
if ('' != $used_for_object && in_array($used_for_object, array('page', 'category')) && is_array($option_value)) {
$option_value = et_generate_wpml_ids($option_value, $used_for_object);
}
return $option_value;
}
开发者ID:douglaswebdesigns,项目名称:ask-bio-expert,代码行数:20,代码来源:custom_functions.php
示例6: et_home_posts_query
/**
* Filters the main query on homepage
*/
function et_home_posts_query($query = false)
{
/* Don't proceed if it's not homepage or the main query */
if (!is_home() || !is_a($query, 'WP_Query') || !$query->is_main_query()) {
return;
}
/* Set the amount of posts per page on homepage */
$query->set('posts_per_page', (int) et_get_option('harmony_homepage_posts', '3'));
// Make sure audio posts are excluded from the Recent News section, if Blog style mode is disabled
if ('on' != et_get_option('harmony_blog_style', 'false')) {
$tax_query_args = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-audio'), 'operator' => 'NOT IN'));
$query->set('tax_query', apply_filters('et_home_tax_query_args', $tax_query_args));
// sticky posts don't take posts_per_page option into account, so we display posts in the natural order
$query->set('ignore_sticky_posts', 1);
}
/* Exclude categories set in ePanel */
$exclude_categories = et_get_option('harmony_exlcats_recent', false);
if ($exclude_categories) {
$query->set('category__not_in', array_map('intval', et_generate_wpml_ids($exclude_categories, 'category')));
}
}
开发者ID:Acens,项目名称:jao2015,代码行数:24,代码来源:functions.php
示例7: et_home_posts_query
/**
* Filters the main query on homepage
*/
function et_home_posts_query($query = false)
{
/* Don't proceed if it's not homepage or the main query */
if (!is_home() || !is_a($query, 'WP_Query') || !$query->is_main_query()) {
return;
}
/* Set the amount of posts per page on homepage */
$query->set('posts_per_page', (int) et_get_option('askit_homepage_posts', '6'));
if (isset($_GET['homeq']) && $_GET['homeq'] == 'recent' || !isset($_GET['homeq'])) {
$exclude_categories = et_get_option('askit_exlcats_recent', false);
if ($exclude_categories) {
$query->set('category__not_in', array_map('intval', et_generate_wpml_ids($exclude_categories, 'category')));
}
} else {
$query->set('ignore_sticky_posts', 1);
}
if (isset($_GET['homeq']) && $_GET['homeq'] == 'popular') {
$query->set('orderby', 'comment_count');
}
if (isset($_GET['homeq']) && $_GET['homeq'] == 'random') {
$query->set('orderby', 'rand');
}
}
开发者ID:douglaswebdesigns,项目名称:ask-bio-expert,代码行数:26,代码来源:functions.php
注:本文中的et_generate_wpml_ids函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论