[wp-trac] [WordPress Trac] #30302: Network sites taxonomy
WordPress Trac
noreply at wordpress.org
Fri Mar 31 12:36:15 UTC 2017
#30302: Network sites taxonomy
--------------------------------+-------------------------
Reporter: aurovrata | Owner:
Type: feature request | Status: closed
Priority: normal | Milestone:
Component: Networks and Sites | Version: 4.0
Severity: normal | Resolution: maybelater
Keywords: close | Focuses: multisite
--------------------------------+-------------------------
Comment (by Biont):
Replying to [comment:5 aurovrata]:
> what's your approach? I had initially started on this project but never
got to the point of releasing a plugin in the repo.... just not enough
time.
Many of the following details are already scattered throughout my previous
post, but I'll
I wanted to actually extend the Taxonomy API so that Sites can be used as
object types. The API is flexible enough to do that, but it does not have
any multisite concept at all.
So I created all 4 term_* tables with a network prefix and then tried to
wire it up to the existing API. This gave me a lot of trouble, as all
table names and cache keys are hardcoded.
When working with a network taxonomy, you have to do most of it via my
plugin API, which wraps the existing Taxonomy API. To give you an idea,
have a look at this code:
{{{#!php
<?php
class API{
public function insert_network_term(){
$this->setup_env(); // Set up table names. Disable caching. Replace
entry in $wp_taxonomies
wp_insert_term();
$this->breakdown_env();
}
}
}}}
This works, but is hacky and will likely yield bugs. Caching is currently
giving me most problems because I cannot really prevent WP from caching,
or inject my own parameters
Still, I am seeing good results so far.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30302#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list