Skip to content

Commit

Permalink
See pewresearch/pewresearch-org@ef66262 from refs/heads/main
Browse files Browse the repository at this point in the history
  • Loading branch information
prcdevgitbot committed Jun 11, 2024
1 parent 8a19318 commit 76c3943
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions includes/features/class-features.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use WP_Error;
use WP_REST_Request;
use WP_REST_Response;
use WP_Term;

class Features {
public static $post_type = 'feature';
Expand Down Expand Up @@ -760,6 +761,12 @@ public function rewrite_index() {
// get the primary research-team taxonomy term slug for this based on the $post_slug
$post = get_page_by_path( $post_slug, OBJECT, self::$post_type );
$primary_research_term = get_primary_term_id('research-teams', $post->ID);
$primary_research_term = get_term_by( 'id', $primary_research_term, 'research-teams' );
if ( $primary_research_term instanceof WP_Term ) {
$primary_research_term = $primary_research_term->slug;
} else {
$primary_research_term = '';
}
$primary_research_term = sanitize_title( $primary_research_term );
$url_prefix = $primary_research_term ? $primary_research_term . '/' : '';
add_rewrite_rule(
Expand Down
8 changes: 5 additions & 3 deletions includes/wp-admin/class-wp-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,20 @@ public function init($loader = null) {
remove_filter( 'authenticate', 'wpcom_vip_limit_logins_for_restricted_usernames', 30 );
}

// Actions
$loader->add_action( 'admin_enqueue_scripts', $this, 'enqueue_assets' );
$loader->add_action( 'login_enqueue_scripts', $this, 'login_logo' );
$loader->add_action( 'wp_before_admin_bar_render', $this, 'manage_admin_bar', 100 );
$loader->add_action( 'wp_before_admin_bar_render', $this, 'manage_tools_menu', 101 );
$loader->add_action( 'wp_before_admin_bar_render', $this, 'manage_edit_menu', 102 );
$loader->add_filter( 'get_user_option_admin_color', $this, 'default_admin_color_scheme' );
$loader->add_action( 'admin_print_footer_scripts', $this, 'admin_footer' );
$loader->add_filter( 'disable_cookiepro', $this, 'disable_cookie_banner_conditions', 10, 1 );
$loader->add_action( 'admin_menu', $this, 'modify_menu', 10 );
$loader->add_action( 'wp_dashboard_setup' , $this, 'remove_dashboard_widgets', 99 );
$loader->add_filter( 'multisite_enhancements_status_label', $this, 'multisite_enhancement_plugin_sites_label', 10, 2 );
$loader->add_action( 'init', $this, 'disable_emojis' );
// Filters
$loader->add_filter( 'get_user_option_admin_color', $this, 'default_admin_color_scheme' );
$loader->add_filter( 'disable_cookiepro', $this, 'disable_cookie_banner_conditions', 10, 1 );
$loader->add_filter( 'multisite_enhancements_status_label', $this, 'multisite_enhancement_plugin_sites_label', 10, 2 );
$loader->add_filter( 'ppp_nonce_life', $this, 'define_public_post_preview_lifetime' ) ;
$loader->add_filter( 'the_excerpt', $this, 'remove_overview_from_excerpts' );
$loader->add_filter( 'update_footer', $this, 'output_platform_version_in_wp_admin', 100 );
Expand Down

0 comments on commit 76c3943

Please sign in to comment.