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


PHP get_query_template函数代码示例

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


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

示例1: template_include

 /**
  * @hook
  */
 public function template_include($template)
 {
     if (!apply_filters('metis.auth.is_forbidden', false)) {
         return $template;
     }
     return get_query_template('403');
 }
开发者ID:ssnepenthe,项目名称:metis,代码行数:10,代码来源:Auth.php

示例2: portfoliopress_template_chooser

/**
 * Overrides the default behavior of portfolio taxonomies to use the archive-portfolio template
 * http://www.billerickson.net/reusing-wordpress-theme-files/
 *
 * @param string template path
 */
function portfoliopress_template_chooser($template)
{
    global $wp_query;
    $portfolio = false;
    // Check if the taxonomy query contains only image or gallery post formats
    if (is_category() || is_tag() || is_home()) {
        $portfolio = true;
        if ($wp_query->have_posts()) {
            while ($wp_query->have_posts()) {
                $wp_query->the_post();
                $format = get_post_format();
                if ($format !== 'image' && $format != 'gallery') {
                    $portfolio = false;
                }
            }
        }
    }
    // Check if template should be displayed as archive-portfolio.php
    if (is_post_type_archive('portfolio') || is_tax('post_format', 'post-format-image') || is_tax('post_format', 'post-format-gallery') || is_tax('portfolio_category') || is_tax('portfolio_tag')) {
        $portfolio = true;
    }
    // Use the archive-portfolio.php template
    if ($portfolio) {
        $wp_query->set('portfolio_view', true);
        $template = get_query_template('archive-portfolio');
    }
    return $template;
}
开发者ID:cherylabu,项目名称:portfolio-press,代码行数:34,代码来源:portfolio-helpers.php

示例3: euzakupki_add_manual_funds_result

/**
 * @param $request
 */
function euzakupki_add_manual_funds_result($request)
{
    if (!current_user_can('manage_options')) {
        global $wp_query;
        $wp_query->is_404 = true;
        $wp_query->is_single = false;
        $wp_query->is_page = false;
        include get_query_template('404');
        exit;
    }
    global $wpdb;
    $customer = $wpdb->get_row('select * from wp_users where id = ' . $request['customer']);
    if (!$customer) {
        print_r(__('Клиент не найден', 'euzakupki'));
        exit;
    }
    if (empty($request['customer']) or !is_numeric($request['customer'])) {
        print_r(__('Параметр customer должен быть числом', 'euzakupki'));
        exit;
    }
    $customer_balance = get_user_meta($request['customer'], 'balance', true);
    if (!$customer_balance) {
        print_r(__('Баланс клиента не определен', 'euzakupki'));
        exit;
    }
    @($customer_balance = preg_replace('!s:(\\d+):"(.*?)";!e', "'s:'.strlen('\$2').':\"\$2\";'", $customer_balance));
    $customer_balance = unserialize($customer_balance);
    $customer_balance = array_reverse($customer_balance);
    print_r(sprintf(__('ID клиента: %s' . "<br />", 'euzakupki'), $customer->ID));
    print_r(sprintf(__('Емал: %s' . "<br />", 'euzakupki'), $customer->user_email));
    print_r(sprintf(__('Дата и время пополнения: %s' . "<br />", 'euzakupki'), $customer_balance[0]['date']));
    print_r(sprintf(__('Зачислена сумма: %s' . "<br />", 'euzakupki'), $customer_balance[0]['amount']));
    exit;
}
开发者ID:nozhko-i,项目名称:euzakupy,代码行数:37,代码来源:customer-add-funds.php

示例4: euzakupki_get_transactions

/**
 * @param $request
 */
function euzakupki_get_transactions($request)
{
    if (!current_user_can('manage_options')) {
        global $wp_query;
        $wp_query->is_404 = true;
        $wp_query->is_single = false;
        $wp_query->is_page = false;
        include get_query_template('404');
        exit;
    }
    global $wpdb;
    $customer = $wpdb->get_row('select * from wp_users where id = ' . $request['customer']);
    if (!$customer) {
        print_r(__('Клиент не найден', 'euzakupki'));
        exit;
    }
    if (empty($request['customer']) or !is_numeric($request['customer'])) {
        print_r(__('Параметр customer должен быть числом', 'euzakupki'));
        exit;
    }
    $customer_balance = get_user_meta($request['customer'], 'balance', true);
    $customer_balance = unserialize($customer_balance);
    debug($customer_balance);
    exit;
}
开发者ID:nozhko-i,项目名称:euzakupy,代码行数:28,代码来源:customer-transactions.php

示例5: archive_template

/**
 * Make a 'reference' archive a thing in the template hierarchy.
 *
 * @param  string $template The current template chosen.
 * @return string           The template to use for this view.
 */
function archive_template($template)
{
    if (!is_search() && !is_feed() && 'reference' === get_query_var('custom_archive')) {
        $archive_template = get_query_template('archive', array('archive-reference.php', 'archive.php'));
        $template = $archive_template ? $archive_template : $template;
    }
    return $template;
}
开发者ID:lkwdwrd,项目名称:wp-doc-parser-post-types,代码行数:14,代码来源:templates.php

示例6: load_query_template

function load_query_template($type, $templates = array())
{
    $located = get_query_template($type, $templates);
    if (!empty($located)) {
        load_template($located);
    } else {
        Core::log('Unable to locate template part \'' . $type . '\'.');
    }
}
开发者ID:vinerz,项目名称:yogo,代码行数:9,代码来源:templateloaders.php

示例7: get_footer

function get_footer()
{
    $template = get_query_template('footer');
    if (!empty($template)) {
        load_template($template, true);
    } else {
        Core::log('Footer file missing for theme', YG_WARNING);
    }
}
开发者ID:vinerz,项目名称:yogo,代码行数:9,代码来源:templatemanager.php

示例8: redirect_404

 /**
  * Redirect the current query to WoordPress' 404 template.
  *
  * @global WP_Query $wp_query
  *
  * @uses get_query_template()
  */
 public static function redirect_404()
 {
     // Display a 404 page since we don't have overviews
     global $wp_query;
     $wp_query->is_404 = true;
     $wp_query->is_single = false;
     $wp_query->is_page = false;
     include get_query_template('404');
     exit;
 }
开发者ID:Neminath,项目名称:lastmile,代码行数:17,代码来源:SEOSlides_Util.php

示例9: szub_search_custom_template

function szub_search_custom_template($template)
{
    if (is_search() && szub_is_search_key() && file_exists(get_template_directory() . '/search-transcript.php')) {
        $template = get_template_directory() . '/search-transcript.php';
    }
    if (!$template) {
        $template = get_query_template('search');
    }
    return $template;
}
开发者ID:johnbintz,项目名称:comicpress-2.8,代码行数:10,代码来源:searchcustomfields.php

示例10: tw_print_template

function tw_print_template($template)
{
    if (!tw_is_print()) {
        return $template;
    }
    // use the theme's print.php if it exists
    $template = get_query_template('print');
    if (!$template) {
        $template = dirname(__FILE__) . '/print.php';
    }
    return $template;
}
开发者ID:gopinathshiva,项目名称:wordpress-vip-plugins,代码行数:12,代码来源:tw-print.php

示例11: vendor_page_template

 public function vendor_page_template($page_template)
 {
     if (is_page('vendor')) {
         $username = get_query_var('username');
         if (isset($username) && get_user_by('login', $username)) {
             $page_template = dirname(__FILE__) . '/views/vendor-page-template.php';
         } else {
             $page_template = get_query_template('404');
         }
     }
     if (is_page('vendors')) {
         $page_template = dirname(__FILE__) . '/views/vendor-search-template.php';
     }
     return $page_template;
 }
开发者ID:jrald1291,项目名称:atu,代码行数:15,代码来源:class-wepn-profile.php

示例12: xsbf_is_fullwidth

 function xsbf_is_fullwidth()
 {
     /* for pages, check the page template */
     if (is_page() and (+is_page_template('page-fullpostsnoheader.php') or +is_page_template('page-fullwidth-noheader.php') or +is_page_template('page-fullwidth.php') or +is_page_template('page-fullwithposts.php') or +is_page_template('page-fullwithsubpages.php'))) {
         return true;
         /* for posts, check the single template */
     } elseif (is_single()) {
         $current_template = get_single_template();
         $fullwidth_template = get_query_template('single-fullwidth');
         if ($current_template and $current_template == $fullwidth_template) {
             return true;
         }
     }
     return false;
 }
开发者ID:vedcraft,项目名称:vedcraft-theme,代码行数:15,代码来源:theme-functions.php

示例13: force_404

function force_404()
{
    if (!is_admin()) {
        if (!is_home() && !is_page('about') && !is_page('random')) {
            $current_user = wp_get_current_user();
            global $post;
            $author_id = $post->post_author;
            if (is_single() && $current_user->ID != $author_id) {
                status_header(404);
                nocache_headers();
                include get_query_template('404');
                die;
                //motherfucker
            }
        }
    }
}
开发者ID:nagueva,项目名称:mayfly.link,代码行数:17,代码来源:functions.php

示例14: GetPostTemplate

 protected function GetPostTemplate($post)
 {
     $id = $post->ID;
     $template = get_page_template_slug($id);
     $pagename = $post->post_name;
     $templates = array();
     if ($template && 0 === validate_file($template)) {
         $templates[] = $template;
     }
     if ($pagename) {
         $templates[] = "page-{$pagename}.php";
     }
     if ($id) {
         $templates[] = "page-{$id}.php";
     }
     $templates[] = 'page.php';
     return get_query_template('page', $templates);
 }
开发者ID:Anciela,项目名称:anciela.info,代码行数:18,代码来源:Content.php

示例15: store_template

 /**
  * Include store template
  *
  * @param type $template
  * @return string
  */
 function store_template($template)
 {
     $store_name = get_query_var('store');
     if (!empty($store_name)) {
         $store_user = get_user_by('slug', $store_name);
         // no user found
         if (!$store_user) {
             return get_404_template();
         }
         // check if the user is seller
         if (!dokan_is_user_seller($store_user->ID)) {
             return get_404_template();
         }
         $templates = array("store-{$store_name}.php", 'store.php');
         return get_query_template('store', $templates);
     }
     return $template;
 }
开发者ID:uwitec,项目名称:findgreatmaster,代码行数:24,代码来源:rewrites.php


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