#16309 closed defect (bug) (invalid)
add_filter('the_content', 'myfunction') doesn't work when multi site.
| Reported by: | matsubobo | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Plugins | Version: | 3.1 |
| Severity: | minor | Keywords: | add_filter |
| Cc: | Focuses: |
Description
I wrote simple plugin code to test the issue.
function myfunction($content) {
$content = 'test'.$content;
return $content;
}
add_filter('the_content', 'myfunction');
The code works single wordpress and main site when multi site setting. However, child-sites when multi site setting.
WP 3.0 and 3.1 have same issue.
Attachments (1)
Change History (7)
#2
@
16 years ago
I think I understood how plugin is activated on multi site.
I also tried following code to analyze the plugin is activated.
function myfunction($content) {
print 'this block is passed.';
$content = 'test'.$content;
return $content;
}
add_filter('the_content', 'myfunction');
"'this block is passed." was displayed but "test" was not displayed on child-sites.
Both "this block is passed" and "test" where displayed on the main site.
#4
@
16 years ago
- Resolution → invalid
- Status reopened → closed
You're not activating the plugin on each of the child sites.
The plugin needs to be network activated, otherwise it isn't included apart from the main site. Plugins are maintained on a per-site basis by default.
For additional help, please try the multisite support forums: http://wordpress.org/support/forum/multisite/.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The plugin needs to be network activated, otherwise it isn't included apart from the main site. Plugins are maintained on a per-site basis by default.
For additional help, please try the multisite support forums: http://wordpress.org/support/forum/multisite/.