• Resolved lazy_entrepreneur

    (@lazy_entrepreneur)


    Hi developers.
    This is a great plugin for those like myself, who can code if needed, but prefer to use visual tools.

    Is there any chance you could add features for some Genesis Framework functionality into the plugin?
    The main one is the archives setting, as per:
    http://www.rfmeier.net/custom-post-type-archive-settings-with-genesis-2-0/

    There are 3 Genesis extras which would be nice to have available via this plugin. They are:
    ‘genesis-seo’
    ‘genesis-layouts’
    ‘genesis-cpt-archives-settings’

    While it is easy enough to add this code to the functions.php file, it would be nice to keep all the CPT settings in one plugin. This is what needs to be added for Genesis Framework people:

    add_action('init', 'my_custom_pt');
    function my_custom_pt() {
    	add_post_type_support( 'mycustompt', 'genesis-seo' );
    	add_post_type_support( 'mycustompt', 'genesis-layouts' );
    	add_post_type_support( 'mycustompt', 'genesis-cpt-archives-settings' );
    }

    I added the below line to your plugin, and it works perfectly.

    <input type="checkbox" name="cpt_supports[]" tabindex="20" value="genesis-cpt-archives-settings" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('genesis-cpt-archives-settings', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; } ?> />&nbsp;<?php _e( 'Genesis Framework CPT Archives Settings' , 'cpt-plugin' ); ?> <a href="#" title="<?php esc_attr_e( 'Adds the Genesis Framework CPT Archives Settings. Genesis parent theme must be installed before this will work', 'cpt-plugin' ); ?>" class="help">?</a>

    The only possible enhancement might be to only display if the Genesis Parent Theme is installed, but otherwise, disclaimer would suffice.

    Thanks
    W

    https://wordpress.org/plugins/custom-post-type-ui/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Is there any sort of class that can be checked for in Genesis? I’d consider it a lot more if there is. I’d really prefer not to show them unless Genesis is being used at all.

    Thread Starter lazy_entrepreneur

    (@lazy_entrepreneur)

    Hi Michael.

    There is a Genesis class which is useful. Try – “Genesis_Admin_Boxes”.
    Ref: http://designsbynickthegeek.com/tutorials/your-first-plugin

    I did some testing with the below code, switching between themes, and all seemed to work well.

    <?php if ( is_admin() && class_exists( 'Genesis_Admin_Boxes' ) ) { ?>
    
    <input type="checkbox" name="cpt_supports[]" tabindex="21" value="genesis-cpt-archives-settings" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('genesis-cpt-archives-settings', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; }  ?> />&nbsp;<?php _e( 'Genesis CPT Archives Settings' , 'cpt-plugin' ); ?> <a href="#" title="<?php esc_attr_e( 'Adds Genesis CPT Archives Settings', 'cpt-plugin' ); ?>" class="help">?</a> <br/ >
    
    <input type="checkbox" name="cpt_supports[]" tabindex="21" value="genesis-seo" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('genesis-seo', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; }  ?> />&nbsp;<?php _e( 'Genesis SEO' , 'cpt-plugin' ); ?> <a href="#" title="<?php esc_attr_e( 'Adds Genesis SEO', 'cpt-plugin' ); ?>" class="help">?</a> <br/ >
    
    <input type="checkbox" name="cpt_supports[]" tabindex="21" value="genesis-layouts" <?php if (isset($cpt_supports) && is_array($cpt_supports)) { if (in_array('genesis-layouts', $cpt_supports)) { echo 'checked="checked"'; } } elseif (!isset($_GET['edittype'])) { echo 'checked="checked"'; }  ?> />&nbsp;<?php _e( 'Genesis layouts' , 'cpt-plugin' ); ?> <a href="#" title="<?php esc_attr_e( 'Adds Genesis layouts', 'cpt-plugin' ); ?>" class="help">?</a> <br/ >
    
    <?php } ?>

    Regards,
    W

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    If this is part of the “supports” parameter for register_post_type, there will be a filter available to add custom things like this to in 0.9.0+ You can beta test the next release with https://github.com/WebDevStudios/custom-post-type-ui/archive/dev.zip

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add support for Genesis Framework?’ is closed to new replies.