本文整理汇总了PHP中get_page_uri函数的典型用法代码示例。如果您正苦于以下问题:PHP get_page_uri函数的具体用法?PHP get_page_uri怎么用?PHP get_page_uri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_page_uri函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: build_directory_list
function build_directory_list($roots, $option = array())
{
global $WikiName, $BracketName;
$list = $warnings = array();
$list['directory'] = $list['warning'] = array();
$pages = Auth::get_existpages();
foreach ($roots as $root) {
$matched = FALSE;
foreach ($pages as $page) {
// $page = strip_bracket($page);
// if (preg_match("/^$root.*$/", $page)){
if (strpos($page, $root) === 0) {
if (isset($option['directory only']) && $option['directory only'] && strrpos($page, '/') >= strlen($root)) {
$page = substr($page, 0, strrpos($page, '/'));
}
$list['directory'][] = $page;
while (strrpos($page, '/') >= strlen($root)) {
$page = substr($page, 0, strrpos($page, '/'));
$list['directory'][] = $page;
}
$matched = TRUE;
}
}
if (!$matched) {
$list['directory'][] = $root;
$warnings[] = '<p><span class="text-danger">' . sprintf(T_("#%s doesn't have the corresponding page. "), $root) . '</span>' . '(<a href="' . get_page_uri($root) . '">' . T_('making') . "</a>)</p>\n";
}
}
$list['directory'] = array_unique($list['directory']);
natcasesort($list['directory']);
if (isset($option['quiet']) && !$option['quiet']) {
$list['warning'] = $warnings;
}
return $list;
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:35,代码来源:newpage_subdir.inc.php
示例2: wc_update_200_permalinks
function wc_update_200_permalinks()
{
// Setup default permalinks if shop page is defined
$permalinks = get_option('woocommerce_permalinks');
$shop_page_id = wc_get_page_id('shop');
if (empty($permalinks) && $shop_page_id > 0) {
$base_slug = $shop_page_id > 0 && get_post($shop_page_id) ? get_page_uri($shop_page_id) : 'shop';
$category_base = get_option('woocommerce_prepend_shop_page_to_urls') == "yes" ? trailingslashit($base_slug) : '';
$category_slug = get_option('woocommerce_product_category_slug') ? get_option('woocommerce_product_category_slug') : _x('product-category', 'slug', 'woocommerce');
$tag_slug = get_option('woocommerce_product_tag_slug') ? get_option('woocommerce_product_tag_slug') : _x('product-tag', 'slug', 'woocommerce');
if ('yes' == get_option('woocommerce_prepend_shop_page_to_products')) {
$product_base = trailingslashit($base_slug);
} else {
if (($product_slug = get_option('woocommerce_product_slug')) !== false && !empty($product_slug)) {
$product_base = trailingslashit($product_slug);
} else {
$product_base = trailingslashit(_x('product', 'slug', 'woocommerce'));
}
}
if (get_option('woocommerce_prepend_category_to_products') == 'yes') {
$product_base .= trailingslashit('%product_cat%');
}
$permalinks = array('product_base' => untrailingslashit($product_base), 'category_base' => untrailingslashit($category_base . $category_slug), 'attribute_base' => untrailingslashit($category_base), 'tag_base' => untrailingslashit($category_base . $tag_slug));
update_option('woocommerce_permalinks', $permalinks);
}
}
开发者ID:Korkey128k,项目名称:woocommerce,代码行数:26,代码来源:wc-update-functions.php
示例3: pageParam
protected function pageParam($params)
{
global $post;
$name = array_shift($params);
$path = get_page_uri($post->ID) . '/' . $name;
return get_page_by_path($path);
}
开发者ID:elpadi,项目名称:wordpress-library,代码行数:7,代码来源:TilesInfo.php
示例4: jobman_flush_rewrite_rules
function jobman_flush_rewrite_rules()
{
global $wp_rewrite;
$wp_rewrite->feeds[] = 'jobman';
$options = get_option('jobman_options');
$root = get_page($options['main_page']);
$url = get_page_uri($root->ID);
if (!$url) {
return;
}
$lang = '';
// Hack to support WPML languages in the nice URL
if (defined('ICL_SITEPRESS_VERSION') && function_exists('icl_get_languages')) {
$languages = icl_get_languages('skip_missing=0');
if (!empty($languages)) {
$lang_arr = array();
foreach ($languages as $language) {
$lang_arr[] = $language['language_code'];
}
$lang = '(' . implode('|', $lang_arr) . ')/';
}
}
if (empty($lang)) {
$new_rules = array("{$url}/?([page]*/(\\d+)/?)?\$" => "index.php?jobman_root_id={$root->ID}" . '&page=$matches[2]', "{$url}/apply(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&jobman_page=apply&jobman_data=$matches[2]', "{$url}/register(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&jobman_page=register&jobman_data=$matches[2]', "{$url}/feed/?\$" => "index.php?feed=jobman", "{$url}/([^/]+)/?(page/(\\d+)/?)?\$" => 'index.php?jobman_data=$matches[1]' . '&page=$matches[3]');
} else {
$new_rules = array("({$lang})?{$url}/?([page]*/(\\d+)/?)?\$" => "index.php?jobman_root_id={$root->ID}" . '&lang=$matches[1]' . '&page=$matches[3]', "({$lang})?{$url}/apply(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&lang=$matches[1]' . '&jobman_page=apply&jobman_data=$matches[3]', "({$lang})?{$url}/register(/([^/]+))?/?\$" => "index.php?jobman_root_id={$root->ID}" . '&lang=$matches[1]' . '&jobman_page=register&jobman_data=$matches[3]', "({$lang})?{$url}/feed/?\$" => 'index.php?feed=jobman&lang=$matches[1]', "({$lang})?{$url}/([^/]+)/?(page/(\\d+)/?)?\$" => 'index.php?jobman_data=$matches[1]' . '&lang=$matches[2]' . '&page=$matches[4]');
}
if (array_key_exists('rewrite_rules', $options) && $options['rewrite_rules'] == $new_rules) {
return;
}
$options['rewrite_rules'] = $new_rules;
update_option('jobman_options', $options);
$wp_rewrite->flush_rules(false);
}
开发者ID:jazzindizzin,项目名称:Jampalan-Baru,代码行数:34,代码来源:frontend.php
示例5: plugin_tooltip_inline
function plugin_tooltip_inline()
{
$args = func_get_args();
$glossary = array_pop($args);
$term = array_shift($args);
// $glossary_page = count($args) ? array_shift($args) : '';
$glossary_page = '';
if ($glossary == '') {
$glossary = plugin_tooltip_get_glossary($term, $glossary_page, FALSE);
// $debug .= "B=$glossary/";
if ($glossary === FALSE) {
$glossary = plugin_tooltip_get_page_title($term);
if ($glossary === FALSE) {
$glossary = '';
}
}
}
$s_glossary = htmlspecialchars($glossary);
$page = strip_bracket($term);
if (is_page($page)) {
$url = get_page_uri($page);
$passage = get_pg_passage($page, FALSE);
return <<<EOD
<a href="{$url}" class="linktip" title="{$s_glossary}{$passage}">{$term}</a>
EOD;
} else {
return <<<EOD
<span class="tooltip" title="{$s_glossary}" onmouseover="javascript:this.style.backgroundColor='#ffe4e1';" onmouseout="javascript:this.style.backgroundColor='transparent';">{$term}</span>
EOD;
}
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:31,代码来源:tooltip.inc.php
示例6: jigoshop_post_type
/**
* Custom Post Types
**/
function jigoshop_post_type()
{
do_action('lox');
global $wpdb;
$shop_page_id = get_option('jigoshop_shop_page_id');
$base_slug = get_post($shop_page_id) && get_page_uri($shop_page_id) ? get_page_uri($shop_page_id) : 'shop';
if (get_option('jigoshop_prepend_shop_page_to_urls') == "yes") {
$category_base = trailingslashit($base_slug);
} else {
$category_base = '';
}
register_taxonomy('product_cat', array('product'), array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'labels' => array('name' => __('Product Categories', 'jigoshop'), 'singular_name' => __('Product Category', 'jigoshop'), 'search_items' => __('Search Product Categories', 'jigoshop'), 'all_items' => __('All Product Categories', 'jigoshop'), 'parent_item' => __('Parent Product Category', 'jigoshop'), 'parent_item_colon' => __('Parent Product Category:', 'jigoshop'), 'edit_item' => __('Edit Product Category', 'jigoshop'), 'update_item' => __('Update Product Category', 'jigoshop'), 'add_new_item' => __('Add New Product Category', 'jigoshop'), 'new_item_name' => __('New Product Category Name', 'jigoshop')), 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => $category_base . _x('product-category', 'slug', 'jigoshop'), 'with_front' => false)));
register_taxonomy('product_tag', array('product'), array('hierarchical' => false, 'labels' => array('name' => __('Product Tags', 'jigoshop'), 'singular_name' => __('Product Tag', 'jigoshop'), 'search_items' => __('Search Product Tags', 'jigoshop'), 'all_items' => __('All Product Tags', 'jigoshop'), 'parent_item' => __('Parent Product Tag', 'jigoshop'), 'parent_item_colon' => __('Parent Product Tag:', 'jigoshop'), 'edit_item' => __('Edit Product Tag', 'jigoshop'), 'update_item' => __('Update Product Tag', 'jigoshop'), 'add_new_item' => __('Add New Product Tag', 'jigoshop'), 'new_item_name' => __('New Product Tag Name', 'jigoshop')), 'show_ui' => true, 'query_var' => true, 'rewrite' => array('slug' => $category_base . _x('product-tag', 'slug', 'jigoshop'), 'with_front' => false)));
$attribute_taxonomies = jigoshop::$attribute_taxonomies;
if ($attribute_taxonomies) {
foreach ($attribute_taxonomies as $tax) {
$name = 'product_attribute_' . strtolower(sanitize_title($tax->attribute_name));
$hierarchical = true;
if ($name) {
register_taxonomy($name, array('product'), array('hierarchical' => $hierarchical, 'labels' => array('name' => $tax->attribute_name, 'singular_name' => $tax->attribute_name, 'search_items' => __('Search ', 'jigoshop') . $tax->attribute_name, 'all_items' => __('All ', 'jigoshop') . $tax->attribute_name, 'parent_item' => __('Parent ', 'jigoshop') . $tax->attribute_name, 'parent_item_colon' => __('Parent ', 'jigoshop') . $tax->attribute_name . ':', 'edit_item' => __('Edit ', 'jigoshop') . $tax->attribute_name, 'update_item' => __('Update ', 'jigoshop') . $tax->attribute_name, 'add_new_item' => __('Add New ', 'jigoshop') . $tax->attribute_name, 'new_item_name' => __('New ', 'jigoshop') . $tax->attribute_name), 'show_ui' => false, 'query_var' => true, 'show_in_nav_menus' => false, 'rewrite' => array('slug' => $category_base . strtolower(sanitize_title($tax->attribute_name)), 'with_front' => false, 'hierarchical' => $hierarchical)));
}
}
}
register_post_type("product", array('labels' => array('name' => __('Products', 'jigoshop'), 'singular_name' => __('Product', 'jigoshop'), 'add_new' => __('Add Product', 'jigoshop'), 'add_new_item' => __('Add New Product', 'jigoshop'), 'edit' => __('Edit', 'jigoshop'), 'edit_item' => __('Edit Product', 'jigoshop'), 'new_item' => __('New Product', 'jigoshop'), 'view' => __('View Product', 'jigoshop'), 'view_item' => __('View Product', 'jigoshop'), 'search_items' => __('Search Products', 'jigoshop'), 'not_found' => __('No Products found', 'jigoshop'), 'not_found_in_trash' => __('No Products found in trash', 'jigoshop'), 'parent' => __('Parent Product', 'jigoshop')), 'description' => __('This is where you can add new products to your store.', 'jigoshop'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'publicly_queryable' => true, 'exclude_from_search' => false, 'menu_position' => 57, 'hierarchical' => true, 'rewrite' => array('slug' => $base_slug, 'with_front' => false), 'query_var' => true, 'supports' => array('title', 'editor', 'thumbnail', 'comments'), 'has_archive' => $base_slug, 'show_in_nav_menus' => false));
register_taxonomy('product_type', array('product'), array('hierarchical' => false, 'show_ui' => false, 'query_var' => true, 'show_in_nav_menus' => false));
register_post_type("shop_order", array('labels' => array('name' => __('Orders', 'jigoshop'), 'singular_name' => __('Order', 'jigoshop'), 'add_new' => __('Add Order', 'jigoshop'), 'add_new_item' => __('Add New Order', 'jigoshop'), 'edit' => __('Edit', 'jigoshop'), 'edit_item' => __('Edit Order', 'jigoshop'), 'new_item' => __('New Order', 'jigoshop'), 'view' => __('View Order', 'jigoshop'), 'view_item' => __('View Order', 'jigoshop'), 'search_items' => __('Search Orders', 'jigoshop'), 'not_found' => __('No Orders found', 'jigoshop'), 'not_found_in_trash' => __('No Orders found in trash', 'jigoshop'), 'parent' => __('Parent Orders', 'jigoshop')), 'description' => __('This is where store orders are stored.', 'jigoshop'), 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'publicly_queryable' => false, 'exclude_from_search' => true, 'menu_position' => 58, 'hierarchical' => false, 'show_in_nav_menus' => false, 'rewrite' => false, 'query_var' => true, 'supports' => array('title', 'comments'), 'has_archive' => false));
register_taxonomy('shop_order_status', array('shop_order'), array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'labels' => array('name' => __('Order statuses', 'jigoshop'), 'singular_name' => __('Order status', 'jigoshop'), 'search_items' => __('Search Order statuses', 'jigoshop'), 'all_items' => __('All Order statuses', 'jigoshop'), 'parent_item' => __('Parent Order status', 'jigoshop'), 'parent_item_colon' => __('Parent Order status:', 'jigoshop'), 'edit_item' => __('Edit Order status', 'jigoshop'), 'update_item' => __('Update Order status', 'jigoshop'), 'add_new_item' => __('Add New Order status', 'jigoshop'), 'new_item_name' => __('New Order status Name', 'jigoshop')), 'show_ui' => false, 'show_in_nav_menus' => false, 'query_var' => true, 'rewrite' => false));
if (get_option('jigowatt_update_rewrite_rules') == '1') {
// Re-generate rewrite rules
global $wp_rewrite;
$wp_rewrite->flush_rules();
update_option('jigowatt_update_rewrite_rules', '0');
}
}
开发者ID:kdzwinel,项目名称:Jigoshop,代码行数:37,代码来源:jigoshop_taxonomy.php
示例7: custom_init
function custom_init()
{
global $template_directory;
require $template_directory . '/inc/classes/bfi-thumb.php';
require $template_directory . '/inc/classes/custom-post-type.php';
require $template_directory . '/inc/classes/category-dropdown-url-walker.php';
if (function_exists('get_field')) {
$work_uri = get_page_uri(get_field('work_page', 'options'));
$family_uri = get_page_uri(get_field('family_page', 'options'));
//Works custom post type
if ($work_uri) {
$works = new Custom_Post_Type('Work', array('rewrite' => array('with_front' => false, 'slug' => $work_uri), 'capability_type' => 'post', 'publicly_queryable' => true, 'has_archive' => true, 'hierarchical' => true, 'menu_position' => null, 'menu_icon' => 'dashicons-admin-generic', 'supports' => array('title', 'editor', 'thumbnail'), 'plural' => "Work"));
$works->register_taxonomy("Client", array('name' => 'client', 'rewrite' => array('slug' => 'clients')), array('plural' => "Clients"));
$works->register_post_type();
}
//Family custom post type
if ($family_uri) {
$family = new Custom_Post_Type('Family', array('rewrite' => array('with_front' => false, 'slug' => $family_uri), 'capability_type' => 'post', 'publicly_queryable' => true, 'has_archive' => false, 'hierarchical' => true, 'menu_position' => null, 'menu_icon' => 'dashicons-admin-users', 'supports' => array('title', 'editor', 'thumbnail'), 'plural' => "Family"));
$family->register_taxonomy("Family Category", array('name' => 'family_cat', 'rewrite' => array('slug' => 'family-category')), array('plural' => "Family Categories"));
$family->register_post_type();
}
//Slides custom post type
$slides = new Custom_Post_Type('Slides', array('rewrite' => array('with_front' => false, 'slug' => 'slides'), 'capability_type' => 'post', 'publicly_queryable' => true, 'has_archive' => true, 'hierarchical' => true, 'menu_position' => null, 'menu_icon' => 'dashicons-format-gallery', 'supports' => array('title', 'editor', 'thumbnail'), 'plural' => "Slides"));
$slides->register_post_type();
}
}
开发者ID:kishandchips,项目名称:thebankcorporate,代码行数:26,代码来源:functions.php
示例8: test_get_page_uri_without_argument
/**
* @ticket 26284
*/
function test_get_page_uri_without_argument()
{
$post_id = self::factory()->post->create(array('post_title' => 'Blood Orange announces summer tour dates', 'post_name' => 'blood-orange-announces-summer-tour-dates'));
$post = get_post($post_id);
$this->go_to(get_permalink($post_id));
$this->assertEquals('blood-orange-announces-summer-tour-dates', get_page_uri());
}
开发者ID:atimmer,项目名称:wordpress-develop-mirror,代码行数:10,代码来源:getPageUri.php
示例9: save
function save()
{
parent::save();
$course_permalink = $_POST['learn_press_course_base'];
if ($course_permalink == 'custom') {
// Get permalink without slashes
$course_permalink = trim($_POST['course_permalink_structure'], '/');
// This is an invalid base structure and breaks pages
if ('%course_category%' == $course_permalink) {
$course_permalink = _x('courses', 'slug', 'learn_press') . '/' . $course_permalink;
}
// Prepending slash
$course_permalink = '/' . $course_permalink;
} elseif (empty($course_permalink)) {
$course_permalink = false;
}
$course_base = untrailingslashit($course_permalink);
update_option('learn_press_course_base', $course_base);
// Shop base may require verbose page rules if nesting pages
$courses_page_id = learn_press_get_page_id('courses');
$courses_permalink = $courses_page_id > 0 && get_post($courses_page_id) ? get_page_uri($courses_page_id) : _x('courses', 'default-slug', 'learn_press');
if ($courses_page_id && trim($course_base, '/') === $courses_permalink) {
update_option('learn_press_use_verbose_page_rules', 'yes');
} else {
delete_option('learn_press_use_verbose_page_rules');
}
}
开发者ID:thonysmith,项目名称:LearnPress,代码行数:27,代码来源:class-lp-settings-courses.php
示例10: register_post_type
/**
* Register Post Type
* @since 1.0.0
*/
public static function register_post_type()
{
$archive_page_id = documentate_get_option('archive_page_id');
$document_permalink = documentate_get_option('document_base');
$labels = array('name' => __('Documents', 'documentate'), 'singular_name' => __('Document', 'documentate'), 'all_items' => __('Documents', 'documentate'), 'add_new' => __('New Document', 'documentate'), 'add_new_item' => __('Add New Document', 'documentate'), 'edit_item' => __('Edit Document', 'documentate'), 'new_item' => __('New Document', 'documentate'), 'view_item' => __('View Document', 'documentate'), 'search_items' => __('Search Documents', 'documentate'), 'not_found' => __('Nothing found', 'documentate'), 'not_found_in_trash' => __('Nothing found in Trash', 'documentate'), 'parent_item_colon' => '');
$args = apply_filters('documentate_post_type_args', array('labels' => $labels, 'description' => __('This is where you can add new documents to your knowledgebase.', 'documentate'), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'query_var' => true, 'menu_icon' => 'dashicons-book-alt', 'capability_type' => 'post', 'hierarchical' => false, 'supports' => array('title', 'editor', 'thumbnail', 'tags', 'revisions', 'excerpt'), 'rewrite' => $document_permalink ? array('slug' => untrailingslashit($document_permalink), 'with_front' => false, 'feeds' => true) : false, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'can_export' => true, 'has_archive' => $archive_page_id && get_post($archive_page_id) ? get_page_uri($archive_page_id) : false, 'exclude_from_search' => true));
register_post_type('document', $args);
}
开发者ID:helgatheviking,项目名称:Documentate,代码行数:12,代码来源:class-docu-post-type.php
示例11: tb_blog_url
function tb_blog_url()
{
if ($posts_page_id = get_option('page_for_posts')) {
return home_url(get_page_uri($posts_page_id));
} else {
return home_url();
}
}
开发者ID:allenahner,项目名称:wp,代码行数:8,代码来源:theme-functions.php
示例12: init_taxonomy
/**
* init_taxonomy function.
*
* @access public
*/
function init_taxonomy()
{
global $woocommerce;
$shop_page_id = woocommerce_get_page_id('shop');
$base_slug = $shop_page_id > 0 && get_page($shop_page_id) ? get_page_uri($shop_page_id) : 'shop';
$category_base = get_option('woocommerce_prepend_shop_page_to_urls') == "yes" ? trailingslashit($base_slug) : '';
register_taxonomy('product_brand', array('product'), apply_filters('register_taxonomy_product_brand', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Brands', 'wc_brands'), 'labels' => array('name' => __('Brands', 'wc_brands'), 'singular_name' => __('Brand', 'wc_brands'), 'search_items' => __('Search Brands', 'wc_brands'), 'all_items' => __('All Brands', 'wc_brands'), 'parent_item' => __('Parent Brand', 'wc_brands'), 'parent_item_colon' => __('Parent Brand:', 'wc_brands'), 'edit_item' => __('Edit Brand', 'wc_brands'), 'update_item' => __('Update Brand', 'wc_brands'), 'add_new_item' => __('Add New Brand', 'wc_brands'), 'new_item_name' => __('New Brand Name', 'wc_brands')), 'show_ui' => true, 'show_in_nav_menus' => true, 'capabilities' => array('manage_terms' => 'manage_woocommerce_products', 'edit_terms' => 'manage_woocommerce_products', 'delete_terms' => 'manage_woocommerce_products', 'assign_terms' => 'manage_woocommerce_products'), 'rewrite' => array('slug' => $category_base . __('brand', 'wc_brands'), 'with_front' => false, 'hierarchical' => true))));
}
开发者ID:iplaydu,项目名称:Bob-Ellis-Shoes,代码行数:13,代码来源:class-wc-brands.php
示例13: addBlogPage
public function addBlogPage($default_title = null)
{
$show_on_front = get_option('show_on_front');
$blog_page = get_option('page_for_posts');
if ($show_on_front == 'page') {
$posts_page = get_post($blog_page);
$this->entries[] = array('title' => !is_null($default_title) ? $default_title : $posts_page->post_title, 'url' => get_home_url() . '/' . get_page_uri($blog_page));
}
}
开发者ID:e-picas,项目名称:wp-basic-bootstrap,代码行数:9,代码来源:WP_Basic_Bootstrap_Breadcrumb.php
示例14: gw_get_post_paths
function gw_get_post_paths($post_type = "")
{
$results = array();
$query = new WP_Query(array('post_type' => $post_type, 'post_status' => 'publish', 'posts_per_page' => -1, 'update_post_term_cache' => false));
foreach ($query->posts as $post) {
$results[$post->post_type . '/' . get_page_uri($post->ID)] = array('id' => $post->ID, 'checksum' => get_post_meta($post->ID, 'gwcs', true));
}
return $results;
}
开发者ID:ravasthi,项目名称:web-base-template,代码行数:9,代码来源:grunt-wordpress.php
示例15: front_page_url
public function front_page_url($lang)
{
if ($this->options['hide_default'] && $lang->slug == $this->options['default_lang']) {
return trailingslashit($this->home);
}
$url = home_url($this->root . get_page_uri($lang->page_on_front));
$url = $this->use_trailing_slashes ? trailingslashit($url) : untrailingslashit($url);
return $this->options['force_lang'] ? $this->add_language_to_link($url, $lang) : $url;
}
开发者ID:iq007,项目名称:MadScape,代码行数:9,代码来源:links-permalinks.php
示例16: dhwc_init_taxonomy
function dhwc_init_taxonomy()
{
global $woocommerce;
$permalinks = get_option('woocommerce_permalinks');
$shop_page_id = woocommerce_get_page_id('shop');
$base_slug = $shop_page_id > 0 && get_post($shop_page_id) ? get_page_uri($shop_page_id) : 'shop';
$product_brand_slug = empty($permalinks['brand_base']) ? _x('product-brand', 'slug', DHVC_WOO) : $permalinks['brand_base'];
register_taxonomy('product_brand', apply_filters('dhwc_taxonomy_objects_product_brand', array('product')), apply_filters('dhwc_taxonomy_args_product_brand', array('hierarchical' => true, 'update_count_callback' => '_update_post_term_count', 'label' => __('Product Brands', DHVC_WOO), 'labels' => array('name' => __('Product Brands', DHVC_WOO), 'singular_name' => __('Product Brand', DHVC_WOO), 'menu_name' => _x('Brands', 'Admin menu name', DHVC_WOO), 'search_items' => __('Search Product Brands', DHVC_WOO), 'all_items' => __('All Product Brands', DHVC_WOO), 'parent_item' => __('Parent Product Brand', DHVC_WOO), 'parent_item_colon' => __('Parent Product Brand:', DHVC_WOO), 'edit_item' => __('Edit Product Brand', DHVC_WOO), 'update_item' => __('Update Product Brand', DHVC_WOO), 'add_new_item' => __('Add New Product Brand', DHVC_WOO), 'new_item_name' => __('New Product Brand Name', DHVC_WOO)), 'show_ui' => true, 'show_in_nav_menus' => true, 'query_var' => true, 'capabilities' => array('manage_terms' => 'manage_product_terms', 'edit_terms' => 'edit_product_terms', 'delete_terms' => 'delete_product_terms', 'assign_terms' => 'assign_product_terms'), 'rewrite' => array('slug' => $product_brand_slug, 'with_front' => false, 'hierarchical' => true))));
}
开发者ID:jmead,项目名称:trucell-cms,代码行数:9,代码来源:dhwc-brand.php
示例17: plugin_back_convert
function plugin_back_convert()
{
$_msg_back_word = _('Back');
if (func_num_args() > 4) {
return PLUGIN_BACK_USAGE;
}
list($word, $align, $hr, $href) = array_pad(func_get_args(), 4, '');
$word = trim($word);
$word = $word == '' ? $_msg_back_word : htmlspecialchars($word);
$align = strtolower(trim($align));
switch ($align) {
case '':
$align = 'center';
/*FALLTHROUGH*/
/*FALLTHROUGH*/
case 'center':
/*FALLTHROUGH*/
/*FALLTHROUGH*/
case 'left':
/*FALLTHROUGH*/
/*FALLTHROUGH*/
case 'right':
break;
default:
return PLUGIN_BACK_USAGE;
}
$hr = trim($hr) != '0' ? '<hr class="full_hr" />' . "\n" : '';
$link = TRUE;
$href = trim($href);
if ($href != '') {
if (PLUGIN_BACK_ALLOW_PAGELINK) {
if (is_url($href)) {
$href = rawurlencode($href);
} else {
$array = anchor_explode($href);
$array[1] = $array[1] != '' ? '#' . rawurlencode($array[1]) : '';
$href = get_page_uri($array[0]) . $array[1];
$link = is_page($array[0]);
}
} else {
$href = rawurlencode($href);
}
} else {
if (!PLUGIN_BACK_ALLOW_JAVASCRIPT) {
return PLUGIN_BACK_USAGE . ': Set a page name or an URI';
}
$href = 'javascript:history.go(-1)';
}
if ($link) {
// Normal link
return $hr . '<div style="text-align:' . $align . '">' . '[ <a href="' . $href . '">' . $word . '</a> ]</div>' . "\n";
} else {
// Dangling link
return $hr . '<div style="text-align:' . $align . '">' . '[ <span class="noexists">' . $word . '<a href="' . $href . '">?</a></span> ]</div>' . "\n";
}
}
开发者ID:aterai,项目名称:pukiwiki-plus-i18n,代码行数:56,代码来源:back.inc.php
示例18: bh_get_page_path
function bh_get_page_path(&$p = null, $current = false)
{
if (empty($p) && $current) {
global $post, $bh_hierarchy;
if (!empty($bh_hierarchy)) {
$h = $bh_hierarchy;
$p = array_pop($h);
if (defined('DEBUG_PATHS') && DEBUG_PATHS) {
do_action('log', 'get_page_path: Reverting to hierarchy top', $p);
}
} else {
if (!is_search()) {
$p = $post;
if (defined('DEBUG_PATHS') && DEBUG_PATHS) {
do_action('log', 'get_page_path: Reverting to global post', $post);
}
}
}
}
if (is_object($p) && !empty($p->_page_path)) {
if (defined('DEBUG_PATHS') && DEBUG_PATHS) {
do_action('log', 'get_page_path: Stored page path', $p->_page_path);
}
return $p->_page_path;
}
if (!empty($p) && 'page' === $p->post_type) {
$page_id = bh_select_post_id($p);
$path = get_page_uri($page_id);
if (defined('DEBUG_PATHS') && DEBUG_PATHS) {
do_action('log', 'get_page_path: Page URI', $path);
}
}
if (empty($path) || is_numeric($path)) {
if (!empty($p) || !is_search()) {
$permalink = get_permalink($p);
$path = substr(get_permalink(bh_select_post_id($p)), strlen(get_option('home')));
$path = trim($path, '/');
if (defined('DEBUG_PATHS') && DEBUG_PATHS) {
do_action('log', 'get_page_path: Permalink', $path);
}
}
}
if ($current && empty($path)) {
$path = $_SERVER['REQUEST_URI'];
$path = preg_replace('!^https?://[^/]+/!i', '', $path);
$path = preg_replace('!\\?.*$!i', '', $path);
$path = trim($path, '/');
if (defined('DEBUG_PATHS') && DEBUG_PATHS) {
do_action('log', 'get_page_path: Hard URI', $path);
}
}
if (is_object($p)) {
$p->_page_path = $path;
}
return $path;
}
开发者ID:diddledan,项目名称:wp-a-z-listing,代码行数:56,代码来源:resources.php
示例19: prepare_post
/**
* Prepare post data
*
* @param array $post The unprepared post data
* @param array $fields The subset of post type fields to return
* @return array The prepared post data
*/
protected function prepare_post($post, $context = 'view')
{
$_post = parent::prepare_post($post, $context);
// Override entity meta keys with the correct links
$_post['meta']['links']['self'] = json_url($this->base . '/' . get_page_uri($post['ID']));
if (!empty($post['post_parent'])) {
$_post['meta']['links']['up'] = json_url($this->base . '/' . get_page_uri((int) $post['post_parent']));
}
return apply_filters('json_prepare_page', $_post, $post, $context);
}
开发者ID:ntwb,项目名称:BB-API,代码行数:17,代码来源:class-bbp-json-replies.php
示例20: plugin_yetlist_action
function plugin_yetlist_action()
{
// global $_title_yetlist, $_err_notexist, $_symbol_noexists, $non_list;
global $_symbol_noexists, $non_list, $whatsdeleted;
$retval = array('msg' => 'yetlist', 'body' => T_('List of pages which have not yet been created.'));
// Diff
$pages = array_diff(Auth::get_existpages(CACHE_DIR, '.ref'), Auth::get_existpages());
if (empty($pages)) {
$retval['body'] = T_('All pages have been created.');
return $retval;
}
$empty = TRUE;
// Load .ref files and Output
$refer_regex = '/' . $non_list . '|^' . preg_quote($whatsdeleted, '/') . '$/S';
asort($pages, SORT_STRING);
foreach ($pages as $file => $page) {
$refer = array();
foreach (file(CACHE_DIR . $file) as $line) {
list($_page) = explode("\t", rtrim($line));
$refer[] = $_page;
}
// Diff
$refer = array_diff($refer, preg_grep($refer_regex, $refer));
if (!empty($refer)) {
$empty = FALSE;
$refer = array_unique($refer);
sort($refer, SORT_STRING);
$r_refer = '';
$link_refs = array();
foreach ($refer as $_refer) {
$r_refer = rawurlencode($_refer);
$link_refs[] = '<a href="' . get_page_uri($_refer) . '">' . htmlsc($_refer) . '</a>';
}
$link_ref = join(' ', $link_refs);
unset($link_refs);
$s_page = htmlsc($page);
// if (PKWK_READONLY) {
if (Auth::check_role('readonly')) {
$href = $s_page;
} else {
// Dangling link
$href = '<span class="noexists">' . $s_page . '<a href="' . get_cmd_uri('edit', $page, '', 'refer=' . $r_refer) . '">' . $_symbol_noexists . '</a></span>';
}
$retval['body'] .= '<li>' . $href . ' <em>(' . $link_ref . ')</em></li>' . "\n";
}
}
if ($empty) {
$retval['body'] = $_err_notexist;
return $retval;
}
if ($retval['body'] != '') {
$retval['body'] = '<ul>' . "\n" . $retval['body'] . '</ul>' . "\n";
}
return $retval;
}
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:55,代码来源:yetlist.inc.php
注:本文中的get_page_uri函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论