From 5c843dc76f5f6bfaeba584fc3605afcb44a1662c Mon Sep 17 00:00:00 2001 From: Keith Solomon Date: Tue, 11 Aug 2026 20:18:06 -0500 Subject: [PATCH] Wire social-share hook + make Follow button provider-aware MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The social-share buttons function was hooked to projects_after_download_button, but the template never fired that action — the buttons never rendered. Added a do_action() call after the View Repo button. The Follow button hardcoded a GitHub URL and used the GitHub-specific github-button class (which only acts on github.com). Replaced with a plain styled link pointing at the owner's actual URL (works for any provider). Removed the assets/js/buttons.js enqueue since nothing uses the github-button class anymore. Renamed the project-github-button CSS class on the View Repo link to project-repo-button since it's provider-neutral now. --- projects-portfolio.php | 12 ++++-------- templates/single-projects.php | 5 +++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/projects-portfolio.php b/projects-portfolio.php index 026e537..e4b81b3 100644 --- a/projects-portfolio.php +++ b/projects-portfolio.php @@ -115,7 +115,7 @@ function projects_portfolio_handle_download_redirect() { // Use wp_redirect() (not wp_safe_redirect()) because the destination // is an external host the user has explicitly configured — wp_safe_redirect // would reject it and fall back to admin_url(). - wp_redirect( esc_url_raw( $download_url ), 302 ); + wp_redirect( esc_url_raw( $download_url ), 302 ); // phpcs:ignore exit; } else { wp_die( @@ -273,13 +273,9 @@ function projects_portfolio_enqueue_project_styles() { } if ( is_singular( 'projects' ) ) { - wp_enqueue_script( - 'projects-wp-buttons', - plugin_dir_url( __FILE__ ) . 'assets/js/buttons.js', - array(), - PROJECTS_PORTFOLIO_VERSION, - true - ); + // assets/js/buttons.js was used to render GitHub-style follow buttons. + // The Follow button now uses a plain styled link (works for any provider), + // so the script is no longer enqueued. } } add_action( 'wp_enqueue_scripts', 'projects_portfolio_enqueue_project_styles' ); diff --git a/templates/single-projects.php b/templates/single-projects.php index a6fa294..d89df0b 100644 --- a/templates/single-projects.php +++ b/templates/single-projects.php @@ -69,12 +69,13 @@ if ( $last_updated ) { - +

+
@@ -151,7 +152,7 @@ if ( $last_updated ) { - +