WordPress.org

Ready to get started?Download WordPress

Forums

Codepress Admin Columns
[resolved] Adding custom post "Type" to the entry list - but I don't want it to (15 posts)

  1. idstm
    Member
    Posted 1 year ago #

    Just installed a fresh copy of CPAC on a fresh copy of WP, using a fresh copy of Magic Fields. This setup is working great on another install I have with the same numbers. But today...

    If I adjust the columns on a custom post, CPAC adds "Type" as the first column on the list. Yet "Type" is not an option in CPAC. And if it was, I wouldn't choose to display it anyhow as the list is only the custom post types anyhow.

    If I restore defaults, it goes away. Edit that custom post type's column, it shows back up. Weird, right?

    Where in the world is that coming from?

    I suppose I could just filter it with a custom function, but that kind of defeats the purpose.

    Screenshots:
    http://www.idstm-dev.com/clients/test/stuff/cpac-options.png
    http://www.idstm-dev.com/clients/test/stuff/custom-type-listing.png

    http://wordpress.org/extend/plugins/codepress-admin-columns/

  2. Tobias Schutter
    Member
    Plugin Author

    Posted 1 year ago #

    Which version of Magic Fields are you using?

  3. idstm
    Member
    Posted 1 year ago #

    WP Version 3.4.2
    Magic Fields Version 2.0.1
    CPAC Version 1.4.6.4

    Strangely I have the exact same version of all of it on another few sites and there's no issue there. Though, those sites all started on older versions and were upgraded as time went on. This set up was from scratch with the most recent versions.

  4. idstm
    Member
    Posted 1 year ago #

    Wow, the timing! 20 minutes after posting i was working in the site and got a notification of a CPAC plugin update. I updated to Version 1.4.7 and problem is solved. Looks like your updates got it all solved. Great work. Thanks for a great plugin.

  5. Tobias Schutter
    Member
    Plugin Author

    Posted 1 year ago #

    Your welcome :)

  6. idstm
    Member
    Posted 1 year ago #

    Well, sadly I take back the part about it working. It's not. And the update has broken the site it was working on previously as well. That one is worse as the settings screen is just totally blank. I'll do some digging and see what I can find.

  7. idstm
    Member
    Posted 1 year ago #

    ah, the blank... i forgot that i had error reporting turned off.

    Catal error: Call to undefined method stdClass::add_help_tab() in /home/content/.../wp-content/plugins/bbpress/includes/admin/forums.php on line 118

    bbpress problem? hmmm. why in the world bbpress would be getting called when i'm on the CPAC admin page... well, that's gonna take some searching.

  8. idstm
    Member
    Posted 1 year ago #

    sort of found it. linke 1086 on codepress-admin-columns.php:

    do_action('load-edit.php')

    that loads all the other plugins to get columns they might have. and that triggers the bbpress error.

    bbpress issue? should i post that to them?

  9. idstm
    Member
    Posted 1 year ago #

    i worked my way back through bbpress and it looks like this: bbpress, when loaded, will call a bail() function on some of the functions when loaded. basically it appears as though it's trying to no load unnecessary functions. like why load a help page function if the user is not actually on the page that would display it.

    but, the fail is not working. the check it performs is this:

    private function bail() {
    if ( !isset( get_current_screen()->post_type ) || ( $this->post_type != get_current_screen()->post_type ) )
    return true;

    return false;
    }

    doing some testing i print out get_current_screen()->post_type and for whatever reason wordpress thinks that the post type on is "forumn" on this page:

    /wp-admin/options-general.php?page=codepress-admin-columns

    hmm. why in the world would it think that? i'm guessing there is some sort of naming conflict? just a wild guess.

  10. idstm
    Member
    Posted 1 year ago #

    i rolled back to cpac vs 1.4.4 and all of the issues went away.

    i will update my core and do more testing on a dev site later.

  11. Tobias Schutter
    Member
    Plugin Author

    Posted 1 year ago #

    Yeah about this issue here. The problem is I want to support as many columns from thirdparty plugins as possible. That's why I needed to use:

    do_action('load-edit.php')

    Unfortunately that means that occasionally you get a bug like this.

    But I have a quick fix for this. You can just remove the bbPress posttypes from admin columns. I will apply this fix as well in a next release. For now add this to your functions.php:

    function remove_bbpress_from_cpac_post_types( $post_types )
    {
    	if ( class_exists('bbPress') ) {
    		unset( $post_types['topic'] );
    		unset( $post_types['reply'] );
    		unset( $post_types['forum'] );
    	}
    
    	return $post_types;
    }
    add_filter( 'cpac-get-post-types', 'remove_bbpress_from_cpac_post_types' );
  12. idstm
    Member
    Posted 1 year ago #

    i totally agree with your goals. great stuff. thanks for the fix.

  13. MACscr
    Member
    Posted 1 year ago #

    Tobias,

    But what about people like that have 10 different custom post types? I obviously dont want to have to do a filter for every single one. Would love to see a quick fix. =)

  14. Tobias Schutter
    Member
    Plugin Author

    Posted 1 year ago #

    In the next major update ( 1.5 and up ) I will address the issue, and use another method for supporting other plugins.

  15. Earthman Web & Media
    Member
    Posted 1 year ago #

    Would definitely love to see your awesome plugin support BBpress too. Your plugin has become a staple in all sites i build now. Keep up the great work, let me know if you need any help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.