WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Sitewide Tags Pages
SWT Still Not Working With Custom Post Types (7 posts)

  1. ithacaindy
    Member
    Posted 2 years ago #

    I have the latest version (0.4.2) of SWT installed on the Network Admin of my Multi Site installation. I have SWT enabled network wide. Yet, when I create a custom post type on a sub-blog, it doesn't appear on my main blog. When I create a default Post, it does appear on my main blog.

    What am I doing wrong?

    http://wordpress.org/extend/plugins/wordpress-mu-sitewide-tags/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Do you have the CPT registered on your main blog?

    Did you enable that CPT for SWT? http://wpmututorials.com/plugins/sitewide-tags-update/

  3. ithacaindy
    Member
    Posted 2 years ago #

    I created the CPT on blog.domain.com. Should I enable the CPT for SWT in the functions.php of the source (blog.domain.com) or the destination (domain.com)? When I enable the CPT for SWT on the source site, I get this warning:

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'test' was given in /xxx/xxx/xxx/wp-includes/plugin.php on line 170

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I created the CPT on blog.domain.com.

    How did you do that? If you used a plugin then you also need to create the same CPT on the tags blog with the plugin.

    If you created it with a theme, you'll have to ask the theme author.

    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'test' was given in /xxx/xxx/xxx/wp-includes/plugin.php on line 170

    You'll have to sort that out with the author of whatever you are using to create the CPT.

  5. ithacaindy
    Member
    Posted 2 years ago #

    I created the CPT on blog.domain.com programmatically in functions.php, not through a plugin. Since I am following coding prescribed in the WordPress codex for creating and registering CPT, I'm unsure why I should contact my theme's author.

    The call_user_func_array() warning appears when I add the following line of code to functions.php, suggested by the wpmututorials.com/plugins/sitewide-tags-update/ page:

    add_filter( 'sitewide_tags_allowed_post_types',

    'my_swt_post_type_filter' )

  6. ithacaindy
    Member
    Posted 2 years ago #

    I was able to get rid of the warning message by digging into the comments of the wpmtutorials.com post. The add_filter() command is looking for a filter that needed to be code. I used on from this thread on getting SWT and BuddyPress to coexist:

    function my_swt_custom_tax_filter( $taxonomies ) {
    $taxonomies[] = 'green';
    return $taxonomies;
    }
    add_filter( 'sitewide_tags_allowed_post_types', 'my_swt_custom_tax_filter' );

    I was able to create a post of 'green' on the blog.domain.com, but it was not transferred to domain.com.

  7. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I created the CPT on blog.domain.com programmatically in functions.php

    Then add the same code to the functions.php of the theme on your tags blog.

    The call_user_func_array() warning appears when I add the following line of code to functions.php, suggested by the wpmututorials.com/plugins/sitewide-tags-update/ page:

    add_filter( 'sitewide_tags_allowed_post_types',
    'my_swt_post_type_filter' )

    The post also suggested that you had to write a filter. Then it provided that line of code to show you how to implement the filter you wrote.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.