Changeset 2993746
- Timestamp:
- 11/10/2023 08:38:15 AM (9 months ago)
- Location:
- site-toolkit
- Files:
-
- 39 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
site-toolkit/trunk/.wp-env.json
r2942395 r2993746 1 1 { 2 "core": null, 2 "core": null, 3 "themes": [ 4 "https://downloads.wordpress.org/theme/twentytwentyfour.zip" 5 ], 3 6 "plugins": [ 4 7 "https://downloads.wordpress.org/plugin/wordpress-beta-tester.zip", … … 7 10 ], 8 11 "mappings": { 9 "wp-content": "./ content"12 "wp-content": "./content" 10 13 }, 11 "port": 10 00,12 "testsPort": 10 01,14 "port": 100, 15 "testsPort": 101, 13 16 "config": { 14 17 "WP_DEBUG": true, -
site-toolkit/trunk/composer.json
r2942395 r2993746 23 23 }, 24 24 "scripts": { 25 "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --ignore=vendor/*,node_modules/*,inc/cmb2/*, _root/*,content/* --extensions=php . -n -v --report-file=report.txt",26 "lint:wpcs:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --ignore=vendor/*,node_modules/*,inc/cmb2/*, _root/*,content/* --extensions=php .",25 "lint:wpcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --ignore=vendor/*,node_modules/*,inc/cmb2/*,content/* --extensions=php . -n -v --report-file=report.txt", 26 "lint:wpcs:fix": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --ignore=vendor/*,node_modules/*,inc/cmb2/*,content/* --extensions=php .", 27 27 "lint:php": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor .", 28 "make -pot": "wp i18n make-pot . languages/site-toolkit.pot",28 "makepot": "wp i18n make-pot . languages/site-toolkit.pot", 29 29 "readme": "@php ./vendor/wpreadme2markdown/wp2md/bin/wp2md -i readme.txt -o README.md" 30 30 }, -
site-toolkit/trunk/languages/site-toolkit-it_IT.po
r2845968 r2993746 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/site-toolkit\n" 7 7 "POT-Creation-Date: 2023-01-05T12:01:50+00:00\n" 8 "PO-Revision-Date: 2023- 01-05 12:06+0000\n"8 "PO-Revision-Date: 2023-+0000\n" 9 9 "Last-Translator: \n" 10 10 "Language-Team: \n" … … 14 14 "Content-Transfer-Encoding: 8bit\n" 15 15 "Plural-Forms: nplurals=2; plural=(n != 1);\n" 16 "X-Generator: Poedit 3. 2.2\n"16 "X-Generator: Poedit 3.\n" 17 17 "X-Domain: site-toolkit\n" 18 18 … … 122 122 #: toolkit/admin/class-site-toolkit-options-page.php:324 123 123 msgid " options" 124 msgstr " "124 msgstr " " 125 125 126 126 #: toolkit/admin/class-site-toolkit-options-page.php:349 … … 284 284 285 285 #: toolkit/admin/class-site-toolkit-options-page.php:799 286 msgid "Redirects the attachment pages to the homepage."287 msgstr "Reindirizza l e pagine degli allegati alla homepage."286 msgid "Redirects the attachment pages to the ." 287 msgstr "Reindirizza le." 288 288 289 289 #: toolkit/admin/class-site-toolkit-options-page.php:810 -
site-toolkit/trunk/languages/site-toolkit.pot
r2942395 r2993746 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Site Toolkit 1.0. 2\n"5 "Project-Id-Version: Site Toolkit 1.0.\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/site-toolkit\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2023- 07-23T15:10:01+01:00\n"12 "POT-Creation-Date: 2023-:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 "X-Generator: WP-CLI 2. 8.1\n"14 "X-Generator: WP-CLI 2.\n" 15 15 "X-Domain: site-toolkit\n" 16 16 … … 273 273 274 274 #: toolkit/admin/class-site-toolkit-options-page.php:782 275 msgid "Redirects the attachment pages to the homepage."275 msgid "Redirects the attachment pages to the ." 276 276 msgstr "" 277 277 … … 316 316 msgstr "" 317 317 318 319 320 321 322 318 323 #: toolkit/inc/posts-columns.php:23 319 324 msgid "Thumbnail" -
site-toolkit/trunk/readme.txt
r2942395 r2993746 4 4 Tags: archives,columns,emoji,header,tools,widgets 5 5 Requires at least: 5.9 6 Tested up to: 6. 36 Tested up to: 6. 7 7 Requires PHP: 7.4 8 Stable tag: 1.0. 28 Stable tag: 1.0. 9 9 License: GPLv3 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 32 32 = Archives = 33 33 1. Remove Archive Title Prefix: Removes the prefix in the archive title. 34 2. Redirect Attachments Pages: Redirects the attachment pages to the homepage.34 2. Redirect Attachments Pages: Redirects the attachment pages to the . 35 35 3. Redirect Archives: Redirects authors archive, dates archive, tags archive to the homepage. 36 36 … … 77 77 == Changelog == 78 78 79 80 81 82 79 83 = 1.0.2 = 80 84 * Tested up to 6.3 -
site-toolkit/trunk/site-toolkit.php
r2942395 r2993746 14 14 * Plugin URI: https://wordpress.org/plugins/site-toolkit/ 15 15 * Description: Sets of tools for WordPress admin and frontend. 16 * Version: 1.0. 217 * Requires at least: 5. 216 * Version: 1.0. 17 * Requires at least: 5. 18 18 * Requires PHP: 7.4 19 19 * Author: xlthlx -
site-toolkit/trunk/toolkit/admin/class-site-toolkit-options-page.php
r2845968 r2993746 780 780 */ 781 781 public function stk_media_callback() { 782 $this->stk_create_radio( 'stk_archives', 'media_redirect', __( 'Redirects the attachment pages to the homepage.', 'site-toolkit' ) );782 $this->stk_create_radio( 'stk_archives', 'media_redirect', __( 'Redirects the attachment pages to the .', 'site-toolkit' ) ); 783 783 } 784 784 -
site-toolkit/trunk/toolkit/inc/archive-title.php
r2845968 r2993746 7 7 8 8 /** 9 * Remove archive title.9 * Remove archive title. 10 10 * 11 11 * @param string $title The title. … … 15 15 function stk_remove_archive_title_prefix( $title ) { 16 16 $single_cat_title = single_term_title( '', false ); 17 if ( is_category() || is_tag() || is_tax() ) {17 if ( is_category() || is_tag() || is_tax() ) { 18 18 return esc_html( $single_cat_title ); 19 19 } -
site-toolkit/trunk/toolkit/inc/custom-login-url.php
r2845968 r2993746 88 88 $referer = wp_get_referer(); 89 89 $i_referer = parse_url( $referer ); 90 if ( false !== strpos( $referer, 'wp-activate.php' ) && ! empty( $i_referer['query'] )91 ) {90 if ( 91 92 92 parse_str( $referer['query'], $referer ); 93 93 … … 242 242 243 243 return $wp_classes; 244 245 } 244 } -
site-toolkit/trunk/toolkit/inc/emoji-support.php
r2845968 r2993746 15 15 */ 16 16 function stk_disable_emojis_remove_dns_prefetch( $urls, $relation_type ) { 17 if ( 'dns-prefetch' == $relation_type ) {17 if ( 'dns-prefetch' == $relation_type ) { 18 18 $emoji_svg_url_bit = 'https://s.w.org/images/core/emoji/'; 19 19 foreach ( $urls as $key => $url ) { … … 31 31 */ 32 32 function stk_disable_emoji_support() { 33 34 35 36 37 38 39 33 40 remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); 34 41 remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); 35 remove_action( 'wp_print_styles', 'print_emoji_styles' );36 42 remove_action( 'admin_print_styles', 'print_emoji_styles' ); 37 43 remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); -
site-toolkit/trunk/toolkit/inc/files-version.php
r2845968 r2993746 64 64 // External script/css. 65 65 if ( strpos( $clean_src, site_url() ) === false ) { 66 $return = preg_replace( '~(\? |&)ver=[^&]*~', '', $src );66 $return = preg_replace( '~(\?)ver=[^&]*~', '', $src ); 67 67 68 69 70 68 71 } 69 72 -
site-toolkit/trunk/toolkit/inc/header-links.php
r2845968 r2993746 8 8 /** 9 9 * Remove default style for comments widget. 10 11 10 12 */ 11 13 function stk_remove_comments_style() { … … 27 29 /** 28 30 * Remove RSD link, wlwmanifest Link, Shortlink, Previous/Next Post Link in the header. 31 32 29 33 */ 30 34 function stk_disable_links() { -
site-toolkit/trunk/toolkit/inc/pages-columns.php
r2845968 r2993746 14 14 */ 15 15 function stk_page_column_views( $columns ) { 16 unset( $columns[' comments'], $columns['date'] );16 unset( $columns['date'] ); 17 17 18 18 return array_merge( … … 20 20 array( 21 21 'page-layout' => __( 'Template', 'site-toolkit' ), 22 22 23 ) 23 24 ); -
site-toolkit/trunk/toolkit/inc/posts-columns.php
r2845968 r2993746 21 21 $columns, 22 22 array( 23 'thumbs' => __( 'Thumbnail', 'site-toolkit' ), 23 'thumbs' => __( 'Thumbnail', 'site-toolkit' ), 24 'date' => __( 'Date', 'site-toolkit' ), 24 25 ) 25 26 ); … … 37 38 function stk_posts_custom_columns( $column_name, $id ) { 38 39 if ( 'thumbs' === $column_name ) { 39 echo get_the_post_thumbnail( $id, 'thumbnail');40 echo get_the_post_thumbnail( $id, ); 40 41 } 41 42 } -
site-toolkit/trunk/toolkit/inc/redirect-attachments.php
r2845968 r2993746 13 13 14 14 if ( is_attachment() ) { 15 if ( isset( $post->post_parent ) && ( 0 !== $post->post_parent ) ) { 16 wp_redirect( get_permalink( $post->post_parent ), 301 ); 17 } else { 18 wp_redirect( home_url(), 301 ); 19 } 15 wp_redirect( wp_get_attachment_image_url( $post->ID, 'full' ), 301 ); 20 16 exit; 21 17 } -
site-toolkit/trunk/toolkit/inc/redirect-author.php
r2845968 r2993746 12 12 if ( is_author() ) { 13 13 wp_redirect( home_url(), 301 ); 14 14 15 die(); 15 16 } 16 17 } 17 18 add_action( 'template_redirect', 'stk_redirect_archives_author' ); -
site-toolkit/trunk/toolkit/inc/redirect-date.php
r2845968 r2993746 14 14 if ( is_date() ) { 15 15 wp_redirect( home_url(), 301 ); 16 16 17 die(); 17 18 } -
site-toolkit/trunk/toolkit/inc/redirect-tag.php
r2845968 r2993746 10 10 */ 11 11 function stk_redirect_archives_tag() { 12 if ( is_ author() ) {12 if ( is_() ) { 13 13 wp_redirect( home_url(), 301 ); 14 14 -
site-toolkit/trunk/toolkit/index.php
r2845968 r2993746 57 57 foreach ( $stk_dashboard as $key => $value ) { 58 58 // Radio fields yes/no. 59 if ( 'yes' === $value ) { 60 switch ( $key ) { 61 case 'dashboard_widgets': 62 add_action( 'wp_dashboard_setup', 'stk_disable_dashboard_widgets', 999 ); 63 break; 64 } 59 if ( ( 'yes' === $value ) && ( 'dashboard_widgets' === $key ) ) { 60 add_action( 'wp_dashboard_setup', 'stk_disable_dashboard_widgets', 999 ); 65 61 } 66 if ( $value ) { 67 switch ( $key ) { 68 case 'custom_widgets_title': 69 add_action( 'wp_dashboard_setup', 'stk_add_dashboard_widgets' ); 70 break; 71 } 62 if ( $value && ( 'custom_widgets_title' === $key ) ) { 63 add_action( 'wp_dashboard_setup', 'stk_add_dashboard_widgets' ); 72 64 } 73 65 } … … 109 101 break; 110 102 case 'media_redirect': 111 add_action( 'template_redirect', 'stk_attachment_pages_redirect' ); 103 if ( false === get_option( 'wp_attachment_pages_enabled' ) ) { 104 add_action( 'template_redirect', 'stk_attachment_pages_redirect' ); 105 } else { 106 update_option( 'wp_attachment_pages_enabled', 0 ); 107 } 112 108 break; 113 109 case 'redirect_author': … … 120 116 add_action( 'template_redirect', 'stk_redirect_archives_tag' ); 121 117 break; 118 119 120 121 122 122 } 123 123 } … … 155 155 if ( isset( $stk_login ) ) { 156 156 foreach ( $stk_login as $key => $value ) { 157 if ( '' !== $value ) { 158 switch ( $key ) { 159 case 'stk_login': 160 add_action( 'plugins_loaded', 'stk_plugins_loaded', 1 ); 161 add_action( 'wp_loaded', 'stk_wp_loaded' ); 157 if ( ( '' !== $value ) && ( 'stk_login' === $key ) ) { 158 add_action( 'plugins_loaded', 'stk_plugins_loaded', 1 ); 159 add_action( 'wp_loaded', 'stk_wp_loaded' ); 162 160 163 164 161 add_filter( 'site_url', 'stk_site_url', 10, 4 ); 162 add_filter( 'wp_redirect', 'stk_wp_redirect' ); 165 163 166 167 164 add_filter( 'site_option_welcome_email', 'stk_welcome_email' ); 165 add_filter( 'body_class', 'stk_admin_bar_body_class', 10, 2 ); 168 166 169 remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 ); 170 break; 171 } 167 remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 ); 172 168 } 173 169 } … … 180 176 foreach ( $stk_uploads as $key => $value ) { 181 177 // Radio fields yes/no. 182 if ( 'yes' === $value ) { 183 switch ( $key ) { 184 case 'clean_names': 185 if ( is_admin() ) { 186 add_action( 'wp_handle_upload_prefilter', 'stk_upload_filter' ); 187 add_action( 'add_attachment', 'stk_update_attachment_title' ); 188 } 189 break; 190 } 178 if ( ( 'yes' === $value ) && ( 'clean_names' === $key ) && is_admin() ) { 179 add_action( 'wp_handle_upload_prefilter', 'stk_upload_filter' ); 180 add_action( 'add_attachment', 'stk_update_attachment_title' ); 191 181 } 192 182 } 193 183 } 194 195
Note: See TracChangeset
for help on using the changeset viewer.