Changeset 1708062
- Timestamp:
- 08/03/2017 10:52:37 PM (9 years ago)
- Location:
- expand2017
- Files:
-
- 3 added
- 4 edited
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-128x128.png (modified) (previous)
-
tags/1.3.0 (added)
-
tags/1.3.0/expand2017.php (added)
-
tags/1.3.0/readme.txt (added)
-
trunk/expand2017.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
expand2017/trunk/expand2017.php
r1705195 r1708062 4 4 Plugin URI: https://wordpress.org/plugins/expand2017/ 5 5 Description: Expand2017 adds new features to Automattic's Twenty Seventeen Theme 6 Version: 1. 2.06 Version: 1.3.0 7 7 Author: chrisb10 8 8 Author URI: https://profiles.wordpress.org/chrisb10/ 9 9 */ 10 10 11 /* 1.0 - MAIN FEATURES */ 12 11 13 // Change the default amount of sections 14 15 add_filter( 'twentyseventeen_front_page_sections', 'expandts_custom_front_sections' ); 12 16 13 17 function expandts_custom_front_sections( $num_sections ) … … 15 19 return 17; //Number of added sections 16 20 } 17 add_filter( 'twentyseventeen_front_page_sections', 'expandts_custom_front_sections' );18 21 19 22 // If one result is found by the search results, redirect user to that post 20 23 21 24 add_action('template_redirect', 'expandts_redirect_post'); 25 22 26 function expandts_redirect_post() { 23 27 if (is_search()) { … … 32 36 // Twitter mention link 33 37 38 add_filter('the_content', 'expandts_twitter_mention'); 39 add_filter('comment_text', 'expandts_twitter_mention'); 40 34 41 function expandts_twitter_mention($content) { 35 42 return preg_replace('/([^a-zA-Z0-9-_&])@([0-9a-zA-Z_]+)/', "$1<a href=\"http://twitter.com/$2\" target=\"_blank\" rel=\"nofollow\">@$2</a>", $content); 36 43 } 37 44 38 add_filter('the_content', 'expandts_twitter_mention');39 add_filter('comment_text', 'expandts_twitter_mention');40 41 45 // Coloured post types 42 46 43 47 add_action('admin_footer','posts_status_color'); 44 function posts_status_color(){ 48 49 function posts_status_color(){ 45 50 ?> 46 51 <style> … … 55 60 } 56 61 .status-future { 57 background: #f fe3ff!important;62 background: #f2fff9 !important; 58 63 } 59 64 .status-private 60 65 { 61 background: #f 2fff9!important;66 background: #ffe3ff !important; 62 67 } 63 68 </style> … … 66 71 67 72 // Register User Contact Methods 73 74 add_filter( 'user_contactmethods', 'expandts_custom_user_contact_methods' ); 75 68 76 function expandts_custom_user_contact_methods( $user_contact_method ) { 69 77 … … 80 88 81 89 } 82 add_filter( 'user_contactmethods', 'expandts_custom_user_contact_methods' );83 90 84 91 // Register scripts for dynamic menu system 92 93 add_action( 'wp_enqueue_scripts', 'expandts_scripts_haze' ); 85 94 86 95 function expandts_scripts_haze() … … 92 101 wp_enqueue_script( 'expand2017' ); 93 102 } 94 add_action( 'wp_enqueue_scripts', 'expandts_scripts_haze' ); 103 104 // Pretty search permalinks 105 106 add_action( 'template_redirect', 'expandts_change_search_url_rewrite' ); 107 108 function expandts_change_search_url_rewrite() { 109 if ( is_search() && ! empty( $_GET['s'] ) ) { 110 wp_redirect( home_url( "/search/" ) . urlencode( get_query_var( 's' ) ) ); 111 exit(); 112 } 113 } 114 115 // Show page/post id's 116 117 add_filter('manage_posts_columns', 'expandts_posts_columns_id', 5); 118 add_action('manage_posts_custom_column', 'expandts_custom_id_columns', 5, 2); 119 add_filter('manage_pages_columns', 'expandts_posts_columns_id', 5); 120 add_action('manage_pages_custom_column', 'expandts_custom_id_columns', 5, 2); 121 122 function expandts_posts_columns_id($defaults){ 123 $defaults['wps_post_id'] = __('ID'); 124 return $defaults; 125 } 126 127 function expandts_custom_id_columns($column_name, $id){ 128 if($column_name === 'wps_post_id'){ 129 echo $id; 130 } 131 } 132 133 // Limit post revisions 134 135 if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 10); 136 137 // 138 139 /* 2.0 - SECURITY */ 140 141 // Remove WordPress version 142 143 add_filter('the_generator', 'expandts_version_removal'); 144 145 function expandts_version_removal() { 146 return 'Damn script kiddies'; 147 } 148 149 // Remove login errors 150 151 add_filter( 'login_errors', 'expandts_hide_errors' ); 152 153 function expandts_hide_errors(){ 154 return 'That doesn\'t look right'; 155 } -
expand2017/trunk/readme.txt
r1705195 r1708062 1 1 === Expand2017 === 2 2 Contributors: chrisb10 3 Tags: front page, sections, twenty seveteen, theme, redirect, user, search, post, twitter, username,3 Tags: front page, sections, twenty seveteen, theme, redirect, user, search, post, twitter, limit revisions, id, organisation, 4 4 Requires at least: 4.0 5 5 Tested up to: 4.8 6 Stable tag: 1. 2.06 Stable tag: 1.3.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html/ … … 11 11 12 12 == Description == 13 Expand2017 adds new features to Automattic's Twenty Seventeen Theme , including:<br>13 Expand2017 adds new features to Automattic's Twenty Seventeen Theme<br> 14 14 15 * Adds more front page 'sections'<br> 16 * If a user's search result only returns one post, the user will be redirected to that post<br> 17 * Changes Twitter @mentions to the user's Twitter profile<br> 18 * Adds easy organisation to posts in the dashboard by colour coding different post statuses - published, draft, pending review, private, future<br> 19 * Adds 8 new contact methods to user's WordPress profile section<br> 20 * Adds a dynamic menu system<br> 15 =Main Features= 16 17 * Adds more front page 'sections' 18 * If a user's search result only returns one post, the user will be redirected to that post 19 * Changes Twitter @mentions to the user's Twitter profile 20 * Shows both page and post id's in the admin column 21 * Adds easy organisation to posts in the dashboard by colour coding different post statuses - published, draft, pending review, private, future 22 * Adds 8 new contact methods to user's WordPress profile section 23 * Adds a dynamic menu system 24 * Adds pretty permalinks for search 25 * Shows page and post id's in a new admin column 26 * Limits post revisions to 10 27 28 =Security Features= 29 30 * Removes WordPress version number from header 31 * Changes login error message (stops WordPress from telling potential hackers if they've got the username or password right) 21 32 22 33 *Note* - Add your feature requests to the support forum, ready for the next update … … 49 60 * New Feature: Dynamic menu system 50 61 * Miscellaneous: Updated readme 62 = 1.3.0 = 63 * New Feature: Pretty permalinks for search 64 * New Feature: Page and post id's in a new admin column 65 * New Feature: Limits post revisions to 10 66 * New Security Feature: Removes WordPress version number from header 67 * New Security Feature: Changes login error message 68 * Miscellaneous: Updated readme, updated banner and icon
Note: See TracChangeset
for help on using the changeset viewer.