get_results( " SELECT MAX(ID) AS post_id FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' GROUP BY post_author ORDER BY post_date_gmt DESC ", ARRAY_A ); if( $return_as_string === true ) { $ids_string = ''; foreach( $recent_ids as $post_id ) { $ids_string .= "{$post_id['post_id']}, "; } // Remove trailing comma $ids_string = substr( $ids_string, 0, -2 ); return $ids_string; } $ids = array( ); foreach( $recent_ids as $post_id ) { $ids[] = $post_id['post_id']; } return $ids; } function prologue_recent_projects_widget( $args ) { $before_title = null; $after_title = null; extract( $args ); $options = get_option( 'prologue_recent_projects' ); $title = empty( $options['title'] ) ? __( 'Recent Tags' ) : $options['title']; $num_to_show = empty( $options['num_to_show'] ) ? 35 : $options['num_to_show']; $num_to_show = (int) $num_to_show; $before = $before_widget; $before .= $before_title . $title . $after_title; $after = $after_widget; echo prologue_recent_projects( $num_to_show, $before, $after ); } function prologue_recent_projects( $num_to_show = 35, $before = '', $after = '' ) { $cache = wp_cache_get( 'prologue_theme_tag_list', '' ); if( !empty( $cache[$num_to_show] ) ) { $recent_tags = $cache[$num_to_show]; } else { $all_tags = (array) get_tags( array( 'get' => 'all' ) ); $recent_tags = array( ); foreach( $all_tags as $tag ) { if( $tag->count < 1 ) continue; $tag_posts = get_objects_in_term( $tag->term_id, 'post_tag' ); $recent_post_id = max( $tag_posts ); $recent_tags[$tag->term_id] = $recent_post_id; } arsort( $recent_tags ); $num_tags = count( $recent_tags ); if( $num_tags > $num_to_show ) { $reduce_by = (int) $num_tags - $num_to_show; for( $i = 0; $i < $reduce_by; $i++ ) { array_pop( $recent_tags ); } } wp_cache_set( 'prologue_theme_tag_list', array( $num_to_show => $recent_tags ) ); } echo $before; echo "

All Updates RSS

"; } else { return ""; } } function prologue_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?>
  • id="comment-">
    user_id, $comment->comment_author_email, 32 ); ?>

    on | # 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => ' | ')) ?>

  • id="comment-"> user_id, $comment->comment_author_email, 32 ); ?>

    on | #

    '; $fields['author'] = '

    ' . '

    '; $fields['email'] = '

    '; array_unshift( $fields, $comment_field ); return $fields; } add_filter( 'comment_form_default_fields', 'prologue_comment_fields' ); function prologue_comment_form_defaults($defaults) { if ( ! is_user_logged_in() ) $defaults['comment_field'] = ''; $defaults['comment_notes_before'] = ''; $defaults['comment_notes_after'] = ''; return $defaults; } add_filter( 'comment_form_defaults', 'prologue_comment_form_defaults' ); /** * Filters wp_title to print a neat tag based on what is being viewed. * * @since Prologue 1.4.2 */ function prologue_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'prologue' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'prologue_wp_title', 10, 2 ); /** * WP.com: Show a nice admin message saying Prologue was replaced by P2. */ function prologue_add_notice() { $current_theme = wp_get_theme()->Name; if ( ! get_user_meta( get_current_user_id(), "$current_theme-theme-update", true ) ) { add_settings_error( 'theme-update', 'theme-update', sprintf( __( 'Howdy! Your current theme, <em>%1$s</em>, has seen an update in the form of a brand new theme, <a href="%3$s">%2$s</a>. If you want to try out the cool new features in P2 just head over to <a href="%3$s"><em>Appearance</em>→<em>Themes</em></a> and activate <a href="%4$s">P2</a>—or check out any one of the other fantastic themes we’ve been adding lately. %5$s', 'prologue' ), $current_theme, // Old theme 'P2', // New theme admin_url( 'themes.php?s=p2' ), // Link to new theme esc_url( 'https://wordpress.com/themes/p2/' ), // Link to announcement post sprintf( '<a id="dismiss-theme-update" class="alignright" style="font-size: 16px;" title="%s" href="#">×</a>', __( 'Dismiss', 'prologue' ) ) // Dismiss ), 'updated' ); remove_action( 'admin_notices', 'show_tip' ); if ( ! has_filter( 'admin_notices', 'settings_errors' ) ) add_action( 'admin_notices', 'settings_errors' ); wp_enqueue_script( 'dismiss-theme-update', get_template_directory_uri() . '/js/dismiss-theme-update.js', array( 'jquery' ), 20130225 ); wp_localize_script( 'dismiss-theme-update', 'dismissThemeUpdate', array( 'theme' => $current_theme, 'nonce' => wp_create_nonce( "$current_theme-theme-update" ), ) ); } } add_action( 'admin_init', 'prologue_add_notice' ); /** * Updates user setting when theme update notice was dismissed. */ function prologue_dismiss_theme_update() { $current_theme = wp_get_theme()->Name; check_ajax_referer( "$current_theme-theme-update", 'nonce' ); if ( $_REQUEST['theme'] == $current_theme ) { update_user_meta( get_current_user_id(), "$current_theme-theme-update", true ); wp_die( 1 ); } } add_action( 'wp_ajax_dismiss_theme_update', 'prologue_dismiss_theme_update' );