WordPress.org

Ready to get started?Download WordPress

Forums

KIA Subtitle
[resolved] Remove Subtitle from Custom Post Type (14 posts)

  1. Tim Griffin
    Member
    Posted 1 year ago #

    Hello Kathy,

    Enjoying the plugin and expect to welcome a new WP Powered website owner to a fine Subtitle function :-)

    Question:
    Remove the Subtitle input field from specific areas in the admin screen.

    For example, there are post types which do not require a subtitle - such as say the Woo Sidebars. Allowing you to create specific sidebars within your site. The subtitle section is clutter on this particular screen and serves no purpose.

    Another example is the Portfolio post type. I do not plan to integrate the subtitles in this section - only the single blog post and single page titles of the site.

    Is there a simple way to "turn off" or hide the subtitle input field within the admin screen?

    Thanks a ton :-)

    http://wordpress.org/extend/plugins/kia-subtitle/

  2. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Tim,

    At the moment there probably isn't a really easy way to do this. I suppose you could remove the function

    remove_action( 'edit_form_after_title', array( 'KIA_Subtitle', 'add_input' ) );

    An then add it back conditionally. That's a good point though and is a feature I should add at some point.

  3. Tim Griffin
    Member
    Posted 1 year ago #

    Thanks for the reply Kathy!

    I looked for a way to do this using css to simply hide the input on the appropriate admin page... didn't find what I was looking for though. A filter or conditional call to selectively add/remove the input from specific post types would be absolutely brilliant!

  4. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    Would you do me a favor and test out the latest version on github?
    https://github.com/helgatheviking/KIA-Subtitle

    I added some plugin options today to let you disable the input on particular post types.

  5. Tim Griffin
    Member
    Posted 1 year ago #

    That is awesome.
    Just installed and tested it out briefly.

    Pages and Posts have the subtitle.
    Custom post types: was mostly able to "turn this off" using the options.

    Here's a screenshot of the post types and selections available:
    http://cl.ly/image/401u1W3p3E22

    For some reason, the post type "sidebar" (of Woo Sidebars plugin) and also the "feedback" post type (also by WooThemes plugin) are not recognized in this latest update. The option to select and remove the subtitle input is not available for these.

    Nonetheless - it's a very helpful improvement and helps me eliminate extra inputs ie. media and the portfolio post types!

    Thanks for making this a reality :-)

    Tim

  6. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    What if you go to the /inc/plugin-options.php file and on line 31, change the $args definition to:

    $args = array( 'public'   => true );

    I don't know how they are registering their post types, but maybe they are private post types?

  7. Tim Griffin
    Member
    Posted 1 year ago #

    Ok, tried that but without the effect we're looking for.

    Subtitles checkbox option for Sidebars (http://www.woothemes.com/woosidebars/) and feedback/testimonials (http://wordpress.org/extend/plugins/testimonials-by-woothemes/) still not available.

    When I make the change to the code on line 31, I do see one extra checkbox option:
    "WooFramework Internal Container". This checkbox will not remain checked on save though...

    Thanks for looking at this!

  8. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    updated to 1.4.1. Working with both for me. I also added a filter so you can modify the post types being displayed in the admin.

    *edited*

  9. Tim Griffin
    Member
    Posted 1 year ago #

    That's awesome. Just updated and full functionality with options to turn off anywhere that is not a post or page (default excludes option list doesn't include page or posts?).

    For me this is just perfect.

    Question regarding "added a filter so you can modify the filters being displayed in the admin"

    That sentence didn't make sense to me?? Did I miss something?
    Does that mean I can programmatically add or remove post types from the exclude post type options list?

    Plugin is now on my favorites list :-)

  10. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    I was using '_builtin' => false for get_post_types() but I just removed that too.

    And I switched the filter to filter the $args:

    $args = ( array ) apply_filters( 'kia_subtitle_post_type_args', array() );
    $post_types = get_post_types( $args, 'objects' );

    So you can adjust the $args yourself. This doesn't control where the subtitle is displayed, it only effects the list of post types that shows up in the plugin options.

  11. Tim Griffin
    Member
    Posted 1 year ago #

    Ok, just saw this and thought it worth the suggestion:
    Admin screen options. In editor under the Screen Options dropdown, the Subtitle is not an option to turn on or off.

    Seems that this little option would be the icing on the cake ;-)

  12. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    It might be (And that might even be a better solution that what I just did), but I can't afford any more time maintaining my free plugins today. Time to go to work! :)

    Thanks for the kind review.

  13. Tim Griffin
    Member
    Posted 1 year ago #

    I totally understand and am grateful for your efforts!

  14. helgatheviking
    Member
    Plugin Author

    Posted 1 year ago #

    @Tim - I Have been thinking that I don't like the "check to disable" something as checks usually *enable* something, so I worked on an upgrade routine today that would switch it over. If you have a test install somewhere, I'd totally appreciate it if you could check out the new github version and see if it upgrades ok.

    Should be version 1.5
    https://github.com/helgatheviking/KIA-Subtitle/archive/master.zip

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic