Viewing 9 replies - 1 through 9 (of 9 total)
  • Liv44

    (@liv44)

    I don’t think you’re missing on something.
    I do have a similar problem: Button function available on “pages” but not on “packages”.

    Plugin Author DesignsAndCode

    (@designsandcode)

    Hmm there must be a hook to add this to editors for specific post types, I’ll take a look in WP docs…

    Thanks

    I’d also like to use this with custom post types.

    Will you be releasing a update to fix this?

    Thanks

    Plugin Author DesignsAndCode

    (@designsandcode)

    Hey there, yeah this sounds like a must have, and probably not tricky to add in.

    We’re buys working on another project at the moment but should be finsihed by end of may, which is when we’ll look at adding in this fix as well as some other improvements ??

    Thanks

    While I wait for the update
    I changed the function “my_add_styles_admin” in the file forget-about-shortcode-buttons.php, for:

    public function my_add_styles_admin() {
    
    			global $current_screen;
    			$type = $current_screen->post_type;
    
    /* latribu - mod */
             $args = array(
                'public'   => true,
                '_builtin' => false //get only custom post types
             );
    
             $posttypes = get_post_types( $args, 'names' );
             //$posttypes = get_post_types( '', 'names' );
    
             if ( is_admin() && $type == 'post' || $type == 'page' || in_array($type, $posttypes) )
             {
    				?>
    				<script type="text/javascript">
    				var fasc_ajaxurl  = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
    				var fasc_ver  = '<?php echo FASC_BUTTONS_VERSION_NUM; ?>';
    				</script>
    				<?php
    			}
    /* latribu - mod */
    
    /*    // original code
    			if (is_admin() && $type == 'post' || $type == 'page') {
    				?>
    				<script type="text/javascript">
    				var fasc_ajaxurl  = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
    				var fasc_ver  = '<?php echo FASC_BUTTONS_VERSION_NUM; ?>';
    				</script>
    				<?php
    			}
    */
    
    		}

    Regards

    Plugin Author DesignsAndCode

    (@designsandcode)

    Fantastic, thanks so much for sharing! ??

    Hi,

    Have you had a chance to update the plugin yet? I still can’t see the Insert Button icon on custom pages but can see on Posts and Pages.

    Thanks

    My developer figured out a work around. Paste the code below into your theme’s function.php file. Make sure you change the “mytheme” in “mytheme_add_fasc_assets” to something appropriate for you.

    function mytheme_add_fasc_assets() {
    	if ( !is_admin() ) {
    		return;
    	}
    	global $current_screen;
    	$type = $current_screen->post_type;
    	if ( $type == 'post' || $type == 'page') {
    		return; // FASC plugin is already doing this
    	}
    	?>
    	<script type="text/javascript">
    		var fasc_ajaxurl  = '<?php echo admin_url( 'admin-ajax.php' ); ?>';
    		var fasc_ver  = '<?php echo FASC_BUTTONS_VERSION_NUM; ?>';
    	</script>
    	<?php
    }
    add_action( 'admin_head',  'my theme_add_fasc_assets' );
    Plugin Author DesignsAndCode

    (@designsandcode)

    This has been patched in the latest version as well as support for WP 4.4

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Buttons on Custom Post Types’ is closed to new replies.