本文整理汇总了PHP中create_initial_taxonomies函数的典型用法代码示例。如果您正苦于以下问题:PHP create_initial_taxonomies函数的具体用法?PHP create_initial_taxonomies怎么用?PHP create_initial_taxonomies使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_initial_taxonomies函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
function setUp()
{
parent::setUp();
create_initial_taxonomies();
$this->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
$this->home_url = get_option('home');
}
示例2: WpsPlugin
function WpsPlugin()
{
global $wps_subdomains, $wps_this_subdomain, $wps_category_base, $wps_showall_pages, $wps_permalink_set;
// Stuff changed in WP 2.8
if (function_exists('create_initial_taxonomies')) {
create_initial_taxonomies();
}
//--- Create the SubDomains Object
$wps_subdomains = new WpsSubDomains();
//--- Grab This Subdomain object (if we're on one)
$wps_this_subdomain = $wps_subdomains->getThisSubdomain();
//--- Grab all the Pages with the Show On All override
$wps_showall_pages = wps_showall_pages();
//--- Set the category base global
if (get_option('category_base')) {
$wps_category_base = get_option('category_base') . '/';
} else {
$wps_category_base = 'category/';
}
//--- Check permalinks are setup
if (get_option('permalink_structure')) {
$wps_permalink_set = true;
}
//--- Add Admin Menu Pages
add_action('admin_menu', 'wps_add_options');
// If the permalink is configured then we can setup everything else
if ($wps_permalink_set && get_option(WPS_OPT_DISABLED) == '') {
//--- Add the Actions
$this->addActions();
//--- Add the Filters
$this->addFilters();
}
// this action can't be in addActions because the admin interface doesn't work without it.
add_action('admin_init', 'wps_admin_init');
}
示例3: setUp
function setUp() {
parent::setUp();
update_option( 'page_comments', true );
update_option( 'comments_per_page', 5 );
update_option( 'posts_per_page', 5 );
update_option( 'permalink_structure', $this->structure );
create_initial_taxonomies();
$GLOBALS['wp_rewrite']->init();
flush_rewrite_rules();
$this->old_current_user = get_current_user_id();
$this->author_id = $this->factory->user->create( array( 'user_login' => 'canonical-author' ) );
wp_set_current_user( $this->author_id );
// Already created by install defaults:
// $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'uncategorized' ) );
$this->term_ids = array();
$this->factory->post->create( array( 'import_id' => 587, 'post_title' => 'post-format-test-audio', 'post_date' => '2008-06-02 00:00:00' ) );
$post_id = $this->factory->post->create( array( 'post_title' => 'post-format-test-gallery', 'post_date' => '2008-06-10 00:00:00' ) );
$this->factory->post->create( array( 'import_id' => 611, 'post_type' => 'attachment', 'post_title' => 'canola2', 'post_parent' => $post_id ) );
$this->factory->post->create( array(
'post_title' => 'images-test',
'post_date' => '2008-09-03 00:00:00',
'post_content' => 'Page 1 <!--nextpage--> Page 2 <!--nextpage--> Page 3'
) );
$post_id = $this->factory->post->create( array( 'import_id' => 149, 'post_title' => 'comment-test', 'post_date' => '2008-03-03 00:00:00' ) );
$this->factory->comment->create_post_comments( $post_id, 15 );
$this->factory->post->create( array( 'post_date' => '2008-09-05 00:00:00' ) );
$this->factory->post->create( array( 'import_id' => 123 ) );
$this->factory->post->create( array( 'import_id' => 1 ) );
$this->factory->post->create( array( 'import_id' => 358 ) );
$this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'sample-page' ) );
$this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'about' ) );
$post_id = $this->factory->post->create( array( 'post_type' => 'page', 'post_title' => 'parent-page' ) );
$this->factory->post->create(
array( 'import_id' => 144, 'post_type' => 'page', 'post_title' => 'child-page-1', 'post_parent' => $post_id,
) );
$this->term_ids['/category/parent/'] = $this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'parent' ) );
$this->term_ids['/category/parent/child-1/'] = $this->factory->term->create( array(
'taxonomy' => 'category', 'name' => 'child-1', 'parent' => $this->term_ids['/category/parent/'],
) );
$this->term_ids['/category/parent/child-1/child-2/'] = $this->factory->term->create( array(
'taxonomy' => 'category', 'name' => 'child-2', 'parent' => $this->term_ids['/category/parent/child-1/'],
) );
$this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'cat-a' ) );
$this->factory->term->create( array( 'taxonomy' => 'category', 'name' => 'cat-b' ) );
$this->factory->term->create( array( 'name' => 'post-formats' ) );
}
示例4: setUp
function setUp()
{
global $wp_rewrite;
parent::setUp();
set_current_screen('front');
$GLOBALS['wp_the_query'] = new WP_Query();
$GLOBALS['wp_query'] = $GLOBALS['wp_the_query'];
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
create_initial_taxonomies();
register_taxonomy('testtax', 'post', array('public' => true));
$wp_rewrite->flush_rules();
$this->tag_id = $this->factory->tag->create(array('slug' => 'tag-slug'));
$this->cat_id = $this->factory->category->create(array('slug' => 'cat-slug'));
$this->tax_id = $this->factory->term->create(array('taxonomy' => 'testtax', 'slug' => 'tax-slug'));
$this->tax_id2 = $this->factory->term->create(array('taxonomy' => 'testtax', 'slug' => 'tax-slug2'));
$this->post_id = $this->factory->post->create();
wp_set_object_terms($this->post_id, $this->cat_id, 'category');
wp_set_object_terms($this->post_id, array($this->tax_id, $this->tax_id2), 'testtax');
$this->cat = get_term($this->cat_id, 'category');
_make_cat_compat($this->cat);
$this->tag = get_term($this->tag_id, 'post_tag');
$this->uncat = get_term_by('slug', 'uncategorized', 'category');
_make_cat_compat($this->uncat);
add_action('pre_get_posts', array($this, 'pre_get_posts_tax_category_tax_query'));
}
示例5: setUp
function setUp()
{
parent::setUp();
$this->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
create_initial_taxonomies();
$this->http = set_url_scheme(home_url('sample-page/'), 'http');
$this->https = set_url_scheme(home_url('sample-page/'), 'https');
}
示例6: setUp
function setUp() {
parent::setUp();
global $wp_rewrite;
update_option( 'permalink_structure', '/%category%/%year%/%postname%/' );
create_initial_taxonomies();
$GLOBALS['wp_rewrite']->init();
flush_rewrite_rules();
}
示例7: setUp
function setUp()
{
global $wp_rewrite;
parent::setUp();
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure('/%category%/%year%/%postname%/');
create_initial_taxonomies();
$wp_rewrite->flush_rules();
}
示例8: setUp
public function setUp()
{
parent::setUp();
update_option('page_comments', true);
update_option('comments_per_page', 5);
update_option('posts_per_page', 5);
$this->set_permalink_structure($this->structure);
create_initial_taxonomies();
}
示例9: setUp
function setUp()
{
parent::setUp();
set_current_screen('front');
update_option('comments_per_page', 5);
update_option('posts_per_page', 5);
create_initial_taxonomies();
$this->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
}
示例10: setUp
/**
* Setup.
*/
public function setUp()
{
parent::setUp();
$this->post_count = (int) get_option('posts_per_rss');
$this->excerpt_only = get_option('rss_use_excerpt');
// this seems to break something
update_option('use_smilies', false);
$this->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
create_initial_taxonomies();
}
示例11: setUp
function setUp()
{
parent::setUp();
update_option('comments_per_page', 5);
update_option('posts_per_page', 5);
global $wp_rewrite;
update_option('permalink_structure', '/%year%/%monthnum%/%day%/%postname%/');
create_initial_taxonomies();
$GLOBALS['wp_rewrite']->init();
flush_rewrite_rules();
}
示例12: setUp
public function setUp()
{
/** @var WP_Rewrite $wp_rewrite */
global $wp_rewrite;
parent::setUp();
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
create_initial_taxonomies();
$wp_rewrite->flush_rules();
do_action("plugins_loaded");
}
示例13: setUp
public function setUp()
{
parent::setUp();
update_option('page_comments', true);
update_option('comments_per_page', 5);
update_option('posts_per_page', 5);
global $wp_rewrite;
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure($this->structure);
create_initial_taxonomies();
$wp_rewrite->flush_rules();
}
示例14: setUp
function setUp()
{
parent::setUp();
set_current_screen('front');
update_option('comments_per_page', 5);
update_option('posts_per_page', 5);
global $wp_rewrite;
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
create_initial_taxonomies();
$wp_rewrite->flush_rules();
}
示例15: setUp
public function setUp()
{
/** @var WP_Rewrite $wp_rewrite */
global $wp_rewrite;
parent::setUp();
$wp_rewrite->init();
$wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
create_initial_taxonomies();
update_option('page_comments', true);
update_option('comments_per_page', 5);
update_option('posts_per_page', 5);
$this->post_type = "cpt";
$this->taxonomy = "ctax";
}