WordPress.org

Ready to get started?Download WordPress

Forums

Facebook Photo Fetcher
[resolved] Not compatible with custom post types? (3 posts)

  1. BramVanroy
    Member
    Posted 1 year ago #

    Normally, when you save a post, it is converted to a complete post with all the images inserted etc. The problem is: the plugin doesn't seem to recognise this tag! Or maybe it is disabled for custom post types? I don't know, but it does absolutely nothing when I paste the magic tag in a custom post type and I don't know why!

    This is my cpt:

    add_action( 'init', 'register_cpt_foto' );
    
    function register_cpt_foto() {
    
        $labels = array(
            'name' => _x( 'Fotoalbums', 'foto' ),
            'singular_name' => _x( 'Fotoalbum', 'foto' ),
            'add_new' => _x( 'Nieuw fotoalbum', 'foto' ),
            'add_new_item' => _x( 'Voeg nieuw fotoalbum toe', 'foto' ),
            'edit_item' => _x( 'Bewerk fotoalbum', 'foto' ),
            'new_item' => _x( 'Nieuw fotoalbum', 'foto' ),
            'view_item' => _x( 'Bekijk fotoalbum', 'foto' ),
            'search_items' => _x( 'Zoek in fotoalbums', 'foto' ),
            'not_found' => _x( 'Geen fotoalbums gevonden', 'foto' ),
            'not_found_in_trash' => _x( 'Geen fotoalbums gevonden in de prullenmand', 'foto' ),
            'parent_item_colon' => _x( 'Parent foto:', 'foto' ),
            'menu_name' => _x( 'Foto\'s', 'foto' ),
        );
    
        $args = array(
            'labels' => $labels,
            'hierarchical' => true,
            'description' => 'Het posttype dat alle fotoalbums verzorgt.',
            'supports' => array( 'title', 'editor', 'excerpt', 'comments', 'page-attributes' ),
            'taxonomies' => array( 'post_tag' ),
            'public' => true,
            'show_ui' => true,
            'show_in_menu' => true,
    
            'show_in_nav_menus' => true,
            'publicly_queryable' => true,
            'exclude_from_search' => false,
            'has_archive' => true,
            'query_var' => true,
            'can_export' => true,
            'rewrite' => array(
                'slug' => 'fotos',
                'with_front' => false
            ),
            'capability_type' => 'post'
        );
    
        register_post_type( 'foto', $args );
    }

    http://wordpress.org/extend/plugins/facebook-photo-fetcher/

  2. BramVanroy
    Member
    Posted 1 year ago #

    Found it:
    In facebook-photo-fetcher/_output_gallery.php delete lines 15 to 17. These ones:

    //Don't process anything but POSTS and PAGES (i.e. no revisions)
        if( $data['post_type'] != 'post' && $data['post_type'] != 'page')
            return $data;

    And it should work!

  3. justin_k
    Member
    Plugin Author

    Posted 1 year ago #

    Cool, good find - I'll fix this in a future version too.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.