humanmade / humanmade/network-media-library

Filters not working, unable to change site ID

Open
#76 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
296
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Hi

I have been experimenting with the plugin but only been able to get it to work if hard code the site ID constant.

Could you maybe provide some support / direction on where i may be going wrong.

I have tried both the following:
```
add_filter( 'network-media-library/site_id', function( $site_id ) {
return 18;
} );
```

```
add_filter( 'network-media-library/site_id', array( $this, 'multi_media_network_side_id' ), 999, 1 );

public function multi_media_network_side_id( $site_id ) {
$site_id = (int) get_theme_mod( 'network_media_id' );

if ( false !== $site_id ) {
return $site_id;
}

return 0;
}
```

After some debugging the site id filter is being run but does not seem to be applying it the variable.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the two network-media-library/site_id filter examples and trace where the filtered site ID is read. Confirm whether a dynamically returned site ID is applied, and document the failing path or add a regression test if the repository provides one.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.