本文整理汇总了PHP中listify_theme_mod函数的典型用法代码示例。如果您正苦于以下问题:PHP listify_theme_mod函数的具体用法?PHP listify_theme_mod怎么用?PHP listify_theme_mod使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了listify_theme_mod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register_post_types
public function register_post_types()
{
if (!listify_theme_mod('categories-only')) {
return;
}
register_taxonomy('job_listing_type', array());
}
示例2: __construct
public function __construct()
{
$this->labels = array('singular' => listify_theme_mod('label-singular'), 'plural' => listify_theme_mod('label-plural'));
$this->strings = $this->get_strings();
add_filter('gettext', array($this, 'gettext'), 0, 3);
add_filter('gettext_with_context', array($this, 'gettext_with_context'), 0, 4);
add_filter('ngettext', array($this, 'ngettext'), 0, 5);
}
示例3: get_facets
public function get_facets($flat = false)
{
$facets = listify_theme_mod('listing-archive-facetwp-defaults');
if ($flat) {
return $facets;
}
$facets = array_map('trim', explode(',', $facets));
return $facets;
}
示例4: position
public function position()
{
global $listify_job_manager;
$position = listify_theme_mod('listing-archive-facetwp-position');
// Force if the map is already on the side
if ('side' == $listify_job_manager->map->position() && $listify_job_manager->map->display() || is_page_template('page-templates/template-home.php')) {
$position = 'top';
}
return $position;
}
示例5: position
public function position()
{
global $listify_job_manager;
$position = listify_theme_mod('listing-archive-facetwp-position');
// Force if the map is already on the side
if ('side' == $listify_job_manager->map->template->position() && $listify_job_manager->map->template->display() || listify_is_widgetized_page()) {
$position = 'top';
}
return $position;
}
示例6: geolocation_endpoint
public function geolocation_endpoint($url)
{
$key = listify_theme_mod('map-behavior-api-key');
$args = array('language' => get_locale() ? substr(get_locale(), 0, 2) : '');
if ($key && '' != $key) {
$args['key'] = $key;
}
$url = add_query_arg($args, $url);
return esc_url($url);
}
示例7: filters
public function filters()
{
$this->labels = array('singular' => listify_theme_mod('label-singular'), 'plural' => listify_theme_mod('label-plural'));
/* print_r( $this->labels ); */
$this->strings = $this->get_strings();
$this->domains = apply_filters('listify_gettext_domains', array('listify', 'wp-job-manager', 'wp-job-manager-tags', 'wp-job-manager-alerts', 'wp-job-manager-locations', 'wp-job-manager-wc-paid-listings', 'wp-job-manager-simple-paid-listings'));
$this->translations = get_translations_for_domain('listify');
add_filter('gettext', array($this, 'gettext'), 0, 3);
add_filter('gettext_with_context', array($this, 'gettext_with_context'), 0, 4);
add_filter('ngettext', array($this, 'ngettext'), 0, 5);
}
示例8: listify_get_top_level_taxonomy
function listify_get_top_level_taxonomy()
{
$categories_enabled = get_option('job_manager_enable_categories');
$categories_only = listify_theme_mod('categories-only');
if ($categories_enabled && $categories_only) {
$tax = 'job_listing_category';
} else {
$tax = 'job_listing_type';
}
return $tax;
}
示例9: enqueue_scripts
public function enqueue_scripts($force = false)
{
if (!$this->page_needs_map($force)) {
return;
}
wp_enqueue_script('google-maps', '//maps.googleapis.com/maps/api/js?v=3&libraries=geometry,places');
wp_enqueue_script('listify-job-manager-map', Listify_Integration::get_url() . 'js/wp-job-manager-map.min.js', array('jquery', 'jquery-ui-slider', 'google-maps', 'underscore'), 20141204);
$settings = array('facetwp' => listify_has_integration('facetwp'), 'canvas' => 'job_listings-map-canvas', 'useClusters' => listify_theme_mod('map-behavior-clusters'), 'gridSize' => listify_theme_mod('map-behavior-grid-size'), 'autoFit' => listify_theme_mod('map-behavior-autofit'), 'mapOptions' => array('zoom' => listify_theme_mod('map-behavior-zoom'), 'maxZoom' => listify_theme_mod('map-behavior-max-zoom')), 'searchRadius' => array('min' => listify_theme_mod('map-behavior-search-min'), 'max' => listify_theme_mod('map-behavior-search-max')));
if ('' != ($center = listify_theme_mod('map-behavior-center'))) {
$settings['mapOptions']['center'] = $center;
}
wp_localize_script('listify-job-manager-map', 'listifyMapSettings', apply_filters('listify_map_settings', $settings));
}
示例10: markers
public function markers()
{
$terms = get_terms(listify_get_top_level_taxonomy(), array('hide_empty' => 0));
if (is_wp_error($terms)) {
return;
}
foreach ($terms as $term) {
$color = listify_theme_mod('marker-color-' . $term->term_id);
$this->css->add(array('selectors' => array('.map-marker.type-' . $term->term_id . ':after'), 'declarations' => array('border-top-color' => $color)));
$this->css->add(array('selectors' => array('.map-marker.type-' . $term->term_id . ' i:after'), 'declarations' => array('background-color' => $color)));
$this->css->add(array('selectors' => array('.map-marker.type-' . $term->term_id . ' i:before'), 'declarations' => array('color' => $color)));
}
}
示例11: __construct
/**
* Constructor
*/
public function __construct()
{
if (listify_theme_mod('categories-only')) {
$this->taxonomy = 'job_listing_category';
} else {
$this->taxonomy = 'job_listing_type';
}
$this->get_terms();
$this->widget_description = __('Display a tabbed layout of listing types', 'listify');
$this->widget_id = 'listify_widget_tabbed_listings';
$this->widget_name = __('Listify - Page: Tabbed Listings', 'listify');
$this->settings = array('title' => array('type' => 'text', 'std' => 'What\'s New', 'label' => __('Title:', 'listify')), 'limit' => array('type' => 'number', 'std' => 3, 'min' => 3, 'max' => 30, 'step' => 3, 'label' => __('Number per tab:', 'listify')), 'featured' => array('type' => 'checkbox', 'std' => 0, 'label' => __('Use Featured listings', 'listify')), 'terms' => array('label' => __('Types to Feature:', 'listify'), 'type' => 'multicheck', 'std' => '', 'options' => $this->get_terms_simple()));
parent::__construct();
}
示例12: listify_admin_header_style
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*
* @see listify_custom_header_setup().
*/
function listify_admin_header_style()
{
/* Supplimentary CSS */
wp_enqueue_style('listify-fonts', listify_fonts_url());
$header_image = get_custom_header();
?>
<style type="text/css">
.appearance_page_custom-header #headimg {
border: none;
background-color: <?php
echo listify_theme_mod('colors-header-background');
?>
;
padding: 10px;
width: auto;
}
.appearance_page_custom-header #headimg img {
margin-right: 10px;
}
#headimg h1,
#desc {
}
#headimg h1 {
margin: 0 0 0 40px;
font-family: 'Montserrat', sans-serif;
font-size: 26px;
font-weight: normal;
line-height: <?php
echo get_custom_header()->height;
?>
px
}
#headimg h1 a {
text-decoration: none;
}
#desc {
display: none;
}
#headimg img {
float: left;
}
</style>
<?php
}
示例13: setup_actions
public function setup_actions()
{
add_action('after_setup_theme', array($this, 'after_setup_theme'));
add_action('widgets_init', array($this, 'widgets_init'));
add_action('pre_get_posts', array($this, 'hide_packages_from_shop'));
add_filter('user_contactmethods', array($this, 'user_contactmethods'), 10, 2);
if ('user' == listify_theme_mod('social-association')) {
add_action('woocommerce_edit_account_form', array($this, 'woocommerce_edit_account_form'));
add_action('woocommerce_save_account_details', array($this, 'woocommerce_save_account_details'));
}
add_filter('woocommerce_localisation_address_formats', array($this, 'address_formats'));
add_filter('woocommerce_localisation_address_formats', array($this, 'address_formats_shim'), 99);
add_filter('woocommerce_formatted_address_replacements', array($this, 'address_replacements'), 10, 2);
add_filter('woocommerce_formatted_address_replacements', array($this, 'address_schema'), 9, 2);
}
示例14: set_controls
public function set_controls($wp_customize)
{
$this->controls = apply_filters('listify_pre_controls_' . $this->section, $this->controls, $this->section, $wp_customize);
foreach ($this->controls as $key => $control) {
$defaults = array('priority' => $this->priority->next(), 'type' => 'text', 'section' => $this->section);
$control = wp_parse_args($control, $defaults);
$wp_customize->add_setting($key, array('default' => listify_theme_mod($key)));
if (class_exists($control['type'])) {
$type = $control['type'];
unset($control['type']);
$wp_customize->add_control(new $type($wp_customize, $key, $control));
} else {
$wp_customize->add_control($key, $control);
}
}
}
示例15: widget
/**
* widget function.
*
* @see WP_Widget
* @access public
* @param array $args
* @param array $instance
* @return void
*/
function widget($args, $instance)
{
if ($this->get_cached_widget($args)) {
return;
}
extract($args);
global $post;
$title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
$icon = isset($instance['icon']) ? $instance['icon'] : null;
if ($icon) {
$before_title = sprintf($before_title, 'ion-' . $icon);
}
$methods = wp_get_user_contact_methods();
$output = array();
foreach ($methods as $method => $label) {
if ('user' == listify_theme_mod('social-association')) {
$value = get_the_author_meta($method, $post->post_author);
} else {
$value = get_post_meta($post->ID, '_company_' . $method, true);
}
if ('' == $value) {
continue;
}
if ($value && !strstr($value, 'http:') && !strstr($value, 'https:')) {
$value = 'http://' . $value;
}
$output[] = sprintf('<a href="%s" target="_blank" class="ion-social-%s">%s</a>', $value, $method, $label);
}
if (empty($methods) || empty($output)) {
return;
}
ob_start();
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
do_action('listify_widget_job_listing_social_before');
echo '<ul class="social-profiles"><li>' . implode('</li><li>', $output) . '</li></ul>';
do_action('listify_widget_job_listing_social_after');
echo $after_widget;
$content = ob_get_clean();
echo apply_filters($this->widget_id, $content);
$this->cache_widget($args, $content);
}