From a282583d462f47615a45e934d8777c4e672123bf Mon Sep 17 00:00:00 2001 From: Brandon Hundt Date: Thu, 14 Mar 2024 14:47:57 -0500 Subject: [PATCH 1/6] feat(tw-admin-link): add --- wp-content/themes/the-world/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-content/themes/the-world/functions.php b/wp-content/themes/the-world/functions.php index 10b2ee3ee..df935df4e 100644 --- a/wp-content/themes/the-world/functions.php +++ b/wp-content/themes/the-world/functions.php @@ -261,3 +261,8 @@ function tw_remove_core_block_patterns() { // Remove Windows Live Writer manifest link. remove_action( 'wp_head', 'wlwmanifest_link' ); + +add_action('admin_menu', 'add_custom_menu_link'); +function add_custom_menu_link() { + add_menu_page('my_custom_link_1', 'The World Homepage', 'read', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); +} From 3125d77b1193e5505f36fb461e4c09aeb9c88a32 Mon Sep 17 00:00:00 2001 From: Brandon Hundt Date: Fri, 15 Mar 2024 14:58:10 -0500 Subject: [PATCH 2/6] fix(functions): clean up admin menu link function --- wp-content/themes/the-world/functions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wp-content/themes/the-world/functions.php b/wp-content/themes/the-world/functions.php index df935df4e..da374b0bc 100644 --- a/wp-content/themes/the-world/functions.php +++ b/wp-content/themes/the-world/functions.php @@ -262,7 +262,9 @@ function tw_remove_core_block_patterns() { // Remove Windows Live Writer manifest link. remove_action( 'wp_head', 'wlwmanifest_link' ); -add_action('admin_menu', 'add_custom_menu_link'); -function add_custom_menu_link() { - add_menu_page('my_custom_link_1', 'The World Homepage', 'read', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); -} +if ( ! function_exists( 'tw_custom_menu_link' ) ) : + function tw_custom_menu_link() { + add_menu_page('my_custom_link_1', 'The World Homepage', 'read', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); + } +endif; +add_action('admin_menu', 'tw_custom_menu_link'); From 6f1dcb0d1ff270e838bb26804355f39477975e83 Mon Sep 17 00:00:00 2001 From: Brandon Hundt Date: Fri, 15 Mar 2024 15:07:44 -0500 Subject: [PATCH 3/6] fix(functions): improve add_menu_page variables --- wp-content/themes/the-world/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-content/themes/the-world/functions.php b/wp-content/themes/the-world/functions.php index da374b0bc..1c698d69b 100644 --- a/wp-content/themes/the-world/functions.php +++ b/wp-content/themes/the-world/functions.php @@ -264,7 +264,7 @@ function tw_remove_core_block_patterns() { if ( ! function_exists( 'tw_custom_menu_link' ) ) : function tw_custom_menu_link() { - add_menu_page('my_custom_link_1', 'The World Homepage', 'read', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); + add_menu_page('tw_edit_hompage_link', 'The World Homepage', 'publish_posts', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); } endif; add_action('admin_menu', 'tw_custom_menu_link'); From c6c120fb235c47bca0e551fc25563b066b4abb63 Mon Sep 17 00:00:00 2001 From: Brandon Hundt Date: Fri, 15 Mar 2024 15:25:43 -0500 Subject: [PATCH 4/6] fix spelling error in variable --- .vscode/settings.json | 85 +++++++++++++---------- wp-content/themes/the-world/functions.php | 7 +- 2 files changed, 53 insertions(+), 39 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index e97ea5e42..7c5b384b5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,41 +1,50 @@ { - "cSpell.words": [ - "ABSPATH", - "DOCROOT", - "jetpack", - "Lando", - "multidev", - "multidevs", - "newspack", - "pullquote", - "SITEURL", - "ssot", - "uncategorized", - "untrailingslashit", - "wpcfm", - "WPINC", - "WPMU" - ], - "cSpell.ignorePaths": [ - "package-lock.json", - "node_modules", - "vscode-extension", - ".git/objects", - ".vscode", - ".vscode-insiders", - "wp-content/plugins", - "vendor" - ], - "phpcs.composerJsonPath": "composer.json", - "phpcs.executablePath": "./vendor/bin/phpcs", - "phpcs.standard": "WordPress", - "phpSniffer.autoDetect": true, - "phpSniffer.standard": "WordPress", - "editorconfig.generateAuto": false, - "editor.formatOnSave": true, - "[php]": { - "editor.defaultFormatter": "wongjn.php-sniffer" - }, + "cSpell.words": [ + "ABSPATH", + "blockembed", + "dashicons", + "DOCROOT", + "httponly", + "jetpack", + "Lando", + "multidev", + "multidevs", + "newspack", + "pagename", + "postname", + "pullquote", + "shortcode", + "SITEURL", + "ssot", + "theworld", + "uncategorized", + "untrailingslashit", + "wlwmanifest", + "wpcfm", + "WPINC", + "WPMU", + "wpseo" + ], + "cSpell.ignorePaths": [ + "package-lock.json", + "node_modules", + "vscode-extension", + ".git/objects", + ".vscode", + ".vscode-insiders", + "wp-content/plugins", + "vendor" + ], + "phpcs.composerJsonPath": "composer.json", + "phpcs.executablePath": "./vendor/bin/phpcs", + "phpcs.standard": "WordPress", + "phpSniffer.autoDetect": true, + "phpSniffer.standard": "WordPress", + "editorconfig.generateAuto": false, + "editor.formatOnSave": true, + "[php]": { + "editor.defaultFormatter": "wongjn.php-sniffer" + }, "[html]": { "editor.defaultFormatter": "co6x0.vscode-wp-block-html" }, @@ -45,7 +54,7 @@ "editor.quickSuggestions": { "strings": "on" }, - "editor.defaultFormatter": null, + "editor.defaultFormatter": null, "eslint.format.enable": true, "[javascriptreact]": { "editor.defaultFormatter": "dbaeumer.vscode-eslint" diff --git a/wp-content/themes/the-world/functions.php b/wp-content/themes/the-world/functions.php index 1c698d69b..c3f03c0db 100644 --- a/wp-content/themes/the-world/functions.php +++ b/wp-content/themes/the-world/functions.php @@ -263,8 +263,13 @@ function tw_remove_core_block_patterns() { remove_action( 'wp_head', 'wlwmanifest_link' ); if ( ! function_exists( 'tw_custom_menu_link' ) ) : + /** + * Add . + * + * @uses add_menu_page() Add links to the menu. + */ function tw_custom_menu_link() { - add_menu_page('tw_edit_hompage_link', 'The World Homepage', 'publish_posts', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); + add_menu_page('tw_edit_homepage_link', 'The World Homepage', 'publish_posts', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); } endif; add_action('admin_menu', 'tw_custom_menu_link'); From c5ba8755eae7e22c173ab36bb4929fe7d7763420 Mon Sep 17 00:00:00 2001 From: Brandon Hundt Date: Fri, 15 Mar 2024 15:29:45 -0500 Subject: [PATCH 5/6] fix(functions): add better description to function --- wp-content/themes/the-world/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-content/themes/the-world/functions.php b/wp-content/themes/the-world/functions.php index c3f03c0db..b1ccff961 100644 --- a/wp-content/themes/the-world/functions.php +++ b/wp-content/themes/the-world/functions.php @@ -264,7 +264,7 @@ function tw_remove_core_block_patterns() { if ( ! function_exists( 'tw_custom_menu_link' ) ) : /** - * Add . + * Add convenient link for editors to edit homepage. * * @uses add_menu_page() Add links to the menu. */ From 0fe3219e7ae955fae372c6fb126c0c42f43a8144 Mon Sep 17 00:00:00 2001 From: Brandon Hundt Date: Fri, 15 Mar 2024 15:31:09 -0500 Subject: [PATCH 6/6] rename funciton --- wp-content/themes/the-world/functions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/the-world/functions.php b/wp-content/themes/the-world/functions.php index b1ccff961..d530f5da9 100644 --- a/wp-content/themes/the-world/functions.php +++ b/wp-content/themes/the-world/functions.php @@ -262,14 +262,14 @@ function tw_remove_core_block_patterns() { // Remove Windows Live Writer manifest link. remove_action( 'wp_head', 'wlwmanifest_link' ); -if ( ! function_exists( 'tw_custom_menu_link' ) ) : +if ( ! function_exists( 'tw_add_edit_homepage_menu_link' ) ) : /** * Add convenient link for editors to edit homepage. * * @uses add_menu_page() Add links to the menu. */ - function tw_custom_menu_link() { + function tw_add_edit_homepage_menu_link() { add_menu_page('tw_edit_homepage_link', 'The World Homepage', 'publish_posts', "/wp-admin/term.php?taxonomy=program&tag_ID=2&post_type=post", '', 'dashicons-admin-site-alt3', 8); } endif; -add_action('admin_menu', 'tw_custom_menu_link'); +add_action('admin_menu', 'tw_add_edit_homepage_menu_link');