Update: Mit Version 1.1.3 des Instagrate Plugins wurden die Änderungen in die Instagrate to WordPress Plugin übernommen. Der Patch ist ab dieser Version nciht mehr erforderlich.
Das WordPress-Plugin “Instagrate to WordPress” erzeugt automatisch zu jedem Foto in einem Instagram-Account ein eigenen Blog-Post. Leider unterstützt das Plugin bislang lediglich Post-Formate, aber eine keine Post-Types für die angelegten Blog-Posts. Mit diesem Patch kann man dem Plugin (Version 1.1.1) den Umgang mit Post-Types beibringen:
130c130,132 < update_option('itw_postformat', 'Standard'); --- > update_option('itw_postformat', 'Standard'); > //set post type > update_option('itw_posttype', 'post'); 155a158 > delete_option('itw_posttype'); 220a224,226 > //set post type > update_option('itw_posttype', 'post'); > 628a635 > $posttype = get_option('itw_posttype'); 745a753 > 'post_type' => $posttype, 766a775,776 > set_post_type($new_post->ID, "Photo"); > 895a906,908 > $posttype = $_POST['itw_posttype']; > update_option('itw_posttype', $posttype); > 938a952 > $posttype = get_option('itw_posttype'); 1198a1213,1243 > $output .= '</select></p>'; > > echo $output; > ?> > > <p><label>Post Type:</label> > <?php > $output = '<select name="itw_posttype">'; > > // prepare post type filter > $args = (array) apply_filters( 'pts_post_type_filter', array( > 'public' => true, > 'show_ui' => true > ) ); > $posttypes = get_post_types( $args, 'objects' ); > > $select_value = $posttype; > > foreach ( $posttypes as $pt ) : > > $selected = ''; > > if($select_value != '') { > if ( $select_value == esc_attr( $pt->name )) { $selected = ' selected="selected"';} > } > > $output .= '<option value="' . esc_attr( $pt->name ) . '"' . $selected . '>'; > $output .= $pt->labels->singular_name; > $output .= '</option>'; > endforeach; >
Download: Posttype Patch for Instagrate 1.1.1