Skip to content
Docs
Get RestroPress

Filter

rpress_add_category_args

Updated
On this page

Filters the arguments used to create a menu category from the admin AJAX handler.

Runs in RP_AJAX::add_category() before wp_insert_term() creates the term in the food-category taxonomy. The arguments contain the parent term ID or null. Add arguments accepted by wp_insert_term(), such as description or slug.

Parameters#

ParameterTypeDescription
$argsarrayArguments for wp_insert_term(), initially the parent key only.

Return value#

array. Arguments passed to wp_insert_term().

Example#

function my_add_category_args( $args ) {
	$args['description'] = __( 'Added from the menu item screen.', 'my-textdomain' );
	return $args;
}
add_filter( 'rpress_add_category_args', 'my_add_category_args', 10, 1 );

Source#

Applied in:

  • includes/class-rpress-ajax.php (line 372), in RP_AJAX::add_category()
Was this page helpful?