get_option('cross_relate') ) $instance['post_type'] = $yarpp->get_post_types(); else if ( 'page' == get_post_type() ) $instance['post_type'] = array( 'page' ); else $instance['post_type'] = array( 'post' ); $title = apply_filters('widget_title', $instance['title']); echo $before_widget; if ( !$instance['template'] ) { echo $before_title; echo $title; echo $after_title; } $instance['domain'] = 'widget'; $yarpp->display_related(null, $instance, true); echo $after_widget; } function update($new_instance, $old_instance) { $instance = array( 'promote_yarpp' => isset($new_instance['promote_yarpp']), 'template' => isset($new_instance['use_template']) ? $new_instance['template_file'] : false ); if ( !!$instance['template'] ) // don't save the title change. $instance['title'] = $old_instance['title']; else // save the title change: $instance['title'] = $new_instance['title']; return $instance; } function form($instance) { global $yarpp; $instance = wp_parse_args( $instance, array( 'title' => __('Related Posts (YARPP)','yarpp'), 'template' => false, 'promote_yarpp' => false ) ); // compatibility with pre-3.5 settings: if ( isset($instance['use_template']) ) $instance['template'] = $instance['template_file']; ?>

admin->get_templates(); if ( count($templates) ): ?>

/>

/>