当前位置: 首页>>代码示例>>PHP>>正文


PHP fw_get_db_post_option函数代码示例

本文整理汇总了PHP中fw_get_db_post_option函数的典型用法代码示例。如果您正苦于以下问题:PHP fw_get_db_post_option函数的具体用法?PHP fw_get_db_post_option怎么用?PHP fw_get_db_post_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fw_get_db_post_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_frontend_data

 public function get_frontend_data($post_id)
 {
     $collector = array();
     $meta = fw_get_db_post_option($post_id);
     $post_status = get_post_status($post_id);
     if ('publish' === $post_status and isset($meta['populated'])) {
         $slider_name = $meta['slider']['selected'];
         $population_method = $meta['slider'][$slider_name]['population-method'];
         $number_of_images = (int) $meta['number_of_images'];
         $collector = array('slides' => array(), 'settings' => array('title' => $meta['title'], 'slider_type' => $slider_name, 'population_method' => $population_method, 'post_id' => $post_id, 'extra' => isset($meta['custom-settings']) ? $meta['custom-settings'] : array()));
         $query_data = array();
         $post_type = $meta['tags']['selected'];
         $terms = $meta['tags'][$post_type]['terms'];
         $tax_query = array('tax_query' => array('relation' => 'OR'));
         foreach ($terms as $term) {
             $decoded_data = json_decode($term, true);
             $query_data[$decoded_data['taxonomy']][] = $decoded_data['term_id'];
         }
         foreach ($query_data as $taxonomy => $terms) {
             $tax_query['tax_query'][] = array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $terms);
         }
         $final_query = array_merge(array('post_status' => 'publish', 'posts_per_page' => $number_of_images, 'post_type' => $post_type, 'meta_key' => '_thumbnail_id'), $tax_query);
         global $post;
         $original_post = $post;
         $the_query = new WP_Query($final_query);
         while ($the_query->have_posts()) {
             $the_query->the_post();
             array_push($collector['slides'], array('title' => get_the_title(), 'multimedia_type' => $this->multimedia_types[0], 'src' => wp_get_attachment_url(get_post_thumbnail_id(get_the_ID())), 'desc' => get_the_excerpt(), 'extra' => array('post_id' => $post->ID)));
         }
         wp_reset_postdata();
         $post = $original_post;
         unset($original_post);
     }
     return $collector;
 }
开发者ID:Archrom,项目名称:wordpress_remaf,代码行数:35,代码来源:class-fw-extension-population-method-tags.php

示例2: fw_ext_events_render_map

 function fw_ext_events_render_map($post_id = 0)
 {
     if (0 === $post_id && null === ($post_id = get_the_ID())) {
         return null;
     }
     $fw_ext_events = fw()->extensions->get('events');
     if (empty($fw_ext_events)) {
         return null;
     }
     $post = get_post($post_id);
     if ($post->post_type !== $fw_ext_events->get_post_type_name()) {
         return null;
     }
     $shortcode_ext = fw()->extensions->get('shortcodes');
     if (empty($shortcode_ext)) {
         return null;
     }
     $shortcode_map = $shortcode_ext->get_shortcode('map');
     if (empty($shortcode_map)) {
         return null;
     }
     $options = fw_get_db_post_option($post->ID, $fw_ext_events->get_event_option_id());
     if (empty($options['event_location']['location']) or empty($options['event_location']['coordinates']['lat']) or empty($options['event_location']['coordinates']['lng'])) {
         return null;
     }
     return $shortcode_map->render_custom(array(array('title' => $post->post_title, 'url' => get_permalink($post->ID), 'description' => $options['event_location']['location'], 'thumb' => array('attachment_id' => get_post_thumbnail_id($post->ID)), 'location' => array('coordinates' => array('lat' => $options['event_location']['coordinates']['lat'], 'lng' => $options['event_location']['coordinates']['lng'])))), array('map_height' => false, 'map_type' => false));
 }
开发者ID:northpen,项目名称:project_11,代码行数:27,代码来源:helpers.php

示例3: fw_ext_portfolio_get_gallery_images

function fw_ext_portfolio_get_gallery_images($post_id = 0)
{
    if (0 === $post_id && null === ($post_id = get_the_ID())) {
        return array();
    }
    return fw_get_db_post_option($post_id, 'project-gallery', array());
}
开发者ID:northpen,项目名称:northpen,代码行数:7,代码来源:helpers.php

示例4: _theme_filter_remove_autop

 /**
  * Removes the autop filter if the post was created via the layout builder
  *
  * @internal
  */
 public function _theme_filter_remove_autop($content)
 {
     global $post;
     if (in_array($post->post_type, $this->get_config('supported_post_types'))) {
         $builder_meta = fw_get_db_post_option($post->ID, $this->builder_option_key);
         if ($builder_meta['builder_active']) {
             remove_filter('the_content', 'wpautop');
         }
     }
     return $content;
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:16,代码来源:class-fw-extension-layout-builder.php

示例5: get_frontend_data

 public function get_frontend_data($post_id)
 {
     $selected = fw_get_db_post_option($post_id, 'slider/selected');
     $population_method = fw_get_db_post_option($post_id, 'slider/' . $selected . '/population-method');
     $population_method_instance = $this->get_child('population-method-' . $population_method);
     if ($population_method_instance) {
         return $population_method_instance->get_frontend_data($post_id);
     } else {
         return array();
     }
 }
开发者ID:Archrom,项目名称:wordpress_remaf,代码行数:11,代码来源:class-fw-extension-population-method.php

示例6: get_frontend_data

 public function get_frontend_data($post_id)
 {
     $meta = fw_get_db_post_option($post_id);
     $post_status = get_post_status($post_id);
     $collector = array();
     if ('publish' === $post_status and isset($meta['populated'])) {
         $slider_name = $meta['slider']['selected'];
         $population_method = $meta['slider'][$slider_name]['population-method'];
         $collector = array('slides' => array(), 'settings' => array('title' => $meta['title'], 'slider_type' => $slider_name, 'population_method' => $population_method, 'post_id' => $post_id, 'extra' => isset($meta['custom-settings']) ? $meta['custom-settings'] : array()));
         foreach ($meta['custom-slides'] as $slide) {
             array_push($collector['slides'], array('title' => !empty($slide['title']) ? $slide['title'] : '', 'multimedia_type' => $slide['multimedia']['selected'], 'src' => $slide['multimedia']['selected'] === 'video' ? $slide['multimedia'][$slide['multimedia']['selected']]['src'] : $slide['multimedia'][$slide['multimedia']['selected']]['src']['url'], 'attachment_id' => $slide['multimedia']['selected'] === 'image' ? $slide['multimedia'][$slide['multimedia']['selected']]['src']['attachment_id'] : '', 'desc' => !empty($slide['desc']) ? $slide['desc'] : '', 'extra' => isset($slide['extra-options']) ? $slide['extra-options'] : array()));
         }
     }
     return $collector;
 }
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:15,代码来源:class-fw-extension-population-method-custom.php

示例7: get_frontend_data

 public function get_frontend_data($post_id)
 {
     $collector = array();
     $meta = fw_get_db_post_option($post_id);
     $post_status = get_post_status($post_id);
     if ('publish' === $post_status and isset($meta['populated'])) {
         $slider_name = $meta['slider']['selected'];
         $population_method = $meta['slider'][$slider_name]['population-method'];
         $posts_id = $meta['post_types'][$meta['post_types']['selected']]['posts_id'];
         $collector = array('slides' => array(), 'settings' => array('title' => $meta['title'], 'slider_type' => $slider_name, 'population_method' => $population_method, 'post_id' => $post_id, 'extra' => array()));
         $posts = get_posts(array('post_in' => $posts_id));
         foreach ($posts as $post) {
             setup_postdata($post);
             array_push($collector['slides'], array('title' => get_the_title(), 'src' => wp_get_attachment_url(get_post_thumbnail_id($post->ID)), 'desc' => get_the_excerpt(), 'extra' => array('post_id' => $post->ID)));
         }
         wp_reset_postdata();
     }
     return $collector;
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:19,代码来源:class-fw-extension-population-method-posts.php

示例8: starry_header

/**
 * STARRY HEADER
 * @internal
 */
function starry_header()
{
    if (!is_front_page()) {
        if (is_singular('portfolio')) {
            $projecttopfeatured = function_exists('fw_get_db_post_option') ? fw_get_db_post_option(get_the_ID(), 'projecttopfeatured') : '';
        }
        if (is_singular('post')) {
            $posttopfeatured = function_exists('fw_get_db_post_option') ? fw_get_db_post_option(get_the_ID(), 'posttopfeatured') : '';
        }
        echo '<!-- HEADER SLIDER -->';
        echo '<div class="flexslider" id="header-slider">';
        echo '<ul class="slides">';
        // IF HAS FEATURED IMAGE
        if (has_post_thumbnail() && is_page()) {
            $image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'single-post-thumbnail');
            echo '<li><img src="' . esc_url($image[0]) . '" alt="SLider Image"></li>';
        } elseif (is_singular('portfolio') && !empty($projecttopfeatured)) {
            echo '<li><img src="' . $projecttopfeatured['url'] . '" alt="SLider Image"></li>';
        } elseif (is_singular('post') && !empty($posttopfeatured)) {
            echo '<li><img src="' . $posttopfeatured['url'] . '" alt="SLider Image"></li>';
        } else {
            // GET DEFAULT ONE
            $defaultimage = function_exists('fw_get_db_settings_option') ? fw_get_db_settings_option('defaultimage') : '';
            if (!empty($defaultimage)) {
                echo '<li><img src="' . esc_url($defaultimage['url']) . '" alt="SLider Image"></li>';
            } else {
                echo '<li><img src="' . get_template_directory_uri() . '/images/dummy/bg1.jpg" alt="SLider Image"></li>';
            }
        }
        echo '</ul>';
        echo '</div>';
        // IF IT IS THE HOME PAGE, THERE IS 3 DIFFERENT CHOICES
    } else {
        $homerevslider = function_exists('fw_get_db_settings_option') ? fw_get_db_settings_option('homerevslider') : '';
        if ($homerevslider != true) {
            $homeheader_type = function_exists('fw_get_db_settings_option') ? fw_get_db_settings_option('homeheader_content') : '';
            // IF YOU CHOOSE SINGLE IMAGE
            if ($homeheader_type['gadget'] == "header_single") {
                echo '<!-- HEADER SLIDER -->';
                echo '<div class="flexslider" id="header-slider">';
                echo '<ul class="slides">';
                if (!empty($homeheader_type['header_single']['homesingleimage']['url'])) {
                    echo '<li><img src="' . esc_url($homeheader_type['header_single']['homesingleimage']['url']) . '" alt="SLider Image"></li>';
                } else {
                    echo '<li><img src="' . get_template_directory_uri() . '/images/dummy/bg1.jpg" alt="SLider Image"></li>';
                }
                echo '</ul>';
                echo '</div>';
            } elseif ($homeheader_type['gadget'] == "header_slider") {
                if ($homeheader_type['header_slider']['homeslidercontrol'] == true) {
                    echo '<!-- SLIDER NAVIGATION -->';
                    echo '<div class="navigation-slider-container">';
                    echo '<a href="#" id="sliderPrev"><i class="fa fa-arrow-left"></i></a>';
                    echo '<a href="#" id="sliderNext"><i class="fa fa-arrow-right"></i></a>';
                    echo '</div>';
                }
                echo '<!-- HEADER SLIDER -->';
                echo '<div class="flexslider" id="header-slider">';
                echo '<ul class="slides">';
                foreach ($homeheader_type['header_slider']['homesliderimages'] as $value_slider) {
                    echo '<li><img src="' . esc_url($value_slider['url']) . '" alt="slider image"></li>';
                }
                echo '</ul>';
                echo '</div>';
            } elseif ($homeheader_type['gadget'] == "header_video") {
                echo '<div id="header-video" ';
                echo 'data-vide-bg="';
                if (!empty($homeheader_type['header_video']['header_video_mp4']['url'])) {
                    // REMOVE THE EXTENSIO
                    echo 'mp4: ' . esc_url($homeheader_type['header_video']['header_video_mp4']['url']) . ', ';
                }
                if (!empty($homeheader_type['header_video']['header_video_ogv']['url'])) {
                    echo 'ogv: ' . esc_url($homeheader_type['header_video']['header_video_ogv']['url']) . ', ';
                }
                if (!empty($homeheader_type['header_video']['header_video_webm']['url'])) {
                    echo 'webm: ' . esc_url($homeheader_type['header_video']['header_video_webm']['url']) . ', ';
                } elseif (!empty($homeheader_type['header_video']['header_video_webm_link'])) {
                    echo 'webm: ' . esc_url($homeheader_type['header_video']['header_video_webm_link']) . ', ';
                }
                if (!empty($homeheader_type['header_video']['header_video_poster']['url'])) {
                    echo 'poster: ' . esc_url($homeheader_type['header_video']['header_video_poster']['url']) . '" ';
                }
                echo 'data-vide-options="posterType: jpg, loop: true, muted: true, position: 50% 50%">';
                echo '</div>';
            } else {
                echo '<!-- HEADER SLIDER -->';
                echo '<div class="flexslider" id="header-slider">';
                echo '<ul class="slides">';
                echo '<li><img src="' . get_template_directory_uri() . '/images/dummy/bg1.jpg" alt="SLider Image"></li>';
                echo '</ul>';
                echo '</div>';
            }
            // IF YOU CHOOSE THE REVOLUTION SLIDER
        } else {
            echo '<!-- HEADER SLIDER -->';
            echo '<div id="header-slider">';
//.........这里部分代码省略.........
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:101,代码来源:hooks.php

示例9: render_slider

 public function render_slider($post_id, $dimensions, $extra_data = array())
 {
     $slider_name = fw_get_db_post_option($post_id, $this->get_name() . '/selected');
     if (!is_null($slider_name)) {
         return $this->get_child($slider_name)->render_slider($post_id, $dimensions, $extra_data);
     }
 }
开发者ID:kvsemenoff,项目名称:proetis,代码行数:7,代码来源:class-fw-extension-slider.php

示例10: _action_calendar_export

 /**
  * @intenral
  */
 public function _action_calendar_export()
 {
     global $post;
     if (empty($post) or $post->post_type !== $this->post_type_name) {
         return;
     }
     if (FW_Request::GET('calendar')) {
         $calendar = FW_Request::GET('calendar');
         $row_id = FW_Request::GET('row_id');
         $offset = FW_Request::GET('offset');
         $options = fw_get_db_post_option($post->ID, $this->get_event_option_id());
         if (!is_array(fw_akg('event_children/' . $row_id, $options)) or !preg_match('/^\\d+$/', $row_id)) {
             wp_redirect(site_url() . '?error=404');
         }
         if (!preg_match('/^(\\-|\\d)\\d+$/', $offset)) {
             $offset = 0;
         }
         switch ($calendar) {
             case 'google':
                 wp_redirect($this->get_google_uri($post, $options, $row_id, $offset));
                 break;
             default:
                 $this->get_ics_headers($post);
                 echo $this->get_ics_content($post, $options, $row_id, $offset);
                 die;
         }
     }
 }
开发者ID:northpen,项目名称:project_11,代码行数:31,代码来源:class-fw-extension-events.php

示例11: get_content_slider

function get_content_slider()
{
    $slider = function_exists('fw_get_db_post_option') ? fw_get_db_post_option(get_the_ID(), 'tf_page_slider/tf_switch') : '';
    if ($slider === 'yes') {
        ?>
	<div class='page_slider'><?php 
        $value = fw_get_db_post_option(get_the_ID(), 'tf_page_slider/' . $slider);
        $slider_id = $value['tf_slider_content'];
        echo fw_ext('slider')->render_slider($slider_id, array('width' => 300, 'height' => 200));
        ?>
</div>
<?php 
    }
}
开发者ID:HilderH,项目名称:emprendamos,代码行数:14,代码来源:functions.php

示例12: get_header

<?php

/**
 * The Template for displaying all single posts
 */
get_header();
$header_image = defined('FW') ? fw_get_db_post_option($post->ID, 'header_post_image', fw_get_db_settings_option('header_post_image')) : '';
$header_color = defined('FW') ? fw_get_db_post_option($post->ID, 'header_post_color', fw_get_db_settings_option('header_post_color')) : '';
$header_pattern = defined('FW') ? fw_get_db_post_option($post->ID, 'header_post_pattern', fw_get_db_settings_option('header_post_pattern')) : '';
$header_title = defined('FW') ? esc_html(fw_get_db_post_option($post->ID, 'header_post_title', fw_get_db_settings_option('header_post_title'))) : '';
//show header image
fw_show_header($header_image, $header_color, $header_pattern, $header_title);
?>


<?php 
$sidebar_position = function_exists('fw_ext_sidebars_get_current_position') ? fw_ext_sidebars_get_current_position() : 'right';
?>
<section id="content" class="cols-a <?php 
echo $sidebar_position === 'left' ? 'news-e-left' : '';
?>
 <?php 
echo $sidebar_position == null || $sidebar_position == 'full' ? 'news-e-full' : '';
?>
">
    <div class="news-a">
        <?php 
while (have_posts()) {
    the_post();
    get_template_part('content', 'single');
    // If comments are open, load up the comment template.
开发者ID:setcomunicacao,项目名称:setdigital,代码行数:31,代码来源:single.php

示例13: get_populated_sliders

 public function get_populated_sliders()
 {
     $posts = get_posts(array('post_type' => $this->post_type, 'numberposts' => -1));
     foreach ($posts as $key => $post) {
         $meta = fw_get_db_post_option($post->ID);
         if (!isset($meta['populated'])) {
             unset($posts[$key]);
         }
     }
     return $posts;
 }
开发者ID:AdsonCicilioti,项目名称:Unyson,代码行数:11,代码来源:class-fw-extension-slider.php

示例14: while

    while (have_posts()) {
        the_post();
        if ($h > 0 && !is_float($h / 4)) {
            print $html_end_slider;
        }
        if (!is_float($h / 4)) {
            print $html_begin_slider;
        }
        print '<div class="col-md-3 team-single">';
        $image_id = get_post_thumbnail_id();
        $image_attributes_team = wp_get_attachment_image_src($image_id, 'full');
        print '<img src="' . esc_url($image_attributes_team[0]) . '" alt="' . get_the_title() . '" class="animate-me bounceIn">';
        print '<h3 class="center">' . get_the_title() . '</h3>';
        print the_excerpt();
        print '<ul class="social-list">';
        $teamoptions = function_exists('fw_get_db_post_option') ? fw_get_db_post_option(get_the_ID(), 'teamsocial') : '';
        foreach ($teamoptions as $valueteam) {
            print '<li><a href="' . esc_url($valueteam['teamsociallink']) . '"><i class="' . $valueteam['teamsocialicon'] . '"></i></a></li>';
        }
        print '</ul>';
        print '</div>';
        $h++;
    }
}
if ($h > 0) {
    echo $html_end_slider;
}
wp_reset_query();
?>
	</div>
开发者ID:alireza--noori,项目名称:initial-portfolio-website-test-,代码行数:30,代码来源:view.php

示例15: while

$wp_query = $custom_query;
$item_string = "";
/** The Loop **/
if ($custom_query->have_posts()) {
    $i = 1;
    while ($custom_query->have_posts()) {
        $custom_query->the_post();
        /** optional post divider **/
        if ($i != 1 && $show_divider == "Yes") {
            $item_string .= '<div class="fw-row blog-row"><div class="fw-col-md-12 full-width"><div class="post-divider"></div></div></div>';
        }
        $hidden_thumb = "";
        /** post options **/
        if (function_exists('fw_get_db_settings_option')) {
            $fullsize = fw_get_db_post_option(get_the_ID(), 'opt_fullsize');
            $subtitle = fw_get_db_post_option(get_the_ID(), 'opt_subtitle');
        } else {
            $fullsize = "No";
        }
        /**  Start Full width post **/
        if ($fullsize == "Yes" || $layout == "full-width") {
            include locate_template('archive-templates/full-width.php');
        } else {
            if ($layout == "image-left-50") {
                include locate_template('archive-templates/left-50.php');
            } else {
                if ($layout == "image-left-33") {
                    include locate_template('archive-templates/left-33.php');
                } else {
                    if ($layout == "image-right-50") {
                        include locate_template('archive-templates/right-50.php');
开发者ID:TheSaladFace,项目名称:Naked,代码行数:31,代码来源:view.php


注:本文中的fw_get_db_post_option函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。