Filter hook 'getarchives_where'

in WP Core File wp-includes/general-template.php at line 2051

View Source

getarchives_where

Filter Hook
Description
Filters the SQL WHERE clause for retrieving archives.

Hook Information

File Location wp-includes/general-template.php View on GitHub
Hook Type Filter
Line Number 2051

Hook Parameters

Type Name Description
string $sql_where Portion of SQL query containing the WHERE clause.
array $parsed_args An array of default arguments.

Usage Examples

Basic Usage
<?php
// Hook into getarchives_where
add_filter('getarchives_where', 'my_custom_filter', 10, 2);

function my_custom_filter($sql_where, $parsed_args) {
    // Your custom filtering logic here
    return $sql_where;
}

Source Code Context

wp-includes/general-template.php:2051 - How this hook is used in WordPress core
<?php
2046  	 * @since 2.2.0
2047  	 *
2048  	 * @param string $sql_where   Portion of SQL query containing the WHERE clause.
2049  	 * @param array  $parsed_args An array of default arguments.
2050  	 */
2051  	$where = apply_filters( 'getarchives_where', $sql_where, $parsed_args );
2052  
2053  	/**
2054  	 * Filters the SQL JOIN clause for retrieving archives.
2055  	 *
2056  	 * @since 2.2.0

PHP Documentation

<?php
/**
	 * Filters the SQL WHERE clause for retrieving archives.
	 *
	 * @since 2.2.0
	 *
	 * @param string $sql_where   Portion of SQL query containing the WHERE clause.
	 * @param array  $parsed_args An array of default arguments.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/general-template.php
Related Hooks

Related hooks will be displayed here in future updates.