array( 'type' => 'boolean' ), 'entries_removed' => array( 'type' => 'integer' ), ); } /** * Deliberately empty. 'confirm' must not be schema-required — see * Base_Rank_Math_Ability::ability(). A required confirm would make an * unconfirmed call fail core schema validation before execute() runs, so the * caller would get a generic ability_invalid_input instead of * confirmation_required and the message naming the flag. */ protected function required_input(): array { return array(); } protected function annotations(): array { return array( 'readonly' => false, 'destructive' => true, 'idempotent' => true ); } /** * @param array $input * @return array|WP_Error */ protected function run( array $input ) { $result = Instant_Indexing_Repository::clear_log(); if ( is_wp_error( $result ) ) { return $result; } $result['message'] = sprintf( /* translators: %d: number of log entries removed */ _n( 'Removed %d IndexNow log entry.', 'Removed %d IndexNow log entries.', $result['entries_removed'], 'acrossai-abilities-manager' ), $result['entries_removed'] ); return $result; } }