=$limit) { array_pop($excerpt); $excerpt = implode(" ",$excerpt).'...'; } else { $excerpt = implode(" ",$excerpt); } $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); return $excerpt; } /** * Adds a link to the submenu under Posts */ if ( !function_exists( 'brood_featured_posts_link' ) ) { function brood_featured_posts_link() { global $submenu; $link_to_add = 'edit.php?tag=featured'; // change edit.php to the top level menu you want to add it to $submenu['edit.php'][] = array('Featured Posts', 'edit_posts', $link_to_add); } add_action('admin_menu', 'brood_featured_posts_link'); } /** * Update notice messages * */ function brood_plugin_notice() { global $current_user; $user_id = $current_user->ID; if (!get_user_meta($user_id, 'brood-admin-notice_ignore')) { $message = '

    New Features added to theme

  1. Setting Featured Posts - Add "featured" tag to your post and don\'t forget to add a featured image.
  2. Custom Logo - You can add a logo from Theme customizer which will show up instead of name and description in top bar.
'; $message .= '

Few Bug fixes

'; $message .= '

In case you have any query, ask it on wordpress.org Theme Forums

'; echo '

'. $message .' Dismiss this notice

'; } } add_action('admin_notices', 'brood_plugin_notice'); function brood_plugin_notice_ignore() { global $current_user; $user_id = $current_user->ID; if (isset($_GET['brood-admin-notice']) && '0' == $_GET['brood-admin-notice']) { add_user_meta($user_id, 'brood-admin-notice_ignore', 'true', true); } } add_action('admin_init', 'brood_plugin_notice_ignore');