Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hook to filter return of get_tax_args function #752

Closed
michaeltorbert opened this issue Feb 22, 2017 · 6 comments

Comments

Projects
None yet
4 participants
@michaeltorbert
Copy link
Member

commented Feb 22, 2017

Reference: https://wordpress.org/support/topic/sitemap-all-taxonomiy-terms/

In aioseop_sitemap.php, we should add a filter to get_tax_args() on line 2598 so users can manipulate the arguments https://developer.wordpress.org/reference/functions/get_terms/#parameters

We could either a) just filter the return $args array, or b) add our own individual filters for each argument or c) both.

@michaeltorbert michaeltorbert self-assigned this Feb 27, 2017

@michaeltorbert michaeltorbert added the API label Feb 27, 2017

@michaeltorbert michaeltorbert modified the milestones: 2.3.12, 2.3.13 Feb 27, 2017

@wpsmort wpsmort modified the milestones: 2.3.14, 2.3.13 Mar 22, 2017

@wpsmort wpsmort modified the milestones: 2.3.15, 2.3.16 Jul 11, 2017

@wpsmort wpsmort modified the milestones: 2.3.16, 2.3.17 Aug 22, 2017

@wpsmort wpsmort modified the milestones: 2.3.17, 2.5 Sep 5, 2017

@contactashish13

This comment has been minimized.

Copy link
Contributor

commented Dec 26, 2017

PR: #1430

@michaeltorbert

This comment has been minimized.

Copy link
Member Author

commented Jan 31, 2018

@contactashish13 Why are we adding $page, $this->options as additional arguments?

@contactashish13

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2018

I tend to add any parameter that might be useful for the hook - in this case I can see options being useful for sure to determine taxonomy behavior on the basis of the settings. Can't think of a pressing case for $page.

@michaeltorbert michaeltorbert modified the milestones: 2.5, 2.6 Mar 22, 2018

@wpsmort wpsmort modified the milestones: 2.6, 2.7 May 24, 2018

@wpsmort wpsmort assigned contactashish13 and unassigned wpsmort May 24, 2018

@wpsmort

This comment has been minimized.

Copy link
Member

commented May 24, 2018

@contactashish13 I tested this but it doesn't appear that the get_tax_args function is being called. Can you test and make sure the function is being called and provide a working example of how to use this filter.

@contactashish13

This comment has been minimized.

Copy link
Contributor

commented Sep 20, 2018

@wpsmort the functions gets called. You can test it by adding just an error_log.

The filter is

apply_filters( 'aiosp_sitemap_tax_args', $args, $page, $sitemap_options )

You can use the below snippet for removing the taxonomy exclusions:

add_filter( 'aiosp_sitemap_tax_args', 'aiosp_sitemap_tax_args', 10, 1 );
function aiosp_sitemap_tax_args( $args ) {
    unset( $args['exclude'] );
    return $args;
}
@arnaudbroes

This comment has been minimized.

Copy link
Contributor

commented Nov 20, 2018

@contactashish13 I'm currently drafting documentation for this filter. From what I understand, this filter allows you to filter taxonomy terms.

Could you please let me know what these arguments exactly are and what they're used for -

  • $args
  • $page (is this the page ID?)
  • $sitemap_options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.