'', // Unused. Messages start at index 1. 1 => sprintf( __( 'FAQ updated. View staff' ), esc_url( get_permalink( $post_ID ) ) ), 2 => __( 'Custom field updated.' ), 3 => __( 'Custom field deleted.' ), 4 => __( 'FAQ updated.' ), /* translators: %s: date and time of the revision */ 5 => isset( $_GET['revision'] ) ? sprintf( __( 'FAQ restored to revision from %s' ), wp_post_revision_title( ( int ) $_GET['revision'], false ) ) : false, 6 => sprintf( __( 'FAQ published. View FAQ' ), esc_url( get_permalink( $post_ID ) ) ), 7 => __( 'FAQ saved.' ), 8 => sprintf( __( 'FAQ submitted. Preview FAQ' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) ), 9 => sprintf( __( 'FAQ scheduled for: %1$s. Preview FAQ' ), // translators: Publish box date format, see http://php.net/date date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink( $post_ID ) ) ), 10 => sprintf( __( 'FAQ draft updated. Preview FAQ' ), esc_url( add_query_arg( 'preview', 'true', get_permalink( $post_ID ) ) ) ), ); return $messages; } /** * Add the post-type icon to the admin screen * * @since 0.9 */ function faq_post_type_admin_image() { printf( '', ACF_URL . 'images/faq-32x32.png' ); } /** * Choose the specific columns we want to display * * @param array $columns * @return string $columns * @since 0.9 * @version 1.2 */ function faq_columns_filter( $columns ) { $columns = array( "cb" => "", "title" => __( 'FAQ Title', 'acf' ), "faq_content" => __( 'Answer', 'acf' ), 'faq_groups' => __( 'Group', 'acf' ), "date" => __( 'Date', 'acf' ) ); return $columns; } /** * Filter the data that shows up in the columns we defined above * * @global type $post * @param type $column * @since 0.9 * @version 1.1 */ function faq_column_data( $column ) { global $post; switch( $column ) { case "faq_content": the_excerpt(); break; case "faq_groups": echo get_the_term_list( $post->ID, 'group', '', ', ', '' ); break; default: break; } } /** * Add the Post type to the "Right Now" Dashboard Widget * * @link http://bajada.net/2010/06/08/how-to-add-custom-post-types-and-taxonomies-to-the-wordpress-right-now-dashboard-widget * @version 1.0 */ function faq_right_now() { // Define the post type text here, allowing us to quickly re-use this code in other projects $ac_pt = 'faq'; // must be the registered post type $ac_pt_p = 'FAQs'; $ac_pt_s = 'FAQ'; // No need to modify these 2 $ac_pt_pp = $ac_pt_p . ' Pending'; $ac_pt_sp = $ac_pt_s . ' Pending'; $args = array( 'public' => true, '_builtin' => false ); $output = 'object'; $operator = 'and'; $num_posts = wp_count_posts( $ac_pt ); $num = number_format_i18n( $num_posts->publish ); $text = _n( $ac_pt_s, $ac_pt_p, intval( $num_posts->publish ) ); if( current_user_can( 'edit_posts' ) ) { $num = "$num"; $text = "$text"; } echo '